[ClusterLabs] How to create the stonith resource in virtualbox

范国腾 fanguoteng at highgo.com
Wed Feb 7 21:51:48 EST 2018


I setup the pacemaker cluster using virtualbox. There are three nodes. The OS is centos7, the /dev/sdb is the shared storage(three nodes use the same disk file).

(1) At first, I create the stonith using this command: 
pcs stonith create scsi-stonith-device fence_scsi devices=/dev/mapper/fence pcmk_monitor_action=metadata pcmk_reboot_action=off pcmk_host_list="db7-1 db7-2 db7-3" meta provides=unfencing;

I know the VM not have the /dev/mapper/fence. But sometimes the stonith resource able to start, sometimes not. Don't know why. It is not stable.

(2) Then I use the following command to setup stonith using the shared disk /dev/sdb: 
pcs stonith create scsi-shooter fence_scsi devices=/dev/disk/by-id/ata-VBOX_HARDDISK_VBc833e6c6-af12c936 meta provides=unfencing 
But the stonith always be stopped and the log show:
Feb  7 15:45:53 db7-1 stonith-ng[8166]: warning: fence_scsi[8197] stderr: [ Failed: nodename or key is required ]

Could anyone help tell what is the correct command to setup the stonith in VM and centos? Is there any document to introduce this so that I could study it?


Here is the cluster status:
[root at db7-1 ~]# pcs status
Cluster name: cluster_pgsql
Stack: corosync
Current DC: db7-2 (version 1.1.16-12.el7_4.7-94ff4df) - partition with quorum
Last updated: Wed Feb  7 16:27:13 2018
Last change: Wed Feb  7 15:42:38 2018 by root via cibadmin on db7-1

3 nodes configured
1 resource configured

Online: [ db7-1 db7-2 db7-3 ]

Full list of resources:

 scsi-shooter   (stonith:fence_scsi):   Stopped

Daemon Status:
  corosync: active/disabled
  pacemaker: active/disabled
  pcsd: active/enabled

More information about the Users mailing list