[MXS-1862] Failover does not happen with Maxscale in Master->Slave replication setup Created: 2018-05-08 Updated: 2018-08-17 Resolved: 2018-08-17 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | failover |
| Affects Version/s: | 2.2.5 |
| Fix Version/s: | 2.2.5 |
| Type: | Task | Priority: | Major |
| Reporter: | Venkatarao Beru | Assignee: | Esa Korhonen |
| Resolution: | Not a Bug | Votes: | 1 |
| Labels: | maxscale | ||
| Environment: |
Non production environment |
||
| Description |
|
We have 2 servers installed Mariadb and setup Master->Slave replication. Installed and setup Maxscale 2.2.5 on SERVER3 MariaDB versions on 2 servers SERVER1 Server version: 10.2.12-MariaDB-log MariaDB Server Maxscale version on SERVER3
/etc/maxscale.cnf file contents
When we do failover by stopping mariadb instance on SERVER1 then the failover was not happend. You can see the following information /mysql/maxscale/var/log/maxscale/maxscale.log
Privileges for maxscale and mysql_repl users
Could you please suggest me is there any thing wrong in respect to maxscale configuration and privileges or any other issue? Thanks, |
| Comments |
| Comment by Venkatarao Beru [ 2018-05-08 ] |
|
Also would like to know, Is slave can be in readonly mode? Thanks, |
| Comment by Venkatarao Beru [ 2018-05-09 ] |
|
Waiting for your updates/suggestions... Thanks, |
| Comment by Esa Korhonen [ 2018-05-10 ] |
|
I don't see any clear reason for the failover not happening. Could you try running "show monitors" in MaxAdmin and paste the output here? The monitor disables automatic failover if it (or switchover) has failed previously. Also, try running manual failover and check the error message. Manual failover is started with the MaxAdmin command "call command mariadbmon failover ReplicationMonitor". Having slave servers in read-only mode is ok and even recommended. Regards, |
| Comment by Venkatarao Beru [ 2018-05-10 ] |
|
Hi Esa, Thank you for looking into this issue. We followed the following document exactly and configured maxscale according to that. Yesterday we tested the same failover and switchover by including the following configuration into /etc/maxscale.cnf under "[ReplicationMonitor]" section then both switchover and failover happened properly. detect_standalone_master=true [ReplicationMonitor] Manual steps have been tested also and went fine after including the above 2 parameters by using the following commands [maxscale@dbcct3vmyd01006 ~]$ maxctrl call command mariadbmon switchover ReplicationMonitor dbserv2 dbserv1 2018-05-09 02:03:50 notice : [mariadbmon] Stopped the monitor ReplicationMonitor for the duration of switchover. [maxscale@dbcct3vmyd01006 ~]$ maxctrl call command mariadbmon switchover ReplicationMonitor dbserv1 dbserv2 2018-05-09 02:08:05 notice : [mariadbmon] Stopped the monitor ReplicationMonitor for the duration of switchover. ###################Failover################### maxctrl call command mariadbmon failover ReplicationMonitor 2018-05-08 13:49:49 error : Monitor was unable to connect to server [dbcct3vmyd01003.idm.sgdcelab.sabre.com]:3307 : "Can't connect to MySQL server on 'dbcct3vmyd01003.idm.sgdcelab.sabre.com' (115)" ##################### Please let us know, is the following parameters manadatory to add into /etc/maxscale.cnf file? After adding the following parameters only failover and switchover works fine. detect_standalone_master=true Thank, |
| Comment by Venkatarao Beru [ 2018-05-10 ] |
|
If slave is in "ReadOnly" mode , how the write operations can perform once this slave becomes master after failover/switchover. Is there any thing manually we need to change the mode from ReadOnly to ReadWrite mode or is there any configuration parameter needs to be included in /etc/maxscale.cnf file? Thanks, |
| Comment by Esa Korhonen [ 2018-05-11 ] |
|
Looks like it is now working correctly. Please ask if there are more problems. Regarding the settings: "detect_standalone_master=true" is a good setting if you predict a situation where there is only one server left and that should be the master. Without this setting, MaxScale won't consider a lone server as "Master". This setting is on by default. "events=master_down" is not required by failover. Leave it on if you wish to run your own scripts when a master goes down. The monitor manages the "read_only"-flag: enabling it when a server is demoted to slave and disabling it when a slave is promoted to master. The automatic failover/rejoin are disabled if the operation fails. Restarting MaxScale enables them again (or maxadmin command "alter monitor ReplicationMonitor auto_failover=1"). The maxadmin command "show monitors" shows the current status of the features. The log shows messages such as "Gtid domain id of master has changed: 1 -> 2." This means that different servers have different domain id values. Unless the events created by the servers are meant to be in different replication streams, it's usually best to have the same gtid domain in the cluster. The server id:s are enough to identify servers. |
| Comment by Venkatarao Beru [ 2018-05-17 ] |
|
Thank you Esa for your updates. Thanks, |