[ClusterLabs] How to cluster a service with multiple possibilities

Andrei Borzenkov arvidjaar at gmail.com
Sat Jul 25 11:35:47 UTC 2015


В Fri, 24 Jul 2015 14:43:37 +0000
David Gersic <dgersic at niu.edu> пишет:

> I have a process (OpenSLP slpd) that I'd like to cluster. Unfortunately, this process provides multiple services, depending what it finds in its configuration file on startup. I need to have the process running on all of the cluster nodes, but on one node I need to start it with an alternate config file to enable some additional services. slpd itself supports an alternate config file option on its command line.
> 
> 
> What I'm trying to express is some combination of location and concurrency, but I'm stumped at how to configure this.
> 
> 
> Simplified, for a three node cluster with nodes node1, node2, node3, configure three services, service1, service2, and service3, where service[1-3] cannot coexist on the same node, but where service1 is more important than service[2-3].
> 
> 
> So normally I'd have node1 running service1, node2 running service2, node3 running service3.
> 
> 
> If either node2 or node3 goes down, that's no big deal, service2 or service3 goes down with it, but will come back up when the node returns to service.
> 
> 
> If node1 goes down, I need to have service2 stopped, and service1 moved to node2 (or service3/node3). When node1 returns, service1 moves back to node1 and service2 is restarted on node2.
> 
> 

Then set mandatory colocation constraint for each services 2 and 3 to
not run on the same node as service1. Using crmsh like this

colocation never_service2_with_service1 -inf: service2 service1
colocation never_service3_with_service1 -inf: service3 service1

This will cause pacemaker to evaluate placement of service1 first and
then stop or move service2/3 if the only place where service1 can run
is node where service2/3 is running.

This is in addition to any other constraints you may want to add.




More information about the Users mailing list