Chinaunix首页 | 论坛 | 博客
  • 博客访问: 192629
  • 博文数量: 33
  • 博客积分: 2020
  • 博客等级: 大尉
  • 技术积分: 380
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-20 14:56
文章分类

全部博文(33)

文章存档

2010年(26)

2009年(7)

我的朋友

分类: Mysql/postgreSQL

2010-07-09 14:23:02

今天早晨巡检发现mysql主备模式数据库同步状态终止:

ysql> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.69.54
                  Master_User: rep
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000398
          Read_Master_Log_Pos: 538760573
               Relay_Log_File: JSNJ-MFS-3F-69-55-relay-bin.000298
                Relay_Log_Pos: 251
        Relay_Master_Log_File: mysql-bin.000398
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              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:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 538760573
              Relay_Log_Space: 563
              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
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

网上对这个参数的解释:
max_allowed_packet   Mysql 5.1 遇到的信息包过大问题 用客户端导入数据的时候,遇到 错误代码: 1153 - Got a packet bigger than 'max_allowed_packet' bytes 终止了数据导入。   当

MySQL客户端或mysqld服务器收到大于max_allowed_packet字节的信息包时,将发出“信息包过大”错误,并关闭连接。对于某些客户端,如果通信信息包过大,在执行查询期间,可能会遇到“丢失与

MySQL服务器的连接”错误。   客户端和服务器均有自己的max_allowed_packet变量,因此,如你打算处理大的信息包,必须增加客户端和服务器上的该变量。一般情况下,服务器默认max-allowed-

packet为1MB   如果你正在使用mysql客户端程序,其max_allowed_packet变量的默认值为16MB。要想设置较大的值,可用下述方式启动mysql   mysql>mysql --max-allowed-packet=32M   在

my.ini也可以更改,需要重新启动mysql   在my.ini加入[mysql]max_allowed_packet=16M

 

处理方式:

在主从库上分别执行:

mysql> set global max_allowed_packet=16777216;
Query OK, 0 rows affected (0.00 sec)

 

再检查同步状态,就成功了。

            Master_Log_File: mysql-bin.000402
          Read_Master_Log_Pos: 815592592
               Relay_Log_File: JSNJ-MFS-3F-69-55-relay-bin.000299
                Relay_Log_Pos: 66406327
        Relay_Master_Log_File: mysql-bin.000398
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0

 

 

 

阅读(3391) | 评论(0) | 转发(0) |
0

上一篇:mysql cluster 安装测试

下一篇:mail发命令

给主人留下些什么吧!~~