免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1197 | 回复: 0
打印 上一主题 下一主题

slave数据库无法启动 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-22 08:53 |只看该作者 |倒序浏览
 Last_error: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
 
ERROR 1201: Could not initialize master info structure, more error messages can be found in the MySQL error log
Feb 15 07:41:06 rdb-sl mysqld[18223]: 080215  7:41:06 [ERROR] Failed to open log (file './db-sl-relay-bin.000030', errno 2)
  Feb 15 07:41:06 db-sl mysqld[18223]: 080215  7:41:06 [ERROR] Failed to open the relay log './db-sl-relay-bin.000030' (relay_log_pos 75527094)
  Feb 15 07:41:06 db-sl mysqld[18223]: 080215  7:41:06 [ERROR] Could not open log file
before you consider making a mysqldump –masterdata on the master database and reimport the entire dump.. try this:
-> stop mysql on the slave server
-> find the directory that contains the relay logs (usually /var/lib/mysql)
-> delete all relay logs called hostname-relay-bin.XXX, hostname-relay-bin.index and relay-log.info
-> restart mysql
Your mysql will start with fresh relay logs and is getting the missing data directly from the master server, as there will be probably still bin logs!
 
The simplest way to restart replication from this point is to re-enter the mater.info data manually. Do the following:
1.STOP SLAVE
2.RESET SLAVE
3.CHANGE MASTER TO MASTER_HOST=’your_master’, MASTER_USER=’your_login’, MASTER_PASSWORD=’your_password’, MASTER_LOG_FILE=’log_file’, MASTER_LOG_POS=log_position
4.START SLAVE
At this point you want to execute ‘SHOW SLAVE STATUS’ and check to see if everything is running. Most times MySQL will stop since it tried to replay a duplicate record from the logs. We need to tell MySQL to skip that record and continue:
1.SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1
2.START SLAVE
That should get replication up and running again.
What is interesting to note is that, under the same circumstances, my MySQL 4 servers had no problems continuing replication.
 
 
 
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP