2015年2月8日日曜日

#morisnite vol.2 とは

おととい2015年2月6日
#morisnite vol.2
というエンジニアが多く集まる、��を消化する会が行われました。
会場を提供くださいました、株式会社フリークアウト様ありがとうございました。
ささやかながら、お礼としてブログに書くことで多少なれとも社会的認識が上がれば幸いかと。


詳細はこちら
http://connpass.com/event/11600/

で、参加動機としては、エンジニアとの交流エンジニア狩り狩りを目的としていました。 というのは、さておき

オンプレ環境でがっつりあれこれやっていたので、クラウドサービス上で事業を展開するところで働きたいなあ、と思っています。

とあったので、じゃあ何処がいいの?と思って聞ききに行ければと思いました。

http://tagomoris.hatenablog.com/

参加者心得?
 大人の節度を忘れず少年のように楽しみましょう。

いい大人が手ぶらで飲みに行くのもなんだから、さっと食べられるプチトマトを成城石井で購入。

大きな地図で見る
あと、お酒を飲み疲れたら水が飲みたくなるという知見をtokyurubykaigiというイベントで得たので、2リッターのペットボトルの水を1本持って行きました。
パーティーにはリッツが欠かせないのでと思いきやシンプルなタイプはなかったので、チーズが挟まったタイプを購入

今度ここにくる方の参考になればと思います。
適度に飲食物を持ち込みたいといったケースに有効。
会場入りする前に食材を持って移動するのはつらいので。

あと、料理ガチな方は料理持ち込みされていらして、唐揚げ作って持って来た。(私が1つ美味しく頂きました。醤油ベースの味で旨い。しょっぱすぎず鳥肉の味がジューシー)
生ハム原木の持ち込みされる方もいらした。(旨い。旨すぎる。)

#morisnite vol.2
式次
 (遅刻参加したので、挨拶は知らない。)
・しゃべりたい人が喋る。
・飲みたいだけ飲む。
・バスケットゴールが1つあるのでシュートをする。


自分は何度かお会いした事のある方と以下の様な事を話した。
皆さんの同意を得ていないので、誰と話したかは一旦伏せておこう。

・自分の所属している会社のアレがアレの件。深入りした場合はそれだけになってしまうんでは?(例:mysqlおじさん)
・近所の図書館の蔵書は技術書が多く最高。その後オススメした方が図書カードを作ったのかを確認。
・過去に自作サーバ同窓会という物が行われたが卒業した方はまたハードウェアに手を出すのか?または出さないのか?
 昨今、facebookがハードウェアを開発していたりする状況を鑑みるとまた自作サーバブームはくるのか?
・crossでアンカンファレンスをしたらエンジニアの知り合い増えたかどうか。また誕生日にatnd建てたらどーか。

あと一番の収穫はあのクラウドのサービスで期待されているものがとても素晴らしい。
詳しくはハッシュタグを検索。乞うご期待。

エンジニア飲み素晴らしい
そこそこ協調して、食べ物持参、酒持参。
毎回では準備に疲れてしまうだろうから、たまにはいい。

次の日、
dots. Summit 2015 - ドッツサミット #dotssummit
http://eventdots.jp/event/309318
が開催されるが、お構いなしに飲んでいた。
こんな事を寛大に容認していただける事業社はなかなか他にない。

たまたま話しかけた方が中の人で人事に関わる方で、今日の会場撤収と、次の日のイベント開催の為に開場を担当されるとの事だった。
本当にお疲れ様です。

酔っ払いどもの陣頭指揮をして、会場の片付けを進行してくださいました、@myfinder 氏ありがとうございます。

あと、オリーブの実を買った方。
私は好きなのでばくばく食べましたが、量が多く余っていましたよ。
私の持ち込んだプチトマトも余ったな。
自分が食べる分+ちょっとでも皆が集まると、そのちょっとが多くなる。
乾パンとかも1缶あまっていたので、私がもらいました。

次回の��送り先は会場へ直接がいいのでは。
@tagomoris さんお疲れ様でした。

2015年1月11日日曜日

VirtualBoxX上のCentOS6.5 x86_64でDPDK1.8.0を試す

DPDK
http://dpdk.org
VirtualBoxX上のCentOS6.5 x86_64環境でDPDK1.8.0をビルドしてみた。

