Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-14 Thread Damiano Giuliani
i fired up a multimaster galera cluster.
i would now add it into pacemaker to let it mange and monitor the status.
reading the galera resource documentation seems is only support master
slave replica, is it true?
also mysql resource seems to support master slave replica and externally
managed replica (MM galera?) using clone.
my question is how mysql agent can figure out who is the most advanced node
in case of shutdown of the entire cluster.

i wonder if it should be better move to a master slave replica
configuration.
seems there is not enough documentation about how to build a mysql cluster
using pacemaker on the web :/


Il giorno mar 12 set 2023 alle ore 10:28 Damiano Giuliani <
damianogiulian...@gmail.com> ha scritto:

> thanks Ken,
>
> could you point me in th right direction for a guide or some already
> working configuration?
>
> Thanks
>
> Damiano
>
> Il giorno lun 11 set 2023 alle ore 16:26 Ken Gaillot 
> ha scritto:
>
>> On Thu, 2023-09-07 at 10:27 +0100, Antony Stone wrote:
>> > On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani wrote:
>> >
>> > > Everything is clear now.
>> > > So the point is to use pacemaker and create the floating vip and
>> > > bind it to
>> > > sqlproxy to health check and route the traffic to the available and
>> > > healthy
>> > > galera nodes.
>> >
>> > Good summary.
>> >
>> > > It could be useful let pacemaker manage also galera services?
>> >
>> > No; MySQL / Galera needs to be running on all nodes all the
>> > time.  Pacemaker
>> > is for managing resources which move between nodes.
>>
>> It's still helpful to configure galera as a clone in the cluster. That
>> way, Pacemaker can monitor it and restart it on errors, it will respect
>> things like maintenance mode and standby, and it can be used in
>> ordering constraints with other resources, as well as advanced features
>> such as node utilization.
>>
>> >
>> > If you want something that ensures processes are running on
>> > machines,
>> > irrespective of where the floating IP is, look at monit - it's very
>> > simple,
>> > easy to configure and knows how to manage resources which should run
>> > all the
>> > time.
>> >
>> > > Do you have any guide that pack this everything together?
>> >
>> > No; I've largely made this stuff up myself as I've needed it.
>> >
>> >
>> > Antony.
>> >
>> --
>> Ken Gaillot 
>>
>> ___
>> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-13 Thread Ken Gaillot
On Tue, 2023-09-12 at 10:28 +0200, Damiano Giuliani wrote:
> thanks Ken,
> 
> could you point me in th right direction for a guide or some already
> working configuration?
> 
> Thanks
> 
> Damiano

Nothing specific to galera, just the usual Pacemaker Explained
documentation about clones.

There are some regression tests in the code base that include galera
resources. Some use clones and others bundles (containerized). For
example:

https://github.com/ClusterLabs/pacemaker/blob/main/cts/scheduler/xml/unrunnable-2.xml


> 
> Il giorno lun 11 set 2023 alle ore 16:26 Ken Gaillot <
> kgail...@redhat.com> ha scritto:
> > On Thu, 2023-09-07 at 10:27 +0100, Antony Stone wrote:
> > > On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani
> > wrote:
> > > 
> > > > Everything is clear now.
> > > > So the point is to use pacemaker and create the floating vip
> > and
> > > > bind it to
> > > > sqlproxy to health check and route the traffic to the available
> > and
> > > > healthy
> > > > galera nodes.
> > > 
> > > Good summary.
> > > 
> > > > It could be useful let pacemaker manage also galera services?
> > > 
> > > No; MySQL / Galera needs to be running on all nodes all the
> > > time.  Pacemaker 
> > > is for managing resources which move between nodes.
> > 
> > It's still helpful to configure galera as a clone in the cluster.
> > That
> > way, Pacemaker can monitor it and restart it on errors, it will
> > respect
> > things like maintenance mode and standby, and it can be used in
> > ordering constraints with other resources, as well as advanced
> > features
> > such as node utilization.
> > 
> > > 
> > > If you want something that ensures processes are running on
> > > machines, 
> > > irrespective of where the floating IP is, look at monit - it's
> > very
> > > simple, 
> > > easy to configure and knows how to manage resources which should
> > run
> > > all the 
> > > time.
> > > 
> > > > Do you have any guide that pack this everything together?
> > > 
> > > No; I've largely made this stuff up myself as I've needed it.
> > > 
> > > 
> > > Antony.
-- 
Ken Gaillot 

