Experiments about the supporting to MySQL high avaliable cluster in Flink MySQL CDC #453
Unanswered
luoyuxia
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Enviroments:
MySQL cluster with docker
https://github.com/docker-box/mysql-cluster
Case 1:
One master, two slaves assuming master, slave1, slave2. Flink CDC listens to slave2, and master fails, change slave1 to master.
1: change slave1 to master
excute the following sql:
stop slave;
GRANT REPLICATION SLAVE ON *.* TO 'mydb_slave_user'@'%' IDENTIFIED BY 'mydb_slave_pwd';
SHOW MASTER STATUS;
NOTE:
SHOW MASTER STATUS;
is aimed to get the 'File' and 'Position' which will be use when make slave2 follow slave1.2: make slave2 follow slave1
excute the following sql:
stop slave;
CHANGE MASTER TO MASTER_HOST='172.20.0.4', MASTER_USER='mydb_slave_user', MASTER_PASSWORD='mydb_slave_pwd', MASTER_LOG_FILE='mysql-bin.000003',MASTER_LOG_POS=1207;
START SLAVE;
NOTE: you should replace MASTER_HOST, MASTER_USER, MASTER_PASSWORD, MASTER_LOG_FILE, MASTER_LOG_POS with proper value.
3: then insert data to slave1, you will find Flink CDC output the inserted data.
Case2:
One master, one slave assuming master, slave. Flink CDC listens to slave, and master fails, change slave to master.
1: change slave to master
excute the following sql:
stop slave;
2: then insert data to slave, you will find Flink CDC output the inserted data.
Case3:
One master, one slave assuming master, slave. Flink CDC listens to master, and master fails, change slave to master.
1: change slave to master
excute the following sql:
stop slave;
2: modify job and then restart
modify the job(change the source table's hostname/port ) to make it listen to slave,
3: then insert data to slave, you will find Flink CDC output the inserted data.
NOTE:
In production enviroments for case3, we can dynamiclly change the MySQL instance the job listens to in the help of DNS or VIP without modifying/restarting the job.
Beta Was this translation helpful? Give feedback.
All reactions