DRBD High Availability Useful Commands
root@debian:~# basculThis command is used to change roles between high-availability servers. If all is well, a confirmation question should appear if we wish to execute the action. The bascul command permanently moves services from one server to another. If you want to return the services to the main server you must execute the command again.
root@debian:~# roleThis command shows the status of the current server.
root@debian:~# pcs resource refresh --fullThis command is used to poll all resources even if the status is unknown.
root@debian:~# pcs node standby hostThis command stops the server node where it is running. The node status is stopped.
root@debian:~# pcs node unstandby hostIn some cases, the bascul command does not finish tilting, which causes one of the servers to be on standby (stopped), with this command the state is restored to normal.
root@debian:~# pcs resource deleteThis command removes the resource so it can be created.
root@debian:~# pcs resource createThis command creates the resource.
root@debian:~# corosync-cfgtool -sThis command is used to check whether cluster communication is happy.
root@debian:~# ps axfThis command confirms that Corosync is functional, we can check the rest of the stack. The pacemaker has already been started, so verify the necessary processes are running.
root@debian:~# pcs statusThis command allows you to check the pcs status output.
root@debian:~# crm_verify -L -VThis command allows you to check the validity of the configuration.
root@debian:~# drbdadm statusThis command shows the integrity status of the disks that are being shared between both servers in high availability. If for some reason the status of Connecting or Standalone returns to us, wait a while and if the state remains it is because there are synchronization problems between both servers, and you should execute the drbdsplit command.
root@debian:~# cat /proc/drbdThis command shows you the state of your device is kept in /proc/drbd.
root@debian:~# drbdadm connect drbd0This command shows you the status on the other node (the split brain survivor), if its connection state is also StandAlone, you will need to enter.
root@debian:~# drbdadm role drbd0This command is another way to check the role of the block device.
root@debian:~# drbdadm primary drbd0This command allows you to switch the DRBD block device to Primary using drbdadm.
root@debian:~# drbdadm secondary drbd0This command allows you to switch the DRBD block device to Secondary using drbdadm.
root@debian:~# /usr/share/vitalpbx/ha/ ./vpbxha.shThis script creates the cluster automatically.
root@debian:~# /usr/share/vitalpbx/ha/ ./destroy.shThis script will completely destroy the cluster, leaving the DRBD intact.
root@debian:~# /usr/share/vitalpbx/ha/ ./rebuild.shThis script recreates the cluster starting from the fact that the DRBD is already configured on both servers.
Was this article helpful?
Your feedback helps us improve the documentation.
Thank you for helping us improve!
