On Tue, Dec 15, 2020 at 4:58 PM Tony Stocker <akostoc...@gmail.com> wrote: > > I'm trying to figure out the best way to do the following on our > 2-node clusters. > > Whichever node is the primary (all services run on a single node) I > want to create a file that contains an identity descriptor, e.g. > /var/local/project/identity and the contents are "httpserver". This is > so that we can utilize this file in cron scripts (and other programs) > to determine on which system log files should get rotated, services > should get HUP'd, etc. When the resource group moves between nodes, > this file gets deleted on the (now) inactive node and written to on > the active node. >
You could simply query whether a specific resource (group) is active on the node where your script runs. I used a similar approach in two node cluster (in this case I simply needed to make sure only one node runs cron job so I checked for CB master). > Is there already a resource agent that does this? If so, could someone > point me at it? > > If not, what's the best way to accomplish this? Is it necessary to > write a complete resource agent script just to do this? Or is there a > simpler way? > > Thanks for your help > _______________________________________________ > 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/