クイックスタートのtestpmdを実行するまでの方法。
http://dpdk.org/doc/quick-start

ダウンロード先
http://dpdk.org/download

注意点
1)cpu-coreは2コア以上が望ましい。
2)NICはIntel PRO/1000 MT Server(82545EM)等を選択。 Intel PRO/1000MT Desktop (82540EM)での動作は未確認。
3)DPDKのドライバで利用するNICは内部ネットワークでも良い。(以下手順ではNATでの動作は未確認。)

3)を実行するにあたり、都合3枚のNIC設定があったほうがいい。
1枚は通常のsshアクセス等に利用。残す2枚はDPDKの対向テスト等で使う事を想定。

以下の様な環境で動作を確認した。
VirtualBOX 4.2.12 r84980 (MacOS版)

# rpm -qa centos-release
centos-release-6-5.el6.centos.11.1.x86_64
# uname -a
Linux localhost.localdomain 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

おおよその手順
1)ビルド用準備
2)ドライバビルド
3)ドライバのインストール

1)ビルド用準備
まずは、ドライバのビルドの為に、実行中のカーネルのヘッダーとmakeファイルが必要になるのでインストールしておく。
# yum install kernel-headers kernel-devel kernel

ヘッダーと実行中のカーネルのバージョンを合わせる手前、最新のカーネルにしてしまっている。
必要があれば、現在利用しているカーネルのバージョンとkernel-headers kernel-develのバージョンを合わせる。
# rpm -qa kernel-devel kernel-headers
kernel-devel-2.6.32-504.3.3.el6.x86_64
kernel-headers-2.6.32-504.3.3.el6.x86_64

ビルドをするので、gcc等もグループインストールしてしまう。
# yum --disablerepo=\* --enablerepo=base groupinstall "Development tools"
途中、pythonからlspciを実行しているので、pciutilsも必須となる。
# yum --disablerepo=\* --enablerepo=base install pciutils

2)ドライバビルド
クイックスタートにある通り、ドライバのmakeはできる。
# curl -OL http://dpdk.org/browse/dpdk/snapshot/dpdk-1.8.0.tar.gz
# tar zxvf dpdk-1.8.0.tar.gz
# cd dpdk-1.8.0
# make config T=x86_64-native-linuxapp-gcc
# make

3)ドライバのインストール
# modprobe uio
# insmod build/kmod/igb_uio.ko
# tools/dpdk_nic_bind.py --bind=igb_uio $(tools/dpdk_nic_bind.py --status | sed -rn 's,.* if=([^ ]*).*igb_uio *$,\1,p')

正常に組み込めていれば、dpdk_nic_bind.pyの実行結果は以下の様になる。
# python tools/dpdk_nic_bind.py --status

Network devices using DPDK-compatible driver
============================================
0000:00:08.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000
0000:00:09.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000

Network devices using kernel driver
===================================
0000:00:11.0 '82545EM Gigabit Ethernet Controller (Copper)' if=eth0 drv=e1000 unused=igb_uio *Active*

Other network devices
=====================



なおの事詳しく確認する場合、lspci -kの実行結果が確認し易い。
# lspci -k
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
Kernel driver in use: ata_piix
Kernel modules: ata_generic, pata_acpi, ata_piix
00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service
00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
Subsystem: Intel Corporation Device 0000
Kernel driver in use: Intel ICH
Kernel modules: snd-intel8x0
00:06.0 USB controller: Apple Inc. KeyLargo/Intrepid USB
Kernel driver in use: ohci_hcd
00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
Kernel modules: i2c-piix4
00:08.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 02)
Subsystem: VMware PRO/1000 MT Single Port Adapter
Kernel driver in use: igb_uio (←igb_uioが適応されている。)
Kernel modules: e1000
00:09.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 02)
Subsystem: VMware PRO/1000 MT Single Port Adapter
Kernel driver in use: igb_uio (←igb_uioが適応されている。)
Kernel modules: e1000
00:0b.0 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller
Kernel driver in use: ehci_hcd
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02)
Kernel driver in use: ahci
Kernel modules: ahci
00:11.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 02)
Subsystem: VMware PRO/1000 MT Single Port Adapter
Kernel driver in use: e1000 (←igb_uioが適応されていない 上記のNetwork devices using kernel driverで表示されているデバイスで通常のNICとして使っている。)
Kernel modules: e1000

もちろんdmesgでも確認できる。
igb_uio: Use MSIX interrupt by default
e1000 0000:00:08.0: PCI INT A disabled
igb_uio 0000:00:08.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
igb_uio 0000:00:08.0: uio device registered with irq 10
e1000 0000:00:09.0: PCI INT A disabled
igb_uio 0000:00:09.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
igb_uio 0000:00:09.0: uio device registered with irq 11
といったigb_uioに関するログがあるはず。

huge pages memoryの為のデバイスを作成してマウントする。
# mkdir -p /mnt/huge
# mount -t hugetlbfs nodev /mnt/huge
# echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages

正常に実行できていれば以下の様にcatできるはず。
# cat /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
64

Set the highest frequencyの設定はしなくとも実行できそう。(情報持っている方はコメントくださいますと幸いです。)
https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/cpufreq_setup.html
この辺りの情報が関係あるのかもと推測。
手元の環境ではCPUfreq ドライバーがインストールできなかった。

これで、testpmdが実行できるはず。
手元の環境ではcpuコア等の指定が正しく無い為か、以下の様に中断してしまった。
おそらくtestpmdのオプション指定が手元の環境と正しく合っていない。
マニュアルに基づき正しく指定する必要がある。
http://www.intel.com/content/dam/www/public/us/en/documents/guides/intel-dpdk-testpmd-application-user-guide.pdf
(cpuコアは4コアを設定している。)
ちなみに、testpmd -aは使えなかった。

# build/app/testpmd -c2 -n2 -- -i --nb-cores=2 --nb-ports=2
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
EAL: Setting up memory...
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f9f79200000 (size = 0x200000)
EAL: Ask a virtual area of 0x7000000 bytes
EAL: Virtual area found at 0x7f9f72000000 (size = 0x7000000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f9f71c00000 (size = 0x200000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7f9f71600000 (size = 0x400000)
EAL: Ask a virtual area of 0x400000 bytes
EAL: Virtual area found at 0x7f9f71000000 (size = 0x400000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f9f70c00000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7f9f70800000 (size = 0x200000)
EAL: Requesting 64 pages of size 2MB from socket 0
EAL: TSC frequency is ~2512331 KHz
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable clock cycles !
EAL: Master core 1 is ready (tid=7a415800)
PMD: ENICPMD trace: rte_enic_pmd_init
EAL: PCI device 0000:00:08.0 on NUMA socket -1
EAL: probe driver: 8086:100f rte_em_pmd
EAL: PCI memory mapped at 0x7f9f79400000
PMD: eth_em_dev_init(): port_id 0 vendorID=0x8086 deviceID=0x100f
EAL: PCI device 0000:00:09.0 on NUMA socket -1
EAL: probe driver: 8086:100f rte_em_pmd
EAL: PCI memory mapped at 0x7f9f79420000
PMD: eth_em_dev_init(): port_id 1 vendorID=0x8086 deviceID=0x100f
EAL: PCI device 0000:00:11.0 on NUMA socket -1
EAL: probe driver: 8086:100f rte_em_pmd
EAL: 0000:00:11.0 not managed by UIO driver, skipping
PANIC in main():
Empty set of forwarding logical cores - check the core mask supplied in the command parameters
5: [build/app/testpmd() [0x4273c9]]
4: [/lib64/libc.so.6(__libc_start_main+0xfd) [0x7f9f795e0d5d]]
3: [build/app/testpmd(main+0xb65) [0x42b5e5]]
2: [build/app/testpmd(__rte_panic+0xc0) [0x427310]]
1: [build/app/testpmd(rte_dump_stack+0x1e) [0x49606e]]
アボートしました

# build/app/testpmd -a
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 4 lcore(s)
build/app/testpmd: invalid option -- 'a'

2014年2月2日日曜日

ruby-2.0.0-p247.tar.gzをビルドした際に出るエラー'EC_GROUP_new_curve_GF2m'について。とりあえずruby-2.0.0-p353.tar.gzにすれば解決。

rubyはバージョンアップが頻繁にある。
そこでrpmを独自に作成して管理したいケースが出てくる。
こちらに習いビルドしてみた。
http://nullpopopo.blogcube.info/2013/07/centos-ruby200rpm.html

EC_GROUP_new_curve_GF2m
というエラーが出てしまう。 詳しく原因を特定していないが、bug等があるようだ。
ruby-2.0.0-p353.tar.gzに差し替えて、SPECファイルを書き換えた。

%define rubyver         2.0.0
%define rubyminorver    p353

Name:           ruby
Version:        %{rubyver}%{rubyminorver}
Release:        2%{?dist}
License:        Ruby License/GPL - see COPYING
URL:            http://www.ruby-lang.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  readline readline-devel ncurses ncurses-devel gdbm gdbm-devel glibc-devel tcl-devel gcc unzip openssl-devel db4-devel byacc make libyaml-devel
Source0:        ftp://ftp.ruby-lang.org/pub/ruby/ruby-%{rubyver}-%{rubyminorver}.tar.gz
Summary:        An interpreter of object-oriented scripting language
Group:          Development/Languages
Provides: ruby(abi) = 2.0
Provides: ruby-irb
Provides: ruby-rdoc
Provides: ruby-libs
Provides: ruby-devel
Provides: rubygems
Obsoletes: ruby
Obsoletes: ruby-libs
Obsoletes: ruby-irb
Obsoletes: ruby-rdoc
Obsoletes: ruby-devel
Obsoletes: rubygems

%description
Ruby is the interpreted scripting language for quick and easy
object-oriented programming.  It has many features to process text
files and to do system management tasks (as in Perl).  It is simple,
straight-forward, and extensible.

%prep
%setup -n ruby-%{rubyver}-%{rubyminorver}

%build
export CFLAGS="$RPM_OPT_FLAGS -Wall -fno-strict-aliasing"

%configure \
  --enable-shared \
  --disable-rpath \
  --without-X11 \
  --without-tk \
  --includedir=%{_includedir}/ruby \
  --libdir=%{_libdir}

make %{?_smp_mflags}

%install
# installing binaries ...
make install DESTDIR=$RPM_BUILD_ROOT

#we don't want to keep the src directory
rm -rf $RPM_BUILD_ROOT/usr/src

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%{_bindir}
%{_includedir}
%{_datadir}
%{_libdir}
%define rubyminorver p353 だけ変更した。
rpmbuildすれば、
ruby-2.0.0p353-2.el6.x86_64.rpm
ruby-debuginfo-2.0.0p353-2.el6.x86_64.rpm
が作成できる。

2014年1月13日月曜日

splunk>®5.0.2からIDCF CloudStorageを使う

splunk5.0.2には、Amazon S3を参照出来るAdd-onがある。
Splunk for Amazon S3 Add-on
http://apps.splunk.com/app/1137/
URLは変わる恐れがあるので、SplunkにログインしてAppのサーチをかけた方がいい。
s3でいくつか該当する。

これをAmazon S3以外に使えないものか試した。
具体的には、株式会社IDCフロンティア様が提供するサービスのクラウドストレージを利用した。
http://www.idcf.jp/cloud/service/storage.html
なお、これを書いている、2014年1月13日の段階では既に新規の申し込みを受け付けていない。
今は極限られた条件の方しか試せない。
他の環境のS3互換APIを利用しているソフトウェアでも試せるかも知れない。
以下、自己責任でお試し願います。

これは内部的にはRiakが動作している。
http://www.idcf.jp/cloud/service/dstorage.html

分散ストレージをSplunkから閲覧出来ると利便性が高い。

・動作環境
CentOS 6.2-x86_64
Splunk 5.0.2 ビルド 149561

・設定手順
1)appのダウンロード

http://apps.splunk.com/app/1137/

より、任意のPCにて
splunk-for-amazon-s3-add-on_11.tgz
をダウンロードする。

2)ダウンロードしたapp内のファイル変更。
tgzを展開するとs3というディレクトリの中にs3.pyというファイルがある。
このファイルの7行目のENDPOINT_HOST_PORTを変更して保存する。
ENDPOINT_HOST_PORT = "ds.jp-east.idcfcloud.jp:80"
:80が無いと正しく動作しないようだ
ENDPOINTの確認方法はIDCFの場合以下の場所から確認出来た。


上記のスクリーンショットは、開発中の画面で変更される可能性がある。

3)変更したファイルを再アーカイブ
先ほどのs3.pyを差し替えてtgz形式でアーカイブする。

