Mysql Replication Crash Safe Slaves Replication Feature introduced in 5.6
1 2 3 |
2015-08-08 06:29:58 3850 [Warning] Slave SQL: If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0 |
Mysql Replication Crash Safe Slaves Replication Feature introduced in 5.6
Mysqld log’unda yukarıdaki hatayı alıyorsak aşağıda belirteceğim sıralamayı yaparak fix edebilirsiniz.
1 2 3 4 5 6 7 8 9 |
root@database> select table_name,engine from information_schema.tables -> where table_name in ('slave_relay_log_info','slave_master_info'); +----------------------+--------+ | table_name | engine | +----------------------+--------+ | slave_master_info | InnoDB | | slave_relay_log_info | InnoDB | +----------------------+--------+ 2 rows in set (0.00 sec) |
1 2 3 4 5 6 7 8 |
root@database> show variables like '%info_repository'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | master_info_repository | FILE | | relay_log_info_repository | FILE | +---------------------------+-------+ 2 rows in set (0.00 sec) |
Bu iki değer Dynamic Variable olduğu için mysql restart etmeden parametreleri güncelleyebiliriz. Değerlerin kalıcı olması için /etc/my.cnf’ye aşağıdaki iki satırı eklemeliyiz
1 2 |
master_info_repository=TABLE relay_log_info_repository=TABLE |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
mysql> set global master_info_repository="TABLE"; Query OK, 0 rows affected (0.09 sec) mysql> set global relay_log_info_repository="TABLE"; Query OK, 0 rows affected (0.06 sec) mysql> show variables like '%info_repository'; +---------------------------+-------+ | Variable_name | Value | +---------------------------+-------+ | master_info_repository | TABLE | | relay_log_info_repository | TABLE | +---------------------------+-------+ 2 rows in set (0.00 sec) |
Ayarları verify edelim.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
mysql> select * from mysql.slave_master_info \G *************************** 1. row *************************** Number_of_lines: 23 Master_log_name: mysql-bin.009636 Master_log_pos: 914591272 Host: 10.10.141.30 User_name: replication User_password: acfgbh18 Port: 3306 Connect_retry: 60 Enabled_ssl: 0 Ssl_ca: Ssl_capath: Ssl_cert: Ssl_cipher: Ssl_key: Ssl_verify_server_cert: 0 Heartbeat: 30 Bind: Ignored_server_ids: 0 Uuid: Retry_count: 86400 Ssl_crl: Ssl_crlpath: Enabled_auto_position: 0 1 row in set (0.00 sec) mysql> select * from mysql.slave_relay_log_info \G *************************** 1. row *************************** Number_of_lines: 7 Relay_log_name: /var/lib/mysql/data/mysql-relay-bin.000051 Relay_log_pos: 39314266 Master_log_name: mysql-bin.009636 Master_log_pos: 824285474 Sql_delay: 0 Number_of_workers: 0 Id: 1 1 row in set (0.00 sec) mysql> |