___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-12 Thread Damiano Giuliani
thanks Ken,

could you point me in th right direction for a guide or some already
working configuration?

Thanks

Damiano

Il giorno lun 11 set 2023 alle ore 16:26 Ken Gaillot 
ha scritto:

> On Thu, 2023-09-07 at 10:27 +0100, Antony Stone wrote:
> > On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani wrote:
> >
> > > Everything is clear now.
> > > So the point is to use pacemaker and create the floating vip and
> > > bind it to
> > > sqlproxy to health check and route the traffic to the available and
> > > healthy
> > > galera nodes.
> >
> > Good summary.
> >
> > > It could be useful let pacemaker manage also galera services?
> >
> > No; MySQL / Galera needs to be running on all nodes all the
> > time.  Pacemaker
> > is for managing resources which move between nodes.
>
> It's still helpful to configure galera as a clone in the cluster. That
> way, Pacemaker can monitor it and restart it on errors, it will respect
> things like maintenance mode and standby, and it can be used in
> ordering constraints with other resources, as well as advanced features
> such as node utilization.
>
> >
> > If you want something that ensures processes are running on
> > machines,
> > irrespective of where the floating IP is, look at monit - it's very
> > simple,
> > easy to configure and knows how to manage resources which should run
> > all the
> > time.
> >
> > > Do you have any guide that pack this everything together?
> >
> > No; I've largely made this stuff up myself as I've needed it.
> >
> >
> > Antony.
> >
> --
> Ken Gaillot 
>
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-11 Thread Ken Gaillot
On Thu, 2023-09-07 at 10:27 +0100, Antony Stone wrote:
> On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani wrote:
> 
> > Everything is clear now.
> > So the point is to use pacemaker and create the floating vip and
> > bind it to
> > sqlproxy to health check and route the traffic to the available and
> > healthy
> > galera nodes.
> 
> Good summary.
> 
> > It could be useful let pacemaker manage also galera services?
> 
> No; MySQL / Galera needs to be running on all nodes all the
> time.  Pacemaker 
> is for managing resources which move between nodes.

It's still helpful to configure galera as a clone in the cluster. That
way, Pacemaker can monitor it and restart it on errors, it will respect
things like maintenance mode and standby, and it can be used in
ordering constraints with other resources, as well as advanced features
such as node utilization.

> 
> If you want something that ensures processes are running on
> machines, 
> irrespective of where the floating IP is, look at monit - it's very
> simple, 
> easy to configure and knows how to manage resources which should run
> all the 
> time.
> 
> > Do you have any guide that pack this everything together?
> 
> No; I've largely made this stuff up myself as I've needed it.
> 
> 
> Antony.
> 
-- 
Ken Gaillot 

___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-08 Thread Stefan Fuhrmann

Hello,

some years ago I wrote a wikki entry:


https://wiki.clusterlabs.org/wiki/DRBD_MySQL_HowTo

Maybe pacemaker is to complex and you should try heartbeat- drbd


Greets.

 Stefan

Am 05.09.23 um 23:20 schrieb Damiano Giuliani:
Hi guys, I'm about to figure out how setup a pacemaker cluster for 
MySQL replication.
I'm super new about MySQL and also it's replication method but I'm 
very experienced related postgres cluster using PAF.

Diggin the web I found out many different way to achieve.
I would like to know which is the most stable and relabile.
There is some agent like PAF who does the same but for MySQL?
I would like to avoid drbd or similar.

And yes failover must be automatic and resyncing the failed node can 
be done manually.


Best and thanks for your time
Pepe

___
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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-08 Thread Antony Stone
On Thursday 07 September 2023 at 22:06:25, Damiano Giuliani wrote:

> Everything seems quite clear to me.
> 
> But, having single VIP makes a multimaster replica quite useless.

Why?

> im thinking about using pacemaker to create a cloned VIP binded to a cloned
> HA proxy which is health-checking the galera/mysql status  to route the
> traffic.

