时间:2021-07-01 10:21:17 帮助过:3人阅读
mysql> reset slave; Query OK, 0 rows affected (0.01 sec) mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1;
ERROR 29 (HY000): File ‘/data/mysqldata/3306/binlog/mysql-relay-bin.000001‘ not found (Errcode: 2) 看来应该还是mysql-relay-bin.index的问题,删除该文件及关联的relay-bin文件。再次配置master:
mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1; ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
出现了新的错误,按照提示查看error_log也没发现更多错误信息,error_log中只是显示一条:
120326 11:14:27 [ERROR] Error reading master configuration 在操作系统端查看master/slave的配置文件,发现是两个0字节文件: -rw-rw---- 1 mysql mysql 0 Mar 26 11:13 master.info -rw-rw---- 1 mysql mysql 0 Mar 26 11:13 relay-log.info
会不会是这个原因呢,直接删除这两个文件,然后尝试重新执行change master:
mysql> change master to -> master_host=‘10.0.0.101‘, -> master_port=3306, -> master_user=‘repl‘, -> master_password=‘repl‘, -> master_log_file=‘mysql-bin.000011‘, -> master_log_pos=1; Query OK, 0 rows affected (0.00 sec)
成功,启动slave并查看状态:
mysql> start slave; Query OK, 0 rows affected (0.00 sec) mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 10.0.0.101 Master_User: repl Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000011 Read_Master_Log_Pos: 101
处理一则MySQL Slave环境出现ERROR 1201 (HY000): Could not initialize master info structure的案例。
标签:str 简单 技术 exe 配置 could not tle message state