[root@host tmp]# wget url [root@host tmp]# tar zxf pacemaker-1.0.11-1.2.1.el5.x86_64.repo.tar.gz
[root@host tmp]# cd pacemaker-1.0.11-1.2.1.el5.x86_64.repo [root@host tmp]# yum -c pacemaker-1.0.11-1.2.1.el5.x86_64.repo/pacemaker.repo install pacemaker heartbeat pm_extras pacemaker | 951 B 00:00 pacemaker/primary | 9.5 kB 00:00 pacemaker 23/23 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package heartbeat.x86_64 0:3.0.5-1.1.el5 set to be updated --> Processing Dependency: heartbeat-libs = 3.0.5-1.1.el5 for package: heartbeat --> Processing Dependency: PyXML for package: heartbeat --> Processing Dependency: cluster-glue for package: heartbeat snip Installed: heartbeat.x86_64 0:3.0.5-1.1.el5 pacemaker.x86_64 0:1.0.11-1.2.el5 pm_extras.x86_64 0:1.1-1.el5 snip Complete!
pacemaker on autojoin off node host1 node host2 watchdog /dev/watchdog respawn root /usr/lib64/heartbeat/ifcheckd
keepalive 2 deadtime 30 warntime 10 initdead 120 udpport 694 ucast eth0 192.168.1.2 #bcast eth1 eth2 #mcast eth0 225.0.0.1 694 1 0
#logfile /var/log/ha-log logfacility local0 #debug 1 #debugfile /var/log/ha-debug
auth 1 1 sha1 shared-key
[root@host ~]# crm configure property \ no-quorum-policy="ignore" \ stonith-enabled="false"
[root@host ~]# crm configure rsc_defaults \ resource-stickiness="INFINITY" \ migration-threshold="num"
[root@host ~]# crm configure primitive resource-name \ class:provider:type \ params param=value \ meta meta=value \ op op_type attribute=value
op_type | 説明 |
start | リソース起動時のパラメーターを設定 |
stop | リソース停止時のパラメーターを設定 |
status | |
monitor | リソース監視時のパラメーターを設定 |
attribute | 説明 |
interval | 監視間隔、monitor に設定可能 |
timeout | タイムアウト値 この時間内にオペレーションが終わらないと、失敗とみなされる |
on-fail | オペレーションが失敗した場合の挙動 restart … リソースを停止させ、フェイルオーバーさせる (デフォルト) stop … リソースを停止させるが、フェイルオーバーはさせない fence … 障害が発生したサーバを STONITH で再起動、リソースをフェイルオーバーさせる block … リソースの管理を停止して放置する? ignore … 無視する |
[root@host ~]# crm configure primitive rsc_apache \ ocf:heartbeat:apache \ params configfile="/etc/httpd/conf/httpd.conf" \ statusurl="http://localhost/server-status" \ testregex="service" \ meta migration-threshold="2" \ op monitor interval="10s"
[root@host ~]# crm configure primitive rsc_vip \ ocf:heartbeat:IPaddr2 \ params ip="192.168.0.98" \ nic="eth0" \ unique_clone_address="true|false"
[root@host ~]# crm configure primitive rsc_ping \ ocf:pacemaker:pingd \ params name="attr_ping" \ host_list="192.168.0.1" \ multiplier="100" \ dampen="1"
[root@host ~]# crm configure primitive rsc_disk \ ocf:pacemaker:Filesystem
[root@host ~]# crm configure group group-name resource-name1 resource-name2 [...]
[root@host ~]# crm configure group grp_web rsc_apache rsc_vip
[root@host ~]# crm configure order order-name score-type: resource-name1:action resource-name2:action
[root@host ~]# crm configure clone clone-name resource-name meta globally-unique="true|false" clone-max="num" clone-node-max="num"
[root@host ~]# [root@host1 ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 08:00:27:e9:a1:64 brd ff:ff:ff:ff:ff:ff inet 192.168.0.96/24 brd 192.168.0.255 scope global eth0 inet 192.168.0.98/24 brd 192.168.0.255 scope global secondary eth0 [root@host2 ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 08:00:27:8b:f4:70 brd ff:ff:ff:ff:ff:ff inet 192.168.0.97/24 brd 192.168.0.255 scope global eth0 inet 192.168.0.99/24 brd 192.168.0.255 scope global secondary eth0
[root@host ~]# crm configure location location_name resouce_name \ rule rule
[root@host ~]# crm configure location lct_web grp_web \ rule 200: #uname eq host1 \ rule 100: #uname eq host2 \ rule -INFINITY: defined attr_ping and attr_ping lt 100
[root@host ~]# crm configure location lct_web grp_web \ rule -INFINITY: not_defined attr_ping or attr_ping lt 100
[root@host ~]# crm configure colocation colocation_name score: resource-name1 resource-name2
[root@host ~]# crm configure erase
[root@host ~]# crm configure show
[root@host ~]# crm_mon [option]
オプション | 意味 | 説明 |
-A | attributes | アトリビュートも出力する |
-f | fail counts | フェイル カウントも出力する |
-r | resources | アクティブではないリソースも出力する |
-n | node | ノード単位で出力する |
-itime | interval | 更新間隔を指定する |
-1 | 1 shot | 継続的な表示をしない |
[root@host ~]# crm resource cleanup resource_name [hostname]
[root@host1 ~]# crm_mon -A snip Migration summary: * Node host2: * Node host1: rsc_apache:0: migration-threshold=1 fail-count=1 Failed actions: rsc_apache:0_monitor_10000 (node=host1, call=22, rc=7, status=complete): not running [root@host1 ~]# crm resource cleanup rsc_apache host1 Cleaning up rsc_apache on host1 Waiting for 2 replies from the CRMd..
[root@host ~]# crm resource migrate resource_name hostname [force]
[root@host ~]# crm resource unmigrate resource_name
[root@host ~]# crm node standby hostname
[root@host ~]# crm node online hostname
[root@host ~]# crm configure config help
[root@host ~]# crm ra info resource-type
ex)
host# crm configure primitive help usage: primitive <rsc> [<class>:[<provider>:]]<type> [params <param>=<value> [<param>=<value>...]] [meta <attribute>=<value> [<attribute>=<value>...]] [operations id_spec [op op_type [<attribute>=<value>...] ...]]
host# crm ra info ocf:heartbeat:IPaddr2 Manages virtual IPv4 addresses (Linux specific version) (ocf:heartbeat:IPaddr2) This Linux-specific resource manages IP alias IP addresses. It can add an IP alias, or remove one. In addition, it can implement Cluster Alias IP functionality if invoked as a clone resource. Parameters (* denotes required, [] the default): ip* (string): IPv4 address The IPv4 address to be configured in dotted quad notation, for example "192.168.1.1". snip Operations' defaults (advisory minimum): start timeout=20s stop timeout=20s status interval=10s timeout=20s monitor interval=10s timeout=20s