I don't think I understand the use of the word "cloned" there.

How many Virtual IPs are you considering having?

> or more easily pacemaker with a single VIP to a single HA proxy which is
> roting the traffic to all the heath-checked availables cluster node.
> in case a node fails, resoruces (vip and haproxy are started to a different
> node)

You can do that if you wish, yes.


Antony.

-- 
"640 kilobytes (of RAM) should be enough for anybody."

 - Bill Gates

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-07 Thread Damiano Giuliani
Everything seems quite clear to me.

But, having single VIP makes a multimaster replica quite useless.

im thinking about using pacemaker to create a cloned VIP binded to a cloned
HA proxy which is health-checking the galera/mysql status  to route the
traffic.

or more easily pacemaker with a single VIP to a single HA proxy which is
roting the traffic to all the heath-checked availables cluster node.
in case a node fails, resoruces (vip and haproxy are started to a different
node)

do you think in can works?

On Thu, Sep 7, 2023, 11:28 AM Antony Stone 
wrote:

> On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani wrote:
>
> > Everything is clear now.
> > So the point is to use pacemaker and create the floating vip and bind it
> to
> > sqlproxy to health check and route the traffic to the available and
> healthy
> > galera nodes.
>
> Good summary.
>
> > It could be useful let pacemaker manage also galera services?
>
> No; MySQL / Galera needs to be running on all nodes all the time.
> Pacemaker
> is for managing resources which move between nodes.
>
> If you want something that ensures processes are running on machines,
> irrespective of where the floating IP is, look at monit - it's very
> simple,
> easy to configure and knows how to manage resources which should run all
> the
> time.
>
> > Do you have any guide that pack this everything together?
>
> No; I've largely made this stuff up myself as I've needed it.
>
>
> Antony.
>
> --
> This sentence contains exacly three erors.
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-07 Thread Antony Stone
On Wednesday 06 September 2023 at 17:01:24, Damiano Giuliani wrote:

> Everything is clear now.
> So the point is to use pacemaker and create the floating vip and bind it to
> sqlproxy to health check and route the traffic to the available and healthy
> galera nodes.

Good summary.

> It could be useful let pacemaker manage also galera services?

No; MySQL / Galera needs to be running on all nodes all the time.  Pacemaker 
is for managing resources which move between nodes.

If you want something that ensures processes are running on machines, 
irrespective of where the floating IP is, look at monit - it's very simple, 
easy to configure and knows how to manage resources which should run all the 
time.

> Do you have any guide that pack this everything together?

No; I've largely made this stuff up myself as I've needed it.


Antony.

-- 
This sentence contains exacly three erors.

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Damiano Giuliani
Everything is clear now.
So the point is to use pacemaker and create the floating vip and bind it to
sqlproxy to health check and route the traffic to the available and healthy
galera nodes.

Am I right?
It could be useful let pacemaker manage also galera services?

Do you have any guide that pack this everything together?

Thanks ur info's are so precious to me!

On Wed, Sep 6, 2023, 4:24 PM Antony Stone 
wrote:

