MySQL 8.0.11 INNODB cluster Operations Management Handbook Three added node author Fanglian
Assume
InnoDB cluster cluster ran for 1 years, suddenly a node hung out, this time, the log has not binlog.000001, if the online add a from the library, the official given Mysqlbackup based on
Recovery method, in the remaining from the library to do the backup, in the new from the library, here are some technical points, I ignored, distressed for a long time.
To create an experimental environment:
Frequent operation of data to write the storage, switch four binlog. Flush logs, show binary logs
- Observing log time information from library
From the Binlog and Relay-log of library 1
From the Binlog and Relay-log of library 2
You can see that the main library switches logs from the library and does not switch
Clean out the 1th, 2 binglog, write some data,
PURGE MASTER LOGS TO ‘binlog.000003‘;
- At this point one hangs from the library and restarts the host
- The main library continues to write data manually, finds it hangs from the library, and needs to add
Step 1 Full-scale backup:
mysqlbackup --host=127.0.0.1 --port=3310 --user=backup --password=$$$$$$$$ --no-history-logging --backup-dir=/data/backup/fullbak --with-timestamp backup-and-apply-log
--no-history-logging cannot write backup information to database because it is operating from library
Step 2: Copy to new slave recovery from library
Back up the compressed copy to the slave and unzip
scp [email protected]:/data/backup/fullbak/2018-07-25_14-32-32.tar.gz .tar -xzvf 2018-07-25_14-32-32.tar.gz
Copy the live configuration file from the library, modify the information in the Group copy section
Step 3: Continue inserting data into the main library Step 4: Recovering new instances
Recovering from the library database
Mysqlbackup--defaults-file=/data/mysql_3310_test/conf/my.cnf--backup-dir=/data/backup/fullbak/2018-07-26_ 20-59-35 Copy-back-and-apply-log
Step 5: Clean up old information
To turn off logging:
set sql_log_bin=off;use mysqldelete from slave_relay_log_info ;delete from slave_master_info ;set sql_log_bin=on;
Note that this cannot be done
Reset Master and reset Slave
And
Drop Database Mysql_innodb_cluster_metadata
Restart the database, there should be no error.
Step 6 Shell Delete and add instances
Force deletion of suspended instances
cluster.removeInstance(‘[email protected]:3310‘,{force:1})
Add an instance
cluster.addInstance(‘[email protected]:3310‘)
Record of stepping on pits
Group replication increases the membership mode and the InnoDB cluster cluster adds members differently,
MySQL 8.0.11 INNODB cluster Operations Management Handbook three additional nodes