linuxであれば次の様になる。
tar czvf splunk-for-amazon-s3-add-on_11.tgz s3

4)splunkへappをアップロード。
splunkにログインしてsplunk-for-amazon-s3-add-on_11.tgzをアップロードする。
管理、app、ファイルからAppをインストールとクリックすると次の様な画面となる。

選択、から先ほど新たに作成した、splunk-for-amazon-s3-add-on_11.tgzを指定して緑のアップロードをクリックする。

正常にアップロードできれば以下の様に、管理、Appとクリックして遷移した画面のApp一覧に追加される。


s3という項目が追加されている。

・利用方法
管理、データ入力という箇所にAmazon S3という項目が追加されている。
右側の新規追加をクリック。

Resource name、Key ID、秘密鍵の項目を入力する。
Resource nameには、s3://を含めない。
バケット以下のディレクトリは/で指定した場合バケット内の各ファイルが参照される。
gz等で圧縮されたファイルでも認識される。

正常に追加されれば、データ入力の画面から確認できる

app、searchと選択し、ソースタイプの一覧にs3のバケット名が表示されれば、splunkから検索出来る様になる。

2013年4月6日土曜日

CentOS6 fail2banインストール

fail2ban公式サイトhttp://www.fail2ban.org/wiki/index.php/Main_Page

参考ページ
http://ncloud.cocolog-nifty.com/blog/2011/07/fail2ban-c392.html
JIRA、Confluenceでの利用方法
http://doc.go2group.jp/pages/viewpage.action?pageId=34866474

インストール
必要なrpm
http://dl.fedoraproject.org/pub/epel/6/x86_64/fail2ban-0.8.8-2.el6.noarch.rpm
http://dl.fedoraproject.org/pub/epel/6/x86_64/python-inotify-0.9.1-1.el6.noarch.rpm
http://dl.fedoraproject.org/pub/epel/6/x86_64/shorewall-4.5.4-1.el6.noarch.rpm
http://dl.fedoraproject.org/pub/epel/6/x86_64/shorewall-core-4.5.4-1.el6.noarch.rpm
http://mirror.centos.org/centos/6/os/x86_64/Packages/gamin-python-0.1.10-9.el6.x86_64.rpm

wget \
http://dl.fedoraproject.org/pub/epel/6/x86_64/fail2ban-0.8.8-2.el6.noarch.rpm \
http://dl.fedoraproject.org/pub/epel/6/x86_64/python-inotify-0.9.1-1.el6.noarch.rpm \
http://dl.fedoraproject.org/pub/epel/6/x86_64/shorewall-4.5.4-1.el6.noarch.rpm \
http://dl.fedoraproject.org/pub/epel/6/x86_64/shorewall-core-4.5.4-1.el6.noarch.rpm \
http://mirror.centos.org/centos/6/os/x86_64/Packages/gamin-python-0.1.10-9.el6.x86_64.rpm

rpm -ivh gamin-python-0.1.10-9.el6.x86_64.rpm \
fail2ban-0.8.8-2.el6.noarch.rpm \
python-inotify-0.9.1-1.el6.noarch.rpm \
shorewall-4.5.4-1.el6.noarch.rpm \
shorewall-core-4.5.4-1.el6.noarch.rpm

起動
service fail2ban start


2013年2月14日木曜日

GitBashの/usr/local

windowsのMingwベースのGitBashにて
mkdir /usr/local
とすると
C:\Users\ユーザ名\AppData\Local\VirtualStore\Program Files\Git\local
ここになる。

2012年12月12日水曜日

Keynote'09の背景イメージ格納先

Keynote'09の背景画像は個性的で美しい物が多い。
誰もが他でも使いたいと思う様だ。

Keynote3の頃から利用を望む人も、
https://discussionsjapan.apple.com/thread/10036463?start=0&tstart=0
2007/05/23 20:34

手元の、Keynote'09ではkthとしてまとめられていて転用は出来ないようだ。
プレビュー等であれば、
/Applications/Keynote.app/Contents/Resources/Themes/Imagine/Contents/Resources/
配下に見つかる。

日本語による「黒板」「掲示板」といった説明が入っていて転用は難しい。