> On Wednesday 06 September 2023 at 13:58:51, Damiano Giuliani wrote:
>
> > What I miss is how my application can support the connection on a multi
> > master where 3 ips are available simultaneously.
> >
> > JDBCmysql driver or similar support a list name/ip of clustered nodes?
> > Galera provide a unique cluster ip?
> >
> > Whats the point to create another cluster(pacemaker) for the VIP
> alongside
> > galera?
>
> Simple - as you explained above, you can't assume that clients can cope
> with
> the idea of 3 IPs for the actual clustered machines - clients want a
> single IP
> to connect to, and *you* want to be sure that that IP is going to provide
> a
> working connection, even if one of the machines happens to have a problem.
>
> So, you have:
>
> machine A - real IP address 198.51.100.1
> machine B - real IP address 198.51.100.2
> machine C - real IP address 198.51.100.3
>
> All machines run MySQL, ProxySQL and corosync / pacemaker.
>
> Pacemaker manages a floating IP address 198.51.100.42.
>
> ProxySQL on each machine listens for connections to 198.51.100.42 and
> passes
> requests on to 198.51.100.1, 198.51.100.2 and 198.51.100.3.  ProxySQL
> knows
> how to monitor the three real IPs to make sure they can handle queries,
> and if
> one stops working, it stops getting sent queries.
>
> MySQL listens for connections on 198.51.100.1 on machine A, 198.51.100.2
> on
> machine B and 198.51.100.3 on machine C.
>
> Galera makes sure that all three servers have the same DB content, so a
> query
> sent to any will return the same result.
>
> That gives you a single floating IP address 198.51.100.42 which all
> clients can
> connect to, that address is ensured by pacemaker to be on a working
> server,
> and ProxySQL ensures that a request to that address is passed to a working
> instance of MySQL.
>
>
> Antony.
>
> --
> This email is intended for the use of the individual addressee(s) named
> above
> and may contain information that is confidential, privileged or unsuitable
> for
> overly sensitive persons with low self-esteem, no sense of humour, or
> irrational religious beliefs.
>
> If you have received this email in error, you are required to shred it
> immediately, add some nutmeg, three egg whites and a dessertspoonful of
> caster
> sugar.  Whisk until soft peaks form, then place in a warm oven for 40
> minutes.
> Remove promptly and let stand for 2 hours before adding some decorative
> kiwi
> fruit and cream.  Then notify me immediately by return email and eat the
> original message.
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Antony Stone
On Wednesday 06 September 2023 at 13:58:51, Damiano Giuliani wrote:

> What I miss is how my application can support the connection on a multi
> master where 3 ips are available simultaneously.
> 
> JDBCmysql driver or similar support a list name/ip of clustered nodes?
> Galera provide a unique cluster ip?
> 
> Whats the point to create another cluster(pacemaker) for the VIP alongside
> galera?

Simple - as you explained above, you can't assume that clients can cope with 
the idea of 3 IPs for the actual clustered machines - clients want a single IP 
to connect to, and *you* want to be sure that that IP is going to provide a 
working connection, even if one of the machines happens to have a problem.

So, you have:

machine A - real IP address 198.51.100.1
machine B - real IP address 198.51.100.2
machine C - real IP address 198.51.100.3

All machines run MySQL, ProxySQL and corosync / pacemaker.

Pacemaker manages a floating IP address 198.51.100.42.

ProxySQL on each machine listens for connections to 198.51.100.42 and passes 
requests on to 198.51.100.1, 198.51.100.2 and 198.51.100.3.  ProxySQL knows 
how to monitor the three real IPs to make sure they can handle queries, and if 
one stops working, it stops getting sent queries.

MySQL listens for connections on 198.51.100.1 on machine A, 198.51.100.2 on 
machine B and 198.51.100.3 on machine C.

Galera makes sure that all three servers have the same DB content, so a query 
sent to any will return the same result.

That gives you a single floating IP address 198.51.100.42 which all clients can 
connect to, that address is ensured by pacemaker to be on a working server, 
and ProxySQL ensures that a request to that address is passed to a working 
instance of MySQL.


Antony.

-- 
This email is intended for the use of the individual addressee(s) named above 
and may contain information that is confidential, privileged or unsuitable for 
overly sensitive persons with low self-esteem, no sense of humour, or 
irrational religious beliefs.

If you have received this email in error, you are required to shred it 
immediately, add some nutmeg, three egg whites and a dessertspoonful of caster 
sugar.  Whisk until soft peaks form, then place in a warm oven for 40 minutes.  
Remove promptly and let stand for 2 hours before adding some decorative kiwi 
fruit and cream.  Then notify me immediately by return email and eat the 
original message.

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Damiano Giuliani
Thanks for helping really appreciate.

What I miss is how my application can support the connection on a multi
master where 3 ips are available simultaneously.

JDBCmysql driver or similar support a list name/ip of clustered nodes?
Galera provide a unique cluster ip?

Whats the point to create another cluster(pacemaker) for the VIP alongside
galera?

Thanks for the time you spent

Thanks





On Wed, Sep 6, 2023, 2:12 PM Antony Stone 
wrote:

> On Wednesday 06 September 2023 at 12:50:40, Damiano Giuliani wrote:
>
> > Looking at some Galera cluster designs on web seems a couple of server
> > proxy are placed in front.
>
> You can certainly do it that way, although some people simply have a
> floating
> virtual IP across the 3 nodes, and clients connect to whichever
> (permanently
> running) MySQL instance has the VIP at the time.
>
> > If I would have only 3 nodes where I clustered MySQL with galera how
> then I
> > have to point my application to the right nodes?
>
> Galera is a "write anywhere, read anywhere" replication system.  You do
> not
> get a "cluster master" which all clients have to write to (or read from),
> so
> clients can simply connect to any node they like.
>
> If you're familiar with standard MySQL master-slave replication, and you
> know
> this can be set up in a master-master configuration, simply regard Galera
> as
> the same outcome but for any number of modes.
>
> One way to ensure that all clients connect to the same node at any given
> time
> is to use pacemaker or similar to run a floating virtual IP between the
> nodes.
> Clients connect to the VIP, and reach either MySQL itself, or the proxy
> (which
> is running on all 3 nodes, same as MySQL is), and the proxy connects to
> the
> real IPs of the 3 nodes.
>
>
> Antony.
>
> --
> +++ Divide By Cucumber Error.  Please Reinstall Universe And Reboot +++
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Antony Stone
On Wednesday 06 September 2023 at 12:50:40, Damiano Giuliani wrote:

> Looking at some Galera cluster designs on web seems a couple of server
> proxy are placed in front.

You can certainly do it that way, although some people simply have a floating 
virtual IP across the 3 nodes, and clients connect to whichever (permanently 
running) MySQL instance has the VIP at the time.

> If I would have only 3 nodes where I clustered MySQL with galera how then I
> have to point my application to the right nodes?

Galera is a "write anywhere, read anywhere" replication system.  You do not 
get a "cluster master" which all clients have to write to (or read from), so 
clients can simply connect to any node they like.

If you're familiar with standard MySQL master-slave replication, and you know 
this can be set up in a master-master configuration, simply regard Galera as 
the same outcome but for any number of modes.

One way to ensure that all clients connect to the same node at any given time 
is to use pacemaker or similar to run a floating virtual IP between the nodes.  
Clients connect to the VIP, and reach either MySQL itself, or the proxy (which 
is running on all 3 nodes, same as MySQL is), and the proxy connects to the 
real IPs of the 3 nodes.


Antony.

-- 
+++ Divide By Cucumber Error.  Please Reinstall Universe And Reboot +++

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Damiano Giuliani
Unfortunately I move to a different company and they are stick to MySQL

For what I understand they have some mysql cluster without automatic
failover.
Probably also their customers have some kind of cluster without automatic
failover.

Looking at some Galera cluster designs on web seems a couple of server
proxy are placed in front.

If I would have only 3 nodes where I clustered MySQL with galera how then I
have to point my application to the right nodes?


On Wed, Sep 6, 2023, 1:32 PM Antony Stone 
wrote:

> On Wednesday 06 September 2023 at 12:10:23, Damiano Giuliani wrote:
>
> > Thanks for helping me.
> >
> > I'm going to know more about Galera.
> > What I don't like is seems I need many nodes, at least 3 for the cluster
> > and then at least 2 other nodes for proxy.
>
> You didn't mention anything about wanting a proxy service in your original
> posting, and there's no reason why a proxy can't run on the same machines
> as
> MySQL does.
>
> As for requiring three nodes, you'll need that for pacemaker anyway.
> Trying
> to run a 2-node cluster (of anything) as a production service is a
> disaster
> waiting to happen.  Read up about "split brain" if you do not know why.
>
> > Asking for 5 VM is quite consuming.
>
> What's your actual (functional) requirement here?
>
> > As you told drbd can work only in 2 node cluster and disk replication is
> > not dbms replication.
> > Probably I'm going to try drbd on very small and low usage db.
>
> The lower the usage (and therefore unrepresentative of typical production
> activity), the more likely it is that you'll think "this is working".
>
> Assuming you mean to set up two MySQL servers each pointing at a
> synchronised
> DRBD storage volume on their local systems, the main thing I expect to go
> wrong is data cached in memory, perhaps during complex updates.
>
> If instead you mean to have only one instance of MySQL running at any
> given
> time, and a failover involves stopping MySQL on the first node and then
> starting it on the second, then sure, that will work, but it introduces a
> (probably multi-second at the very least) delay during which no client
> requests can be processed during the failover, whereas a replicated Galera
> cluster (especially with something like ProxySQL in front of it) offers
> almost
> instantaneous switchover and therefore much reduced downtime in DB
> availability.
>
> > More I know about MySQL  more postgresql seems have better replication at
> > least for me.
>
> So why not use Postgres?
>
>
> Antony.
>
> --
> I don't know, maybe if we all waited then cosmic rays would write all our
> software for us. Of course it might take a while.
>
>  - Ron Minnich, Los Alamos National Laboratory
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Antony Stone
On Wednesday 06 September 2023 at 12:10:23, Damiano Giuliani wrote:

> Thanks for helping me.
> 
> I'm going to know more about Galera.
> What I don't like is seems I need many nodes, at least 3 for the cluster
> and then at least 2 other nodes for proxy.

You didn't mention anything about wanting a proxy service in your original 
posting, and there's no reason why a proxy can't run on the same machines as 
MySQL does.

As for requiring three nodes, you'll need that for pacemaker anyway.  Trying 
to run a 2-node cluster (of anything) as a production service is a disaster 
waiting to happen.  Read up about "split brain" if you do not know why.

> Asking for 5 VM is quite consuming.

What's your actual (functional) requirement here?

> As you told drbd can work only in 2 node cluster and disk replication is
> not dbms replication.
> Probably I'm going to try drbd on very small and low usage db.

The lower the usage (and therefore unrepresentative of typical production 
activity), the more likely it is that you'll think "this is working".

Assuming you mean to set up two MySQL servers each pointing at a synchronised 
DRBD storage volume on their local systems, the main thing I expect to go 
wrong is data cached in memory, perhaps during complex updates.

If instead you mean to have only one instance of MySQL running at any given 
time, and a failover involves stopping MySQL on the first node and then 
starting it on the second, then sure, that will work, but it introduces a 
(probably multi-second at the very least) delay during which no client 
requests can be processed during the failover, whereas a replicated Galera 
cluster (especially with something like ProxySQL in front of it) offers almost 
instantaneous switchover and therefore much reduced downtime in DB 
availability.

> More I know about MySQL  more postgresql seems have better replication at
> least for me.

So why not use Postgres?


Antony.

-- 
I don't know, maybe if we all waited then cosmic rays would write all our 
software for us. Of course it might take a while.

 - Ron Minnich, Los Alamos National Laboratory

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Damiano Giuliani
Thanks for helping me.

I'm going to know more about Galera.
What I don't like is seems I need many nodes, at least 3 for the cluster
and then at least 2 other nodes for proxy.
Asking for 5 VM is quite consuming.

As you told drbd can work only in 2 node cluster and disk replication is
not dbms replication.
Probably I'm going to try drbd on very small and low usage db.

Thanks for sharing the doc.

More I know about MySQL  more postgresql seems have better replication at
least for me.


On Wed, Sep 6, 2023, 12:40 PM Antony Stone 
wrote:

> On Wednesday 06 September 2023 at 11:23:54, Damiano Giuliani wrote:
>
> > Thanks for helping.
> >
> > Because I still don't know which version will be provided, probably MySQL
> > enterprise or community.
>
> I believe both support Galera replication.
>
> > I was wondering about pacemaker because I know quite well how it works
> and
> > I need a vip/automatic failover
>
> I regard a VIP as being entirely independent of replicating database
> content.
>
> > Galera seems a different approach that I have to study and test
> estensively
> > before  place in production, instead pacemaker is a well know solution to
> > me.
>
> Yes, but if you are trying to replicate database content, how does
> pacemaker
> help with this?  Pacemaker can quite happily provide you with a floating
> virtual IP address which is guarenteed to be on one of your database
> servers,
> but it doesn't (as far as I know) have any mechanism for replicating the
> database content between those servers.
>
> > Is drbd approach obsolete or solid?
>
> I would say that DRBD is a solid solution provided you only have two nodes
> and
> they have very good connectivity between them.
>
> However, replicating the data at disk level is a very different matter
> from
> having a DBMS such as MySQL understanding what is on the disk (and for
> that
> matter, what it has cached in RAM).
>
> > About the degraded status I read on web there is a specific
> configuration?
>
> I cannot comment on that; maybe someone else can.
>
> > There is also a good Galera documentation to study?
>
> I used
> https://mariadb.com/kb/en/getting-started-with-mariadb-galera-cluster
>
>
> Antony.
>
> --
> "In fact I wanted to be John Cleese and it took me some time to realise
> that
> the job was already taken."
>
>  - Douglas Adams
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Antony Stone
On Wednesday 06 September 2023 at 11:23:54, Damiano Giuliani wrote:

