主机名更改后,同步机操作

| |
[不指定 2009/06/01 15:07 | by admin ]
By default, relay log file names have the form host_name-relay-bin.nnnnnn, where host_name is the name of the slave server host and nnnnnn is a sequence number. Successive relay log files are created using successive sequence numbers, beginning with 000001. The slave uses an index file to track the relay log files currently in use. The default relay log index file name is host_name-relay-bin.index. By default, the slave server creates relay log files in its data directory.

The default file names for relay logs and relay log index files can be overridden with, respectively, the --relay-log and --relay-log-index server options (see Section 16.1.3, “Replication and Binary Logging Options and Variables”). For this reason, changing a replication slave's host name can cause replication to fail with the errors Failed to open the relay log and Could not find target log during relay log initialization. This is a known issue which we intend to fix in a future MySQL release (see Bug#2122). If you anticipate that a slave's host name may change in the future (for example, if networking is set up on the slave such that its host name can be modified via DHCP), then you can use these options to prevent this problem from occurring. However, if you encounter this issue, one way to work around it is to stop the slave server, prepend the contents of the old relay log index file to the new one, then restart the slave. On a Unix system, this can be done as shown here, where new_host_name is the new host name and old_host_name is the old one:


shell> cat new_host_name-relay-bin.index >> old_host_name-relay-bin.index

shell> mv old_host_name-relay-bin.index new_host_name-relay-bin.index
工作 | 评论(0) | 引用(0) | 阅读(476)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]