免费注册 查看新帖 |

Chinaunix

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

mysql binlog 有问题 请大家帮帮忙 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-11-01 21:12 |只看该作者 |倒序浏览
  1. root@mysql1:/usr/local/mysql# bin/mysqlbinlog var/mysql-bin.000001
  2. /*!40019 SET @@session.max_insert_delayed_threads=0*/;
  3. /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
  4. DELIMITER /*!*/;
  5. # at 4
  6. #111101 21:01:55 server id 128  end_log_pos 106         Start: binlog v 4, server v 5.1.37-log created 111101 21:01:55 at startup
  7. # Warning: this binlog is either in use or was not closed properly.
  8. ROLLBACK/*!*/;
  9. BINLOG '
  10. w+2vTg+AAAAAZgAAAGoAAAABAAQANS4xLjM3LWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  11. AAAAAAAAAAAAAAAAAADD7a9OEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
  12. '/*!*/;
  13. ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 78, event_type: 2
  14. DELIMITER ;
  15. # End of log file
  16. ROLLBACK /* added by mysqlbinlog */;
  17. /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
复制代码
我在主库上创建了一个aaa的数据库,但是binlog确实这样,我刷过日志,也没用
主库的信息
  1. mysql> show processlist;
  2. +----+------------+----------------------+------+-------------+------+----------------------------------------------------------------+------------------+
  3. | Id | User       | Host                 | db   | Command     | Time | State                                                          | Info             |
  4. +----+------------+----------------------+------+-------------+------+----------------------------------------------------------------+------------------+
  5. |  2 | mysqlrsync | 192.168.11.129:40801 | NULL | Binlog Dump |  417 | Has sent all binlog to slave; waiting for binlog to be updated | NULL             |
  6. |  3 | root       | localhost            | NULL | Query       |    0 | NULL                                                           | show processlist |
  7. +----+------------+----------------------+------+-------------+------+----------------------------------------------------------------+------------------+
  8. 2 rows in set (0.00 sec)
复制代码
slave 是信息
  1. mysql> show slave status\G;
  2. *************************** 1. row ***************************
  3.                Slave_IO_State: Waiting for master to send event
  4.                   Master_Host: 192.168.11.128
  5.                   Master_User: mysqlrsync
  6.                   Master_Port: 3306
  7.                 Connect_Retry: 60
  8.               Master_Log_File: mysql-bin.000001
  9.           Read_Master_Log_Pos: 184
  10.                Relay_Log_File: mysql-relay-bin.000002
  11.                 Relay_Log_Pos: 251
  12.         Relay_Master_Log_File: mysql-bin.000001
  13.              Slave_IO_Running: Yes
  14.             Slave_SQL_Running: No
  15.               Replicate_Do_DB:
  16.           Replicate_Ignore_DB:
  17.            Replicate_Do_Table:
  18.        Replicate_Ignore_Table:
  19.       Replicate_Wild_Do_Table:
  20.   Replicate_Wild_Ignore_Table:
  21.                    Last_Errno: 1594
  22.                    Last_Error: Relay log read failure: 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.
  23.                  Skip_Counter: 0
  24.           Exec_Master_Log_Pos: 106
  25.               Relay_Log_Space: 484
  26.               Until_Condition: None
  27.                Until_Log_File:
  28.                 Until_Log_Pos: 0
  29.            Master_SSL_Allowed: No
  30.            Master_SSL_CA_File:
  31.            Master_SSL_CA_Path:
  32.               Master_SSL_Cert:
  33.             Master_SSL_Cipher:
  34.                Master_SSL_Key:
  35.         Seconds_Behind_Master: NULL
  36. Master_SSL_Verify_Server_Cert: No
  37.                 Last_IO_Errno: 0
  38.                 Last_IO_Error:
  39.                Last_SQL_Errno: 1594
  40.                Last_SQL_Error: Relay log read failure: 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.
  41. 1 row in set (0.00 sec)

  42. ERROR:
  43. No query specified
复制代码

