[转帖]困惑解决msyql主从同步问题_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1940 | 回复: 0   主题: [转帖]困惑解决msyql主从同步问题        下一篇 
jrong1987
注册用户
等级:新兵
经验:66
发帖:67
精华:0
注册:2011-12-23
状态:离线
发送短消息息给jrong1987 加好友    发送短消息息给jrong1987 发消息
发表于: IP:您无权察看 2014-12-2 15:02:35 | [全部帖] [楼主帖] 楼主

目前从库不同步,

查看状态:

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: xxxx
Master_User: xxx
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: xxx-bin.000001
Read_Master_Log_Pos: 1440046
Relay_Log_File: host-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File:xxx-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx
Replicate_Ignore_DB: mysql
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: 1440046
Relay_Log_Space: 106
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: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)


从服务器大量错误日志:

101027 16:50:58 [Note] Slave I/O thread: connected to master 'xxx@xxxxxx:3306',replication started in log 'xxx-bin.000001' at position 1440046
101027 16:50:58 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
101027 16:50:58 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', Error_code: 1236
101027 16:50:58 [Note] Slave I/O thread exiting, read up to log 'xxx-bin.000001', position 1440046


主状态:

mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000001
Position: 1440046
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)


按照正常流程解决,应该是:

slave stop;
CHANGE MASTER TO MASTER_HOST='xxx',MASTER_USER='xx',MASTER_PASSWORD='xx',MASTER_PORT=3306,MASTER_LOG_FILE='xxx-bin.000001',MASTER_LOG_POS=1440046;
slave start;


问题依然存在,

后来经过以下步骤解决,不过有点困惑:

1、重启主库

2、给从库重新授权

3、执行以下命令

slave stop;
reset slave;
slave start;


--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论