> Thanks for helping.
> 
> Because I still don't know which version will be provided, probably MySQL
> enterprise or community.

I believe both support Galera replication.

> I was wondering about pacemaker because I know quite well how it works and
> I need a vip/automatic failover

I regard a VIP as being entirely independent of replicating database content.

> Galera seems a different approach that I have to study and test estensively
> before  place in production, instead pacemaker is a well know solution to
> me.

Yes, but if you are trying to replicate database content, how does pacemaker 
help with this?  Pacemaker can quite happily provide you with a floating 
virtual IP address which is guarenteed to be on one of your database servers, 
but it doesn't (as far as I know) have any mechanism for replicating the 
database content between those servers.

> Is drbd approach obsolete or solid?

I would say that DRBD is a solid solution provided you only have two nodes and 
they have very good connectivity between them.

However, replicating the data at disk level is a very different matter from 
having a DBMS such as MySQL understanding what is on the disk (and for that 
matter, what it has cached in RAM).

> About the degraded status I read on web there is a specific configuration?

I cannot comment on that; maybe someone else can.

> There is also a good Galera documentation to study?

I used https://mariadb.com/kb/en/getting-started-with-mariadb-galera-cluster


Antony.

-- 
"In fact I wanted to be John Cleese and it took me some time to realise that 
the job was already taken."

 - Douglas Adams

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Damiano Giuliani
Thanks for helping.

Because I still don't know which version will be provided, probably MySQL
enterprise or community.

I was wondering about pacemaker because I know quite well how it works and
I need a vip/automatic failover

Galera seems a different approach that I have to study and test estensively
before  place in production, instead pacemaker is a well know solution to
me.

Is drbd approach obsolete or solid?
About the degraded status I read on web there is a specific configuration?

There is also a good Galera documentation to study?

Thanks

Damiano


On Wed, Sep 6, 2023, 10:37 AM Antony Stone 
wrote:

> On Tuesday 05 September 2023 at 22:20:36, Damiano Giuliani wrote:
>
> > Hi guys, I'm about to figure out how setup a pacemaker cluster for MySQL
> > replication.
>
> Why do you need pacemaker?
>
> Why not just set up several machines and configure Galera to handle DB
> replication between them?
>
> If you install MariaDB instead of MySQL it's directly compatible and
> Galera is
> included.
>
> Depending on your distribution you may find that MariaDB is actually what
> you
> get even when you ask for MySQL (eg: Debian).
>
> I don't see the need for pacemaker here.
>
>
> Antony.
>
> --
> "Have you been drinking brake fluid again?  I think you're addicted to the
> stuff."
>
> "No, no, it's alright - I can stop any time I want to."
>
>Please reply to the
> list;
>  please *don't* CC
> me.
> ___
> 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/


Re: [ClusterLabs] MySQL cluster with auto failover

2023-09-06 Thread Antony Stone
On Tuesday 05 September 2023 at 22:20:36, Damiano Giuliani wrote:

> Hi guys, I'm about to figure out how setup a pacemaker cluster for MySQL
> replication.

Why do you need pacemaker?

Why not just set up several machines and configure Galera to handle DB 
replication between them?

If you install MariaDB instead of MySQL it's directly compatible and Galera is 
included.

Depending on your distribution you may find that MariaDB is actually what you 
get even when you ask for MySQL (eg: Debian).

I don't see the need for pacemaker here.


Antony.

-- 
"Have you been drinking brake fluid again?  I think you're addicted to the 
stuff."

"No, no, it's alright - I can stop any time I want to."

   Please reply to the list;
 please *don't* CC me.
___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/