Monday, May 14, 2018

replication - Mysql slave fails to resume from master if master restarted

I have replication setup between two mysql servers, one is a master and the other is the slave.



This works well unless the master is restarted for any reason. When it comes back up the slave doesn't connect. On the slave I do a start slave; then it fails with






090922 17:49:59 [ERROR] Failed to open the relay log '/var/run/mysqld/mysqld-relay-bin.000009' (relay_log_pos 67391580)
090922 17:49:59 [ERROR] Could not find target log during relay log initialization







And I am forced to grab all the data from the master and load it back into the slave and start that again.



How can I avoid this from happening so if the master does get restarted it's not a mission to re-do all the databases.



Here is the config file
Red Hat 5, mysql 5.0.45



[mysqld]
datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1

server-id = 9180
slave_compressed_protocol=1
max_allowed_packet=16M

[mysqld_safe]
log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...