新しい記事を書く事で広告が消せます。
なんか投稿したら後半ぶった切られたので、軽く失望しておく。
久しぶりに少し。
(技術系のネタは徐々に放棄予定)
今期の視聴中アニメについて一口っておく。
Intelの格安NICを使う手段がネット上で散見され、
以下の参考リンクを見ればコマンド等の情報は十分だ。
参考リンク
http://d.hatena.ne.jp/tokuhy/20100621/1277138446
http://heppoko.blogdns.net/?p=3476
http://funmoco.seesaa.net/article/51419020.html
http://blog.goo.ne.jp/silvernetworks/e/d48558a382bbeb33bc7f0dd38fddbbb1
http://cid-97aa742f70e4e44b.spaces.live.com/blog/cns!97AA742F70E4E44B!135.entry
http://support.ap.dell.com/support/edocs/network/intelpro/r213333/ja/iscsi/index.htm
必要なもの
・iSCSI HBAとして起動時にiSCSIの設定をNICに叩き込めるモードを持つNICとBoot ROM。
NICの候補
・EXPI9301CT:実売4000円程度
・EXPI9400PT:実売10000円程度
もっと高いのが手に入ったらそれでもいい。
ISCSI Boot ROM用Link
・Intel純正
http://downloadcenter.intel.com/SearchResult.aspx?lang=jpn&keyword=%22ISBoot.exe%22
・DELL用
http://supportapj.dell.com/support/downloads/download.aspx
Intelでは最新版のみ手に入る様子。
組み合わせるマザーボードによっては起動時にIntel Boot Agentが立ち上がらない可能性があるので、
Intel純正で駄目な場合、DELLの方でバージョン落としてみると上手くいくケースがある。
手元の環境で確認したIntel Boot Agentの立ち上がり状況
EXPI9301CT(Intel v15.2) + DH57JG(JG0537P.BIO) : NG
EXPI9400PT(Intel v15.2) + DH57JG(JG0537P.BIO) : NG
EXPI9400PT(DELL v10.0A01) + DH57JG(JG0537P.BIO) : OK
ZFSと組み合わせてHAST + ZFS + iSCSI + ucarpが出来ると楽だろうなー、と思って、た。
http://wiki.freebsd.org/HAST
man hastd(8)
とりあえず、基本動作から見ていく。
ucarpは後回し。
準備ノード(1はfreebsd8.0からのupgrade。関係ないけど。)
ノード1 : FreeBSD 8.1-p0 hostname=hast-01
ノード2 : FreeBSD 8.1-p0 hostname=hast-02
手順はこんな感じか。
1.ノード1,2の/etc/hast.confに設定を書く。
resource hasthd1 {
local /dev/da1
on hast-01 {
remote 192.168.1.49
}
on hast-02 {
remote 192.168.1.48
}
}
2.ノード1,2でcreate。
hast-01# hastctl create hasthd1
hast-02# hastctl create hasthd1
3.ノード1,2でhastdの開始。
hast-01# echo hastd_enable="YES" >> /etc/rc.conf
hast-01# /etc/rc.d/hastd start
hast-02# echo hastd_enable="YES" >> /etc/rc.conf
hast-02# /etc/rc.d/hastd start
4.ノード1をprimaryに。
hast-01# hastctl role primary hasthd1
5.ノード2をsecondaryに
hast-02# hastctl role secondary hasthd1
6.確認コマンド
hast-01# hastctl status
hasthdd:
role: primary
provname: hasthdd
localpath: /dev/da1
extentsize: 2097152
keepdirty: 64
remoteaddr: 192.168.1.49
replication: memsync
status: complete
dirty: 0 bytes
hast-02# hastctl status
hasthdd:
role: secondary
provname: hasthdd
localpath: /dev/da1
extentsize: 2097152
keepdirty: 0
remoteaddr: 192.168.1.48
replication: memsync
status: complete
dirty: 0 bytes
hast.confのremoteの表記は、manによれば以下のどれでもいいらしい。
0.0.0.0
0.0.0.0:8457
tcp://0.0.0.0
tcp://0.0.0.0:8457
tcp4://0.0.0.0
tcp4://0.0.0.0:8457
IPv6では動かない。
↓こうなる。
# cat /etc/hast.conf
resource hasthddv6 {
local /dev/da2
on hast-01 {
remote tcp6://2001:380:e08:f7::49
}
on hast-02 {
remote tcp6://2001:380:e08:f7::48
}
}
# hastctl status
hasthddv6:
role: init
provname: hasthddv6
localpath: /dev/da2
extentsize: 0
keepdirty: 0
remoteaddr: tcp6://2001:db8:e08:f7::48
replication: memsync
dirty: 0 bytes
# hastctl role primary hasthddv6
# hastctl status
[ERROR] Error 57 received from hastd.
どこかにIPv6じゃ動かない、って書いてあったかなぁ・・・。
閑話休題。
で、これでブロックデバイス(のようなもの)が共有できたので、primary側でZFS poolを作る。
どちらにせよ、secondary側では/dev/hast/hasthd1が見えないはずなので作れない。
フルパスで指定する。
# zpool create hast-zfs /dev/hast/hasthd1
で、primaryとsecondaryを入れ替える。(手動で。
ノード1をsecondaryに
hast-01# hastctl role secondary hasthd1
ノード2をprimaryに。
hast-02# hastctl role primary hasthd1
で、こうすると元primaryは残念な感じに。
hast-01# zpool status
pool: hast-zfs
state: UNAVAIL
status: One or more devices could not be opened. There are insufficient
replicas for the pool to continue functioning.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-3C
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
hast-zfs UNAVAIL 0 0 0 insufficient replicas
hast/hasthd1 UNAVAIL 0 0 0 cannot open
新しくprimaryになったhast-02は、/dev/hast/hasthd1が見えるようになっているので、importできる。
hast-02# zpool import -f hast-zfs
とはいえ、直前まで元primaryが使用していたため、-fつけないと無理。
元primaryのhast-01側では、zpool statusするとUNAVAILが残っていてうっとうしいからって、
いきなりzpool destroy hast-zfsするとプロンプト帰ってこなくなるのでよろしく。
もう少し調べる。
まずソースコードをダウンロードします。
http://dev.mysql.com/downloads/mysql/5.5.html#downloads
Development Releasesから、Source CodeをSelectして、
Generic Linux (Architecture Independent), Compressed TAR Archiveを入手。
ビルドに必要な物を先にインストール
# apt-get install build-essential
# apt-get install libncursesw5-dev
解凍
# tar zxvf mysql-5.5.5-m3.tar.gz
./configure
# cd mysql-5.5.5-m3
# ./configure --with-plugins=innobase
※下記の場合はlibncurses5-devまたはlibncursesw5-devのインストール。
checking for termcap functions library... configure: error: No curses/termcap library found
./configure後、Makefileを書き直す。
参考 : http://bugs.mysql.com/bug.php?id=55350
参考から抽出。
Suggested fix:
Temp fix was remove @ndbcluster_includes@ from ./extra/Makefile and ./sql/MakeFile plus
remove @NDB_SCI_LIBS@ from ./sql/MakeFile
viで./extra/Makefileを開いて、:%s/@ndbcluster_includes@//g
viで./sql/MakeFileを開いて、:%s/@ndbcluster_includes@//g、:%s/@NDB_SCI_LIBS@//g
sedで書くと、
# sed -i -e 's/@ndbcluster_includes@//g' sql/Makefile
# sed -i -e 's/@ndbcluster_includes@//g' extra/Makefile
# sed -i -e 's/@NDB_SCI_LIBS@//g' sql/Makefile
make。
make && make install
終わり。