查看
crm(live)configure# show
node marvin \
attributes standby=off
node sherry
primitive webip IPaddr \
params ip=192.168.1.199
primitive webserver lsb:nginx
colocation webserver_and_webip inf: webserver webip
property cib-bootstrap-options: \
have-watchdog=false \
dc-version=1.1.14-8.el6-70404b0 \
cluster-infrastructure="classic openais (with plugin)" \
expected-quorum-votes=2 \
stonith-enabled=false
具体查看:
crm(live)configure# show xml
<rsc_colocation score="INFINITY" rsc="webserver" with-rsc="webip"/> #webserver跟着webip
顺序约束:
crm(live)configure# order webip-before-webserver mandatory: webip webserver #依次顺序
crm(live)configure# verify
crm(live)configure# commit
crm(live)configure# status
order webip-before-webserver Mandatory: webip webserver
crm(live)configure# show xml
<rsc_order kind="Mandatory" first="webip" then="webserver"/>
位置约束
crm(live)configure# location webip_on_marvin webip 200: marvin
crm(live)configure# verify
crm(live)configure# commit
查看:
crm(live)# status
Last updated: Wed Jun 1 21:11:58 2016 Last change: Wed Jun 1 21:11:32 2016 by root via cibadmin on sherry
Stack: classic openais (with plugin)
Current DC: marvin (version 1.1.14-8.el6-70404b0) - partition with quorum
2 nodes and 2 resources configured, 2 expected votes
Online: [ marvin sherry ]
Full list of resources:
webip (ocf::heartbeat:IPaddr): Started marvin
webserver (lsb:nginx): Started marvin
over
Ansible+Corosync+Pacemaker+NFS实现http高可用
基于Corosync+Pacemaker+DRBD+LNMP实现Web服务器高可用集群