pacemaker 構築ガイド
pacemaker 構築ガイド
pacemaker 構築ガイド
Power Systems
Pacemaker
• HA
–
– Linux-HA Japan
– Red Hat RHEL High Availability Add-On HA
• Pacemaker
– / / Pacemaker
VIOS
ent0 ent0
192.168.48.11 192.168.48.12
node1 node2
CentOS 7.5 CentOS 7.5
pacemaker1
node1, node2
Floating IP 192.168.48.180
IP
2.
–
– yum
– pacemaker
•
– pcs :
• pacemaker corosync
– corosync :
•
• pacemaker
•
node1 $ attrd_updater --version
Pacemaker 1.1.18-11.el7_5.3
Written by Andrew Beekhof
node1 $ corosync -v
Corosync Cluster Engine, version '2.4.3'
Copyright (c) 2006-2009 Red Hat, Inc.
2018 10 CentOS
192.168.48.11 node1
192.168.48.12 node2
• SSH
– SSH 1
•
node1 $ firewall-cmd --permanent --add-service=high-availability
success
node1 $ firewall-cmd --reload
success
• “hacluster”
– Hacluster pacemaker
• corosync config 1
• STONITH
– STONITH 1
• pcs
– “/var/lib/pacemaker/cib/cib.xml” pcs
192.168.48.11
node1
192.168.48.180
192.168.48.12
node2
• “my_vg” 1
• “my_lv” 1
• ext4 my_lv 1
• Apache HTTP
node1 $ yum install httpd
•
node1 $ firewall-cmd --permanent --add-service=http
success
node1 $ firewall-cmd --reload
success
• html
1
• Apache
node1 $ vi /etc/httpd/conf/httpd.conf
node1 $ cat /etc/httpd/conf/httpd.conf
~ ~
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
• /etc/lvm/lvm.conf
“volume_list”
node1 $ vi /etc/lvm/lvm.conf
volume_list = [ "ca" ]
•
“initramfs”
node1 $ dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
LVM my_lvm
Filesystem my_fs
apachegroup
IPaddr2 ClusterIP
apache WebSite
• LVM “my_lvm”
node1 $ pcs resource create my_lvm LVM volgrpname=my_vg exclusive=true --group apachegroup
Assumed agent name 'ocf:heartbeat:LVM' (deduced from 'LVM')
• Filesystem “my_fs”
node1 $ pcs resource create my_fs Filesystem device="/dev/my_vg/my_lv" directory="/var/www"
fstype="ext4" --group apachegroup
Assumed agent name 'ocf:heartbeat:Filesystem' (deduced from 'Filesystem')
• Filesystem “my_fs”
node1 $ pcs resource create ClusterIP IPaddr2 ip=192.168.48.120 cidr_netmask=32 op monitor interval=30s
--group apachegroup
• apache “WebSite”
node1 $ pcs resource create WebSite apache configfile="/etc/httpd/conf/httpd.conf"
statusurl="http://127.0.0.1/server-status" --group apachegroup
© 2018 IBM Corporation 22
(2/2)
• 1
node1 $ pcs status
~ ~
2 nodes configured
4 resources configured
~ ~
• 1
– Floating IP Web
node1 $ pcs constraint order ClusterIP then WebSite
Adding ClusterIP WebSite (kind: Mandatory) (Options: first-action=start then-action=start)
1
•
node1 $ pcs constraint location WebSite prefers node1=50
2 nodes configured
4 resources configured
~ ~
~ ~
•
– LVM
– pacemaker “crm_mon”
node1 $ pcs status
Cluster name: pacemaker1
~ ~
~ ~
Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled
2 nodes configured
4 resources configured
Online: [ node2 ]
node1 OFFLINE
OFFLINE: [ node1 ]
• node1 node1
node2 $ pcs status
~ ~
$ yum -y install automake autoconf libtool libtool-ltdl-devel libuuid-devel pkgconfig glib2-devel libxml2-devel
libxslt-devel bzip2-devel libqb-devel
$ git clone https://github.com/ppc64le/build-scripts/blob/master/corosync/corosync_rhel_7.4.sh
$ ./corosync_rhel_7.4.sh
corosync_rhel_7.4sh URL
Git
https://github.com/ppc64le/build-scripts/blob/master/corosync/corosync_rhel_7.4.sh