Description:
echo 'CHANGE MASTER TO MASTER_LOG_FILE='\''XMS-1-bin.000049'\'', MASTER_LOG_POS=106, MASTER_USER='\''noneof'\'',MASTER_PASSWORD='\''yourbusiness'\'',MASTER_HOST='\''172.16.0.1
172.16.0.101
172.16.0.102'\'''
++ /usr/bin/mysql -u no -pReally -h 172.16.0.2
~
~
Apparently MySQL Accepts this change master and turns it into :
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 172.16.0.1
172.16.0.101
172.16.0.102
Master_User: repli
Master_Port: 3306
Connect_Retry: 60
How to repeat:
echo 'CHANGE MASTER TO MASTER_LOG_FILE='\''XMS-1-bin.000049'\'', MASTER_LOG_POS=106, MASTER_USER='\''noneof'\'',MASTER_PASSWORD='\''yourbusiness'\'',MASTER_HOST='\''172.16.0.1
172.16.0.101
172.16.0.102'\'''
++ /usr/bin/mysql -u no -pReally -h 172.16.0.2
~
~
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 172.16.0.1
172.16.0.101
172.16.0.102
Master_User: repli
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: XMS-1-bin.000049
Read_Master_Log_Pos: 106
Relay_Log_File: XMS-2-relay.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: XMS-1-bin.000049
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_Do_DB: xpol
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 106
Relay_Log_Space: 106
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:
1 row in set (0.00 sec)
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: 172.16.0.1
172.16.0.101
172.16.0.102
Master_User: repli
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: XMS-1-bin.000049
Read_Master_Log_Pos: 106
Relay_Log_File: XMS-2-relay.000002
Relay_Log_Pos: 251
Relay_Master_Log_File: XMS-1-bin.000049
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: xpol
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 106
Relay_Log_Space: 402
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: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
Restarting mysql however turns it in something worse
mysql> show slave status\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 6
Current database: *** NONE ***
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 172.16.0.1
Master_User: 172.16.0.101
Master_Port: 0
Connect_Retry: 0
Master_Log_File: XMS-1-bin.000049
Read_Master_Log_Pos: 106
Relay_Log_File: XMS-2-relay.000003
Relay_Log_Pos: 4
Relay_Master_Log_File: XMS-1-bin.000049
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xpol
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 106
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: Yes
Master_SSL_CA_File: 60
Master_SSL_CA_Path: 0
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 2003
Last_IO_Error: error connecting to master '172.16.0.101@172.16.0.1:0' - retry-time: 0 retries: 86400
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
As you can see the Master_Host and Master_User entries have wrapped ..
Suggested fix:
Adding a multiple line MASTER_HOST values should cause an error.
After a restart, the values should be identical,