OS は CentOS 5.7 でやってみる。インストールは、LINUX-HA JAPAN より、ローカルリポジトリ + yum を使用。
クラスタ制御部には、Corosync を使用することにする。
/etc/corosync/corosync.conf を作成。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # Please read the corosync.conf.5 manual page compatibility: whitetank aisexec { user: root group: root } service { name: pacemaker ver: 0 use_mgmtd: yes } totem { version: 2 secauth: off threads: 0 rrp_mode: active clear_node_high_bit: yes token: 4000 consensus: 10000 rrp_problem_count_timeout: 3000 interface { ringnumber: 0 bindnetaddr: 192.168.234.0 mcastaddr: 226.94.1.1 mcastport: 5405 ttl: 1 } } logging { fileline: on to_stderr: no to_logfile: yes to_syslog: no logfile: /var/log/cluster/corosync.log debug: off timestamp: on } |
ログをファイルに出力するように指定。
/etc/init.d/corosync start で起動して、crm_mon を実行して確認する。
1 | Attempting connection to the cluster......................... |
一般ユーザで実行したからっぽい。グループに、haclient を追加したら帰ってきた。
1 2 3 4 5 6 7 8 9 10 | ============ Last updated: Sun Feb 12 00:54:09 2012 Stack: openais Current DC: localhost.localdomain - partition WITHOUT quorum Version: 1.0.11-1554a83db0d3c3e546cfd3aaff6af1184f79ee87 1 Nodes configured, 2 expected votes 0 Resources configured. ============ Online: [ localhost.localdomain ] |
次に、 crm configure help でコマンドを確認しようとするも、
1 | cibadmin not available, check your installation |
1 2 3 4 | # crm configure property no-quorum-policy="ignore" stonith-enabled="false" # crm configure rsc_defaults resource-stickiness="INFINITY" migration-threshold="1" # crm configure primitive vip ocf:heartbeat:IPaddr2 \ params ip="192.168.234.51" nic="eth0" cidr_netmask="24" op monitor interval="10s" |
ifconfig で確認するも設定したアドレスが見当たらない。
eth0 にはそもそも実インターフェースの IP が割当たっているからだ。
ip addr show eth0 で確認できる。
1 | inet 192.168.234.51/24 brd 192.168.234.255 scope global secondary eth0 |
最初、CentOS 6 を使用して普通に yum でインストールして開始したわけだが、こっちのほうが嵌まった。
Pacemaker が 1.1 になっており、クラスタ部に heartbeat が使えなかったり、corosync.conf の service の ver を 1 にしないとだったり、vip 指定時に nic に eth0:1 などを指定すると警告が出たりとかなり面倒だった。
結局、CentOS5.7 を使うことになり、落としたわけだが・・・