[ClusterLabs] Need information for N+M clustering using Pacemaker

Ken Gaillot kgaillot at redhat.com
Fri Apr 17 09:49:03 EDT 2015

On 04/17/2015 08:53 AM, Sayed Mujtaba wrote:
> Hi all,
> Any idea for my requirement?
> Thanks
> -Mujtaba

There are some issues/unanswered questions here:

* How do your database clients contact the database? Do you have virtual
IPs for each database that move with them?

* How are you planning to have one replicant replicate from three
different database servers? Since they all will have a distinct mysql.*
database, it won't be as simple as setting up replication to all three.

You can very happily run multiple instances of MySQL bound to different
IP addresses and local sockets, which is a good way around that, but
your startup script (in this case your MySQL resource agent) has to
support that. I once modified the stock init script to handle that case
using a db-available/db-enabled directory structure.

* When you say you want to "start" the database in case of failure of a
node, I assume you mean you want to promote it to master -- a replicant
needs to be running continuously. In MySQL this would generally be
handled by flipping the read_only setting and updating the replication
settings. Again I'm not familiar with whether the MySQL resource agent
can handle this. It's a bit tricky since the original master may no
longer be available, so its configuration file would need to be modified
(by the resource agent) before it could be brought back up after recovery.

However keep in mind that if the master crashes, there's no guarantee
that all data that it wrote was received by the replicant. So when the
master comes back up, you may have data inconsistency issues. There are
various hardware and software tricks you can use to minimize this
possibility, but in my experience there's always the chance
(particularly for a busy database with multiple operations per second).

One alternative for that problem is to move the virtual IP to the
replicant on master failure, but leave it read-only. Obviously your
application is crippled at that point because it can't write anything,
but (if designed to handle the situation) it can serve data until an
administrator can take care of the original problem.

* As an example, let's say you do have a virtual IP for each master
instance, and the resource agent can handle (or you've modified it to
handle) multiple instances on one host and promoting/demoting. Then you
can put all 4 servers into the mix and not distinguish between active
and passive; the cluster will pick whichever nodes are available.

Finally, another alternative approach is to put the database servers in
virtual machines that use DRBD or shared storage, and have the cluster
manage the virtual machines rather than MySQL directly. Then you don't
have to worry about most of the problems above.

> -----Original Message-----
> From: Sayed Mujtaba [mailto:mujtaba at riversilica.com] 
> Sent: Thursday, April 16, 2015 7:10 PM
> To: 'kgaillot at redhat.com'; 'Cluster Labs - All topics related to open-source
> clustering welcomed'
> Subject: RE: [ClusterLabs] Need information for N+M clustering using
> Pacemaker
> Hi ,
> Initially My requirement is as below ,
> To start with 3+1   (3 active and 1 backup/passive node)
>  a) Total 3 number of Active servers 
>  b)Each of 3  nodes needs to have different MySQL data bases which needs to
> be replicated  (All applications will remain same but data base will get
> changed in all 3 active nodes)
> c)When out of these 3 nodes  if any node  fails it has to start all
> resources on backup/passive node with  the data base of that particular
> failed node
> Here tricky thing is that all the 3 active servers will be having different
> data bases and  when failover happens How it will  start the right data base
> in case of failure ? 
> I know DRBD will replicate the whole data but I just want to replicate only
> data base and start the right data base in case of failover .Any better
> solution?
> Thanks
> -Mujtaba
> -----Original Message-----
> From: Ken Gaillot [mailto:kgaillot at redhat.com]
> Sent: Thursday, April 16, 2015 6:42 PM
> To: users at clusterlabs.org
> Subject: Re: [ClusterLabs] Need information for N+M clustering using
> Pacemaker
> On 04/16/2015 08:52 AM, Sayed Mujtaba wrote:
>> I am trying to form M+N clustering along with Load balancer using 
>> Pacemaker and not getting the enough information .Can someone please 
>> guide me about this set up .
>> Cluster from scratch document doesn't cover this topic.
> It should be as simple as assigning your resources a higher location
> preference on your primary nodes than your failover nodes.
> However the only reason I can think of to do N+M is if the failover nodes
> are less powerful (CPU/RAM/whatever), and that's why you don't want to use
> them normally. If your nodes are roughly equivalent, you can just let
> Pacemaker spread out the resources on whichever nodes are available. You
> don't have to designate particular ones as failover.

More information about the Users mailing list