论坛徽章:
0
2 [报告]
发表于 2011-11-01 21:15 |只看该作者
  1. 主库的配置文件
  2. [client]
  3. port            = 3306
  4. socket          = /tmp/mysql.sock

  5. [mysqld]
  6. port            = 3306
  7. socket          = /tmp/mysql.sock
  8. key_buffer_size = 16M
  9. max_allowed_packet = 1M
  10. table_open_cache = 64
  11. sort_buffer_size = 512K
  12. net_buffer_length = 8K
  13. read_buffer_size = 256K
  14. read_rnd_buffer_size = 512K
  15. myisam_sort_buffer_size = 8M
  16. log-bin=mysql-bin
  17. server-id=128
  18. skip-name-resolve
  19. [mysqldump]
  20. quick
  21. max_allowed_packet = 16M

  22. [mysql]
  23. no-auto-rehash

  24. [myisamchk]
  25. key_buffer_size = 20M
  26. sort_buffer_size = 20M
  27. read_buffer = 2M
  28. write_buffer = 2M

  29. [mysqlhotcopy]
  30. interactive-timeout
复制代码

论坛徽章:
0
3 [报告]
发表于 2011-11-01 21:16 |只看该作者
  1. 从库的
  2. [client]
  3. port            = 3306
  4. socket          = /tmp/mysql.sock


  5. [mysqld]
  6. port            = 3306
  7. socket          = /tmp/mysql.sock
  8. key_buffer_size = 16M
  9. max_allowed_packet = 1M
  10. table_open_cache = 64
  11. sort_buffer_size = 512K
  12. net_buffer_length = 8K
  13. read_buffer_size = 256K
  14. read_rnd_buffer_size = 512K
  15. myisam_sort_buffer_size = 8M
  16. relay_log = mysql-relay-bin
  17. server-id=129
  18. skip-name-resolve
  19. slave-skip-errors=all
  20. [mysqldump]
  21. quick
  22. max_allowed_packet = 16M

  23. [mysql]
  24. no-auto-rehash

  25. [myisamchk]
  26. key_buffer_size = 20M
  27. sort_buffer_size = 20M
  28. read_buffer = 2M
  29. write_buffer = 2M

  30. [mysqlhotcopy]
  31. interactive-timeout
复制代码

论坛徽章:
0
4 [报告]
发表于 2011-11-01 21:19 |只看该作者
mysql版本是mysql-5.1.37

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
5 [报告]
发表于 2011-11-02 07:18 |只看该作者
master 上执行
mysqlbinlog -vv var/mysql-bin.000001

slave 上执行
mysqlbinlog -vv var/mysql-relay-bin.000002

看看哪个会提示日志错误,如果只是slave有错,那就change master to 这条记录 重新start slave。
如果主库日志就有错,那就只能在slave上跳过这条日志了

论坛徽章:
0
6 [报告]
发表于 2011-11-02 09:17 |只看该作者
我所有的binlog都基本一样  就像上面那样。

论坛徽章:
0
7 [报告]
发表于 2011-11-02 13:19 |只看该作者
我这样回答你的问题吧:

  1. [root@Asterisk data]# mysqlbinlog mysql-bin.000029|wc -l
  2. ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 75, event_type: 19
  3. Could not read entry at offset 1058:Error in log format or read error
  4. 53
  5. [root@Asterisk data]# ../bin/mysqlbinlog mysql-bin.000029|wc -l
  6. 11834
复制代码
mysql版本问题,可能之前你有另外一个版本。

论坛徽章:
0
8 [报告]
发表于 2011-11-02 13:21 |只看该作者
我这样回答你的问题吧:

  1. [root@Asterisk data]# mysqlbinlog mysql-bin.000029|wc -l
  2. ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 75, event_type: 19
  3. Could not read entry at offset 1058:Error in log format or read error
  4. 53
  5. [root@Asterisk data]# ../bin/mysqlbinlog mysql-bin.000029|wc -l
  6. 11834
复制代码
mysql版本问题,可能之前你有另外一个版本。

论坛徽章:
0
9 [报告]
发表于 2011-11-02 13:22 |只看该作者
我这样回答你的问题吧:

  1. [root@Asterisk data]# mysqlbinlog mysql-bin.000029|wc -l
  2. ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 75, event_type: 19
  3. Could not read entry at offset 1058:Error in log format or read error
  4. 53
  5. [root@Asterisk data]# ../bin/mysqlbinlog mysql-bin.000029|wc -l
  6. 11834
复制代码
mysql版本问题,可能之前你有另外一个版本。

论坛徽章:
0
10 [报告]
发表于 2011-11-02 13:24 |只看该作者
晕,怎么一下子提交了3次了呢。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP