Sending 'pacemaker_remote authkey' to 'node3', 'node4'
node4: successful distribution of the file 'pacemaker_remote authkey'
node3: successful distribution of the file 'pacemaker_remote authkey'
Sending cluster config files to the nodes...
node3: Succeeded
node4: Succeeded
Synchronizing pcsd certificates on nodes node3, node4...
node3: Success
node4: Success
Restarting pcsd on the nodes in order to reload the certificates...
node4: Success
node3: Success
##状态显示为no faults即为正常状态
[iyunv@node3 crmsh-2.3.2]# corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
id = 10.0.0.5
status = ring 0 active with no faults
[iyunv@node4 crmsh-2.3.2]# corosync-cfgtool -s
Printing ring status.
Local node ID 2
RING ID 0
id = 10.0.0.6
status = ring 0 active with no faults
##集群信息、pcs、pacemaker和corosync工作状态也能看见
[iyunv@node4 crmsh-2.3.2]# pcs status
Cluster name: mycluster
WARNING: no stonith devices and stonith-enabled is not false
Stack: corosync
Current DC: node4 (version 1.1.16-12.el7_4.4-94ff4df) - partition with quorum
Last updated: Mon Oct 30 23:13:30 2017
Last change: Mon Oct 30 23:07:49 2017 by hacluster via crmd on node4
[iyunv@node3 crmsh-2.3.2]# crm_verify -L -V
error: unpack_resources: Resource start-up disabled since no STONITH resources have been defined
error: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option
error: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity
Errors found during check: config not valid
##错误显示没有启用STONITH resources,我么暂时不需要先先关闭此选项
[iyunv@node3 crmsh-2.3.2]# pcs property set stonith-enabled=false
[iyunv@node3 crmsh-2.3.2]# crm_verify -L -V
##定义DRBD管理的资源,设置主从,“verify”是检查配置有无错误
crm(live)configure# primitive mfs_drbd ocf:linbit:drbd params drbd_resource=mfs op monitor role=Master interval=10 timeout=20 op monitor role=Slave interval=20 timeout=20 op start timeout=240 op stop timeout=100
crm(live)configure# verify
crm(live)configure# ms ms_mfs_drbd mfs_drbd meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
crm(live)configure# verify
##定义挂载资源(文件系统),配置其参数,文件系统格式在drbd格式化/drbd1格式相对应
crm(live)configure# primitive mystore ocf:heartbeat:Filesystem params device=/dev/drbd1 directory=/usr/local/mfs fstype=xfs op start timeout=60 op stop timeout=60
crm(live)configure# verify
crm(live)configure#colocation ms_mfs_drbd_with_mystore inf: mystore ms_mfs_drbd
crm(live)configure# order ms_mfs_drbd_before_mystore Mandatory: ms_mfs_drbd:promote mystore:start
1
2
3
4
5
6
7
8
##配置mfs资源
crm(live)configure# primitive mfs systemd:mfsmaster op monitor timeout=100 interval=30 op start timeout=30 interval=0 op stop timeout=30 interval=0
crm(live)configure# colocation mfs_with_mystore inf: mfs mystore
crm(live)configure# order mystor_befor_mfs Mandatory: mystore mfs
crm(live)configure# verify
WARNING: mfs: specified timeout 30 for start is smaller than the advised 100
WARNING: mfs: specified timeout 30 for stop is smaller than the advised 100
crm(live)configure# commit