1. Make sure you have successfully set up DNS resolution and NTP time synchronization for both your Linux Cluster nodes.
vi /etc/sysconfig/network
设定主机名为short name, not FQDN
here, I use /etc/hosts to simplify
vi /etc/hosts
# eth0 network for production10.10.10.2 zabbixweb02p
2. wget http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/network:ha-clustering:Stable.repo -O /etc/yum.repos.d/ha.repo
3. on two nodes
yum -y install pacemaker cman crmsh
4. on two nodes
vi /etc/sysconfig/cman
CMAN_QUORUM_TIMEOUT=0
5. on two nodes
vi /etc/cluster/cluster.conf
<?xml version="1.0"?>
<cluster config_version="1" name="mycluster">
<logging debug="off"/>
<clusternodes>
<clusternode name="zabbixweb01p" nodeid="1">
<fence>
<method name="pcmk-redirect">
<device name="pcmk" port="zabbixweb01p"/>
</method>
</fence>
</clusternode>
<clusternode name="zabbixweb02p" nodeid="2">
<fence>
<method name="pcmk-redirect">
<device name="pcmk" port="zabbixweb02p"/>
</method>
</fence>
</clusternode>
</clusternodes>
<fencedevices>
<fencedevice name="pcmk" agent="fence_pcmk"/>
</fencedevices>
</cluster>
6. on two nodes
ccs_config_validate
7. on two nodes
service cman start
check nodes status with cman_tool nodes
8. on two nodes
service pacemaker start
chkconfig cman on
chkconfig pacemaker on
9. for a two nodes cluster, run from one node
crm configure property stonith-enabled="false"
crm configure property no-quorum-policy="ignore"
#crm configure rsc_defaults resource-stickiness="100"
10. crm_verify -LV
crm status
Pacemaker 简要使用说明:
[root@zabbixweb01 ~]# crm
crm(live)# [Tab][Tab]
? cd configure exit history options ra site up
bye cib end help node quit resource status
crm(live)#ra
crm(live)ra#
? cd end help list providers up
bye classes exit info meta quit
crm(live)ra# classes
lsb
ocf / heartbeat linbit pacemaker redhat
service
stonith
crm(live)ra# list lsb
NetworkManager abrt-ccpp abrt-oops abrtd acpid atd
auditd autofs avahi-daemon blk-availability bluetooth certmonger
cman corosync corosync-notifyd cpuspeed crond cups
crm(live)ra# list ocf heartbeat
AoEtarget AudibleAlarm CTDB ClusterMon Delay
Dummy EvmsSCC Evmsd Filesystem ICP
IPaddr IPaddr2 IPsrcaddr IPv6addr LVM
LinuxSCSI MailTo ManageRAID ManageVE Pure-FTPd
Raid1 Route SAPDatabase SAPInstance SendArp
ServeRAID SphinxSearchDaemon Squid Stateful SysInfo
VIPArip VirtualDomain WAS WAS6 WinPopup
Xen Xinetd anything apache asterisk
conntrackd db2 dhcpd drbd eDir88
ethmonitor exportfs fio iSCSILogicalUnit iSCSITarget
ids iscsi jboss ldirectord lxc
mysql mysql-proxy named nfsserver nginx
oracle oralsnr pgsql pingd portblock
postfix pound proftpd rsyncd rsyslog
scsi2reservation sfex slapd symlink syslog-ng
tomcat varnish vmware zabbixserver
crm(live)ra# info lsb:sshd
lsb:sshd
SSH is a protocol for secure remote shell access. \
This service starts up the OpenSSH server daemon.
Operations' defaults (advisory minimum):
start timeout=15
stop timeout=15
status timeout=15
restart timeout=15
force-reload timeout=15
monitor timeout=15 interval=15
crm(live)ra# info ocf:heartbeat:vmware
Manages VMWare Server 2.0 virtual machines (ocf:heartbeat:vmware)
OCF compliant script to control vmware server 2.0 virtual machines.
Parameters (* denotes required, [] the default):
vmxpath* (string): VMX file path
VMX configuration file path
vimshbin (string, [/usr/bin/vmware-vim-cmd]): vmware-vim-cmd path
vmware-vim-cmd executable path
Operations' defaults (advisory minimum):
start timeout=600
stop timeout=600
monitor timeout=30 interval=300
crm(live)ra#