tanji / mariadb-tools Goto Github PK
View Code? Open in Web Editor NEWToolkit for MariaDB
License: GNU General Public License v2.0
Toolkit for MariaDB
License: GNU General Public License v2.0
It would be really handy to have MaxScale support, as it can be controlled by telnet, we would not need no VIP in case of failover. MaxScale would be informed of who is the new master.
It could be interesting to definitively exclude the old master from the cluster after a switch over.
In short, add an option to make a fail over.
Thanks.
When I do a swichover using mariadb-repmgr i would like to pass an option to set a value for the MASTER_CONNECT_RETRY as it is too low in the default value (10).
Original state:
Master Host Port Binlog Position Strict Mode
srv-02 3306 1-180533626-105,2-180533626-1 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-03 3306 ON Slave_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
srv-04 3306 ON Current_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
srv-05 3306 ON Slave_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
srv-06 3306 ON Current_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
Then, state after a switch over:
Master Host Port Binlog Position Strict Mode
srv-03 3306 1-180533627-92 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-02 3306 ON Current_Pos 1-180533630-104 Running OK 0 ON
srv-04 3306 ON Current_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
srv-05 3306 ON Slave_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
srv-06 3306 ON Current_Pos 1-180533626-105,2-180533626-1 Running OK 0 ON
The new master and the old master are not in sync with other slaves.
State after a new transaction:
Master Host Port Binlog Position Strict Mode
srv-03 3306 1-180533627-106 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-02 3306 ON Current_Pos 1-180533627-106 Running OK 0 ON
srv-04 3306 ON Current_Pos 1-180533627-106,2-180533626-1 Running OK 0 ON
srv-05 3306 ON Slave_Pos 1-180533627-106,2-180533626-1 Running OK 0 ON
srv-06 3306 ON Current_Pos 1-180533627-106,2-180533626-1 Running OK 0 ON
Switch over is no longer possible.
Original state:
Master Host Port Binlog Position Strict Mode
srv-01 3306 1-180533630-102 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-02 3306 ON Slave_Pos 1-180533630-102 Running OK 0 ON
srv-03 3306 ON Current_Pos 1-180533630-102 Running OK 0 ON
srv-04 3306 ON Slave_Pos 1-180533630-102 Running OK 0 ON
srv-05 3306 ON Current_Pos 1-180533630-102 Running OK 0 ON
Then, perform a switch over:
Master Host Port Binlog Position Strict Mode
srv-05 3306 1-180533626-101 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-02 3306 ON Slave_Pos 1-180533630-102 Running OK 0 ON
srv-03 3306 ON Current_Pos 1-180533630-102 Running OK 0 ON
srv-04 3306 ON Slave_Pos 1-180533630-102 Running OK 0 ON
srv-01 3306 ON Current_Pos 1-180533626-101 Running OK 0 ON
GTID is not equal between master and slaves.
A new switch over triggers errors:
2015/01/29 14:36:54 Electing a new master
2015/01/29 14:36:54 Processing %s candidates 4
2015/01/29 14:36:54 Connecting to slave srv-02:3306
2015/01/29 14:36:54 WARNING: Slave srv-02:3306 not in sync. Skipping
2015/01/29 14:36:54 Connecting to slave srv-02:3306
2015/01/29 14:36:54 WARNING: Slave srv-02:3306 not in sync. Skipping
2015/01/29 14:36:54 Connecting to slave srv-02:3306
2015/01/29 14:36:54 WARNING: Slave srv-02:3306 not in sync. Skipping
2015/01/29 14:36:54 Connecting to slave srv-02:3306
2015/01/29 14:36:54 WARNING: Slave srv-02:3306 not in sync. Skipping
2015/01/29 14:36:54 ERROR: No suitable candidates found.
New transaction needed on master to retrieve a correct state:
Master Host Port Binlog Position Strict Mode
srv-05 3306 1-180533626-103 OFF
Slave Host Port Binlog Using GTID Slave GTID Replication Health Delay RO
srv-02 3306 ON Slave_Pos 1-180533626-103 Running OK 0 ON
srv-03 3306 ON Current_Pos 1-180533626-103 Running OK 0 ON
srv-04 3306 ON Slave_Pos 1-180533626-103 Running OK 0 ON
srv-01 3306 ON Current_Pos 1-180533626-103 Running OK 0 ON
As any write on a slave will change current_pos to include the GTID of the write on the slave, when switching over, the slave will look for that GTID in the new master. This will cause replication to break.
Possible solutions: use gtid_slave_pos to initialize replication. Parse gtid_binlog_state to get the correct GTID.
Although socket sounds the most natural and optimal way of connecting, adding TCP would add flexibility and enable a few other usage scenarios, such as non-local and/or containerized deployments.
Questions:
If the tool is launched locally on the elected master and if this host is declared as 127.0.0.1 in the /etc/hosts, all slaves will be attached to 127.0.0.1 instead of the new master's IP.
Hello, it could be interesting to have an option to choose the new master manually.
Thanks.
If all slaves have a replication lag greater than 0, switch over stop with "not in sync" message.
The verbose option is not enough IMO.
Thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.