1

I´m setting up a 3 node DRBD Cluster with Pacemaker and corosync on CentOS 8.

I set up 3 IP resources, 1 apache webserver resource and now I want to set up my drbd resource.

The Drbd is working if it is started alone with systemctl and is working.

But if I create the resource with following command:

pcs resource create DRBD-1 ocf:linbit:drbd drbd_resource=drbd1 op monitor interval=1m role=Master op monitor interval=59s role=Slave

it will never start and stays stopped.

The log from pacemaker sais: Could not onnect to 'drbd' generic netlink family and <1> error creating netling socket

/var/log/messages sais:

 ERROR: drbd2: Called drbdadm -c /etc/drbd.conf down drbd2
 ERROR: drbd2: Exit code 20
 ERROR: drbd2: Command output:
 ERROR: drbd2: Called /usr/sbin/crm_master -l reboot -D
 ERROR: drbd2: Exit code 102
 ERROR: drbd2: Command output:
 notice: DRBD-2_stop_0:7360:stderr [ <1>error creating netlink socket ]
 Error connecting to the CIB manager: Transport endpoint is not connected

And I´m unsure about this line in /var/log/messages

 notice: DRBD-2_stop_0:7360:stderr [ /usr/lib/ocf/lib/heartbeat/ocf-shellfuncs: line 235: /var/log/pacemaker/pacemaker.log: Permission denied ]

Edit 1 If I´m creating the Master Slave Resource for the DRBD i will get following message from pacemaker:

    Starting resources on a cluster is (almost) always done by pacemaker and
    not directly from pcs.  If your resource isn't starting, it's usually
    due to either a misconfiguration of the resource (which you debug in
    the system log), or constraints preventing the resource from starting or
    the resource being disabled.  You can use 'pcs resource debug-start' to
    test resource configuration, but it should *not* normally be used to start 
resources in a cluster.
ses
  • 11
  • 1
  • 4

1 Answers1

1

DRBD must be configured as a multi-state clone in Pacemaker, since it can be started in multiple states (Primary or Secondary).

In addition to the primitive you've defined, you will need to define the multi-state clone as follows:

pcs resource create DRBD-1 ocf:linbit:drbd drbd_resource=drbd1 op monitor interval=1m role=Master op monitor interval=59s role=Slave
pcs resource master ms-DRBD-1 DRBD-1 master-max=1 master-node-max=1 clone-max=3 clone-node-max=1 notify=true

The next bit, regarding Permission Denied, sounds like it might be SELinux related. Please check that you don't have DENIED entries in your /var/log/audit/audit.log, and if you do, try setting SELinux to permissive and see if that allows Pacemaker to manage DRBD:

setenforce 0
Matt Kereczman
  • 1,899
  • 9
  • 12
  • I´m sorry I didn´t wrote this down too. If I´m doing this i got the Errror that the resource DRBD-1 isn´t started. I will Edit the Error Message into my Post. – ses Mar 25 '20 at 07:08
  • Well, you'll still need the `ms` clone, but the permissions issue sounds like it might SELinux related. I updated my answer. – Matt Kereczman Mar 25 '20 at 16:50
  • what do you mean with ms clone? – ses Mar 26 '20 at 13:59
  • The additional resource I created in my answer is a multi-state (ms) clone: `pcs resource master ms-DRBD-1 DRBD-1 master-max=1 master-node-max=1 clone-max=3 clone-node-max=1 notify=true` – Matt Kereczman Mar 26 '20 at 17:20
  • okay, but i cant create it without the running drbd. But even if i disable the selinux, the drbd does not start. – ses Mar 30 '20 at 07:30