On 07.12.2021 21:35, Asseel Sidique wrote: > Hi Everyone, > I'm looking for some insight on what the best way is to configure mount > monitoring for a cloned database resource. > Consider the resource model below: > * Clone Set: database_1-clone [database_1] (promotable): > * Masters: [ node-1 ] > * Slaves: [ node-2 ] > * db2fs_node-1_Filesystem (ocf::heartbeat:Filesystem): Started > node-1 > * db2fs_node-2_Filesystem (ocf::heartbeat:Filesystem): Started > node-2 > > The database will exist on two hosts, and each database clone is dependent on > the filesystem running on its corresponding > hosts. The filesystem is not shared, so I've created them as separate > resources > (db2fs_node-1_Filesystem and db2fs_node-2_Filesystem). > The behavior I'm attempting to create is: > The cloned resource will only be able to start if the Filesystem on the same > host is already started. > i.e. If the filesystem on node-1 is down, the clone database resource on > node-1 > will be stopped > and if the filesystem on node-2 is up, the the clone database resource on > node-2 > will be running > I've tried to set constraints for the cloned resource a few different ways: > 1. Order constraints > order fileSystem-node-1-then-db Mandatory: db2fs_node-1_Filesystem > db2_regress1_regress1_SAMPLE-clone > order fileSystem-node-2-then-db Mandatory: db2fs_node-2_Filesystem > db2_regress1_regress1_SAMPLE-clone
The resource name in these constraints does not match clone name you show earlier. > Using these constraints, the clone database resource will stop if either > filesystem resource is stopped. Try setting interleave=true for clone. > 2. Colocation constraints > colocation order-rule-Filesystem-node-1-then-db inf: > db2_regress1_regress1_SAMPLE-clone:Master db2fs_node-1_Filesystem > colocation order-rule-Filesystem-node-2-then-db inf: > db2_regress1_regress1_SAMPLE-clone:Slave db2fs_node-2_Filesystem > With these colocation constraints, if stopping one or both filesystem > resources, > the clone database resource looks like this: > * Clone Set: database_1-clone [database_1] (promotable): > * Slaves: [ node-1 node-2 ] > > Is there any advice on what the best practices to achieve this behaviour? > Best, > Asseel > > > > _______________________________________________ > Manage your subscription: > https://lists.clusterlabs.org/mailman/listinfo/users > > ClusterLabs home: https://www.clusterlabs.org/ > _______________________________________________ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/