压在透明的玻璃上c-国产精品国产一级A片精品免费-国产精品视频网-成人黄网站18秘 免费看|www.tcsft.com

MySQL5.6從庫(kù)修改主機(jī)名同步停止的解決辦法

  環(huán)境:MySQL5.6 + CentOS6.5

  問(wèn)題描述:從庫(kù)修改主機(jī)名后,從庫(kù)的同步?jīng)]有自動(dòng)啟動(dòng),用start slave命令開啟失敗

  從庫(kù)修改主機(jī)名后,從庫(kù)的同步?jīng)]有自動(dòng)啟動(dòng),查看狀態(tài)如下:

  mysql> show slave statusG

  *************************** 1. row ***************************

  Slave_IO_State:

  Master_Host: 192.168.1.2

  Master_User: manager_slave

  Master_Port: 3306

  Connect_Retry: 10

  Master_Log_File: logbin.000053

  Read_Master_Log_Pos: 588641410

  Relay_Log_File: zzstep-relay-bin.000015

  Relay_Log_Pos: 38778474

  Relay_Master_Log_File: logbin.000053

  Slave_IO_Running: No

  Slave_SQL_Running: No

  Replicate_Do_DB:

  Replicate_Ignore_DB: mysql,information_schema,performance_schema

  Replicate_Do_Table:

  Replicate_Ignore_Table:

  Replicate_Wild_Do_Table:

  Replicate_Wild_Ignore_Table: hn.sphinx%

  Last_Errno: 0

  Last_Error:

  Skip_Counter: 0

  Exec_Master_Log_Pos: 588641410

  Relay_Log_Space: 0

  Until_Condition: None

  Until_Log_File:

  Until_Log_Pos: 0

  Master_SSL_Allowed: No

  Master_SSL_CA_File:

  Master_SSL_CA_Path:

  Master_SSL_Cert:

  Master_SSL_Cipher:

  Master_SSL_Key:

  Seconds_Behind_Master: NULL

  Master_SSL_Verify_Server_Cert: No

  Last_IO_Errno: 0

  Last_IO_Error:

  Last_SQL_Errno: 0

  Last_SQL_Error:

  Replicate_Ignore_Server_Ids:

  Master_Server_Id: 0

  Master_UUID: 8ce09c46-a7be-11e4-8e06-0050569f4b5b

  Master_Info_File: /opt/mysql_data/master.info

  SQL_Delay: 0

  SQL_Remaining_Delay: NULL

  Slave_SQL_Running_State:

  Master_Retry_Count: 86400

  Master_Bind:

  Last_IO_Error_Timestamp:

  Last_SQL_Error_Timestamp:

  Master_SSL_Crl:

  Master_SSL_Crlpath:

  Retrieved_Gtid_Set:

  Executed_Gtid_Set:

  Auto_Position: 0

  1 row in set (0.00 sec)

  使用start slave命令開啟失敗:

  mysql> start slave;

  ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository

  使用reset slave命令解決:

  mysql> reset slave;

  Query OK, 0 rows affected (0.01 sec)

  mysql> start slave;

  Query OK, 0 rows affected (0.03 sec)

  mysql> show slave statusG

  *************************** 1. row ***************************

  Slave_IO_State: Queueing master event to the relay log

  Master_Host: 192.168.1.2

  Master_User: manager_slave

  Master_Port: 3306

  Connect_Retry: 10

  Master_Log_File: logbin.000021

  Read_Master_Log_Pos: 11215004

  Relay_Log_File: db_mysql_02-relay-bin.000007

  Relay_Log_Pos: 22097

  Relay_Master_Log_File: logbin.000005

  Slave_IO_Running: Yes

  Slave_SQL_Running: Yes

  Replicate_Do_DB:

  Replicate_Ignore_DB: mysql,information_schema,performance_schema

  Replicate_Do_Table:

  Replicate_Ignore_Table:

  Replicate_Wild_Do_Table:

  Replicate_Wild_Ignore_Table: hn.sphinx%

  Last_Errno: 0

  Last_Error:

  Skip_Counter: 0

  Exec_Master_Log_Pos: 21937

  Relay_Log_Space: 13113813

  Until_Condition: None

  Until_Log_File:

  Until_Log_Pos: 0

  Master_SSL_Allowed: No

  Master_SSL_CA_File:

  Master_SSL_CA_Path:

  Master_SSL_Cert:

  Master_SSL_Cipher:

  Master_SSL_Key:

  Seconds_Behind_Master: 1071515

  Master_SSL_Verify_Server_Cert: No

  Last_IO_Errno: 0

  Last_IO_Error:

  Last_SQL_Errno: 0

  Last_SQL_Error:

  Replicate_Ignore_Server_Ids:

  Master_Server_Id: 11

  Master_UUID: 8ce09c46-a7be-11e4-8e06-0050569f4b5b

  Master_Info_File: /opt/mysql_data/master.info

  SQL_Delay: 0

  SQL_Remaining_Delay: NULL

  Slave_SQL_Running_State: creating table

  Master_Retry_Count: 86400

  Master_Bind:

  Last_IO_Error_Timestamp:

  Last_SQL_Error_Timestamp:

  Master_SSL_Crl:

  Master_SSL_Crlpath:

  Retrieved_Gtid_Set:

  Executed_Gtid_Set:

  Auto_Position: 0

  1 row in set (0.00 sec)

  mysql>

  總結(jié):

  由于修改主機(jī)名后,relay-log的名稱發(fā)生變化,導(dǎo)致文件IO失敗,reset slave可以重新定位。

    文章來(lái)源:http://huangfuff.blog.51cto.com/2632203/1610429

上一篇:安卓防火墻 PS DroidWall

下一篇:使用主機(jī)telnet遠(yuǎn)程管理路由器和交換機(jī)的詳細(xì)過(guò)程

站长统计