创建web服务资源:
1
|
[root@node1 ~]
# pcs resource create http lsb:httpd op monitor interval=20 timeout=20 on-fail=restart
|
创建文件系统资源
1
|
[root@node1 ~]
# pcs resource create webstore ocf:heartbeat:Filesystem params device="192.168.30.115:/web/data" directory="/var/www/html" fstype="nfs" op monitor interval=20 timeout=20 on-fail=restart
|
创建IP地址资源
1
|
[root@node1 ~]
# pcs resource create webip ocf:heartbeat:IPaddr ip=192.168.30.230 op monitor interval=20 timeout=20 on-fail=restart
|
查看指定资源属性:
1
|
[root@node1 ~]
# pcs resource list lsb
|
查看资源类别:
1
|
[root@node1 ~]
# pcs resource standards
|
查看默认资源管理器:
1
2
3
|
[root@node1 ~]
# pcs resource providers
heartbeat
pacemaker
|
查看某个资源的代理:
1
|
[root@node1 ~]
# pcs resource agents lsb
|
设置排列约束(资源同时启动,关闭,重启)
1
|
[root@node1 ~]
# pcs constraint colocation add webip http
|
设置顺序约束(资源启动关闭顺序)
1
2
|
[root@node1 ~]
# pcs constraint order start webip then start http
Adding webip http (kind: Mandatory) (Options: first-action=start
then
-action=start)
|
设置集群全局属性
1
|
[root@node1 ~]
# pcs property set no-quorum-policy=ignore
|
设置集群节点为备用节点,以及重新上线
1
2
|
[root@node1 ~]
# pcs cluster standby node1.luojianlong.com
[root@node1 ~]
# pcs cluster unstandby node1.luojianlong.com
|
本文转自ljl_19880709 51CTO博客,原文链接:http://blog.51cto.com/luojianlong/1383807
,如需转载请自行联系原作者