[ClusterLabs] How to create the stonith resource in virtualbox

Andrei Borzenkov arvidjaar at gmail.com
Thu Feb 8 13:05:25 UTC 2018


On Thu, Feb 8, 2018 at 5:51 AM, 范国腾 <fanguoteng at highgo.com> wrote:
> Hello,
>
> 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.
>

It probably tries to check resource and fails. State of stonith
resource is irrelevant for actual fencing operation (this resource is
only used for periodical check, not for fencing itself).

> (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 ]
>

Well, you need to provide what is missing - your command did not
specify any host.

> 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?
>
>
> Thanks
>
>
> 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
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://lists.clusterlabs.org/mailman/listinfo/users
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org


More information about the Users mailing list