Received a demand today, said to be in the international for MySQL to establish replication. This is really nothing, the network environment is worse, MySQL is also able to deal with. But the time zone problem happens to be wrong!
The error is as follows:
[Warning] Slave I/o: Get master clock failed with Error:lost connection to MySQL server during query, Error_code:2
[Warning] Slave I/o: Master command com_register_slave failed:failed registering on master, reconnecting to try again, log ' 1.00000 1 ' at position 48920, error_code:1597
Slave cannot get master's clock,mysql time_zone variable by default equals =system that is the system's time zone. Modify the time zone mode: Set global time_zone= ' +00:00 ' or set global time_zone= ' -11:00 '; simply modifying the DB's time zone can cause local program clutter and ultimately the decision to modify the system's time zone. The problem was given to our operation (Crontab's time zone), which was later reset to DB.
Here is a simple summary of the establishment of replication considerations:
1, server_id to the only
2, Binlog and relay_log names to be customized. Cannot use Hostname.log (when modifying system hostname may cause database to not start)
3, the database time zone should be consistent
4, for the dedicated users to replicate the master and slave on the same time to establish the account (easy failover, for future automation to prepare)
5, for the slave end of the database filtering, it is recommended to use: replicate__wild_do_table (so for the statement mode of replication does not need to consider whether to use the effect of using the statement. can refer to: http://weipengfei.blog.51cto.com/1511707/1070485
This article is from the "Technology Achievement Dream" blog, please be sure to keep this source http://weipengfei.blog.51cto.com/1511707/1170332
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/