免费注册 查看新帖 |

Chinaunix

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

求mysql 从库问题,如何修复啊! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-30 18:50 |只看该作者 |倒序浏览
mysql 5

从库状态如下

Slave_IO_State: Waiting for master to send event
                Master_Host: 192.168.0.165
                Master_User: slave
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: binlog_web165.000021
        Read_Master_Log_Pos: 995827060
             Relay_Log_File: web71-relay-bin.000118
              Relay_Log_Pos: 808661175
      Relay_Master_Log_File: binlog_web165.000017
           Slave_IO_Running: Yes
          Slave_SQL_Running: No
            Replicate_Do_DB:
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 0
                 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.
               Skip_Counter: 0
        Exec_Master_Log_Pos: 808661034
            Relay_Log_Space: 5291083724
            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
1 row in set (0.00 sec)
请问如何才能继续同步啊!

论坛徽章:
0
2 [报告]
发表于 2006-06-30 21:20 |只看该作者
这可能是BIN-LOG文件出错,你以暂跳过这个错误,但这样数据库的确就不完成了。Mysql 的MASTER & Slave方式在这方面的确会出现这样的问题!

如果实在没法,你最好把Master数据库全部复制到Slave中重新启动两个Mysql服务

[ 本帖最后由 windychan 于 2006-6-30 21:24 编辑 ]

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
3 [报告]
发表于 2006-07-01 10:39 |只看该作者
在slave上
/usr/local/mysql/bin/mysqldump -h192.168.0.165 --master-data --all-databases >/tmp/all.sql
/usr/local/mysql/bin/mysql -A -e "slave stop"
/usr/local/mysql/bin/mysql </tmp/all.sql
/usr/local/mysql/bin/mysql -A -e "slave start"

搞定

论坛徽章:
0
4 [报告]
发表于 2006-07-03 09:06 |只看该作者
原帖由 dfmark 于 2006-6-30 18:50 发表
mysql 5

从库状态如下

Slave_IO_State: Waiting for master to send event
                Master_Host: 192.168.0.165
                Master_User: slave
                Master_Port: 3306
     ...


master和slave的版本分别是什么

论坛徽章:
0
5 [报告]
发表于 2006-07-03 11:31 |只看该作者
mysql 主从库都是 mysql-5.0.15 的,自己编译安装的,安装后一直正常运行了几个月了,今天上去查看就发现出了这个问题,数据库现在大约3G多!对于mysql从库恢复的知识了解不多,大家有什么好的方法建议和资料请告诉我,谢谢啊!

[ 本帖最后由 dfmark 于 2006-7-3 11:38 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2006-07-03 11:47 |只看该作者

回复 3楼 love100 的帖子

原帖由 love100 于 2006-7-1 10:39 发表
在slave上
/usr/local/mysql/bin/mysqldump -h192.168.0.165 --master-data --all-databases >/tmp/all.sql
/usr/local/mysql/bin/mysql -A -e "slave stop"
/usr/local/mysql/bin/mysql </tm ...


谢谢,有两个问题。
1、在主库导出数据库时是否会发生主库锁表问题?
2、导入从库事时是不是要防止主库写入产生的数据不统一?

论坛徽章:
0
7 [报告]
发表于 2006-07-03 12:33 |只看该作者

论坛徽章:
0
8 [报告]
发表于 2006-07-03 13:15 |只看该作者
非常感谢!

论坛徽章:
0
9 [报告]
发表于 2006-07-03 14:51 |只看该作者
刚刚从新做好的主从库没有20分钟呢又出现那样的错于了,
查看从库的日志文件
../bin/mysqlbinlog web71-relay-bin.000118 >/dev/null
ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 82779, event_type: 2
Could not read entry at offset 113282787:Error in log format or read error
应该是日志文件损坏了,
频频出现日志损坏的问题,能是那的原因呢!
现在想跳过web71-relay-bin.000118 这个文件从新同步,能作到吗?
有知道的朋友吗!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP