4.4. Configuring the Samba Cluster Resources
This section provides the procedure for configuring the Samba cluster resources for this use case.
The following procedure creates a snapshot of the cluster's
cib
file named samba.cib
and adds the resources to that test file rather then configuring them directly on the running cluster. After the resources and constraints are configured, the procedure pushes the contents of samba.cib
to the running cluster configuration file.
On one node of the cluster, run the following procedure.
- Create a snapshot of the
cib
file, which is the cluster configuration file.pcs cluster cib samba.cib
[root@z1 ~]# pcs cluster cib samba.cib
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the CTDB resource to be used by Samba. Create this resource as a cloned resource so that it will run on both cluster nodes.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the cloned Samba server.
pcs -f samba.cib resource create samba systemd:smb --clone
[root@z1 ~]# pcs -f samba.cib resource create samba systemd:smb --clone
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the colocation and order constraints for the cluster resources. The startup order is Filesystem resource, CTDB resource, then Samba resource.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Push the content of the
cib
snapshot to the cluster.pcs cluster cib-push samba.cib
[root@z1 ~]# pcs cluster cib-push samba.cib CIB updated
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Check the status of the cluster to verify that the resource is running.Note that in Red Hat Enterprise Linux 7.4 it can take a couple of minutes for CTDB to start Samba, export the shares, and stabilize. If you check the cluster status before this process has completed, you may see a message that the CTDB status call failed. Once this process has completed, you can clear this message from the display by running the
pcs resource cleanup ctdb-clone
command.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If you find that the resources you configured are not running, you can run thepcs resource debug-start resource
command to test the resource configuration. This starts the service outside of the cluster’s control and knowledge. If the configured resources are running again, runpcs resource cleanup resource
to make the cluster aware of the updates. For information on thepcs resource debug-start
command, see the Enabling, Disabling, and Banning Cluster Resources section in the High Availability Add-On Reference manual.