MySQL--从库启动复制报错1236
链接:http://blog.csdn.net/yumushui/article/details/42742461
今天在搭建一个MySQL master-slave集群时,执行了change master命令,然后又 start slave 启动slave服务,结果查看salve状态就出现错误了:
1.Sandy飓风导致NYC机房停电,重启后看到的日志如下:
121101 16:35:25 [ERROR] Slave I/O: Got fatal error 1236 from master when
reading data from binary log: 'Client requested master to start
replication from impossible position', Error_code: 1236
121101 16:35:25 [Note] Slave I/O thread exiting, read
up to log 'mysql-bin.014497', position 38542146
121101 16:41:36 [Note] Error reading relay log event:
slave SQL thread was killed
然后看binlog如下:
# at 38539267
#121101 13:11:04 server id 1 end_log_pos 38539294
Xid = 934362432
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
master突然当机造成的master的pos要小于slave的错误日志记录的pos,mysql-bin.014497的最后一个位置是:
end_log_pos 38539294,但没有被commit,所以上一个是 38539267 那么直接设pos为master的最后有效的位置即可,
change
master to master_log_file='mysql-bin.014497',master_log_pos=38539267;
但也有可能情况相反,可能slave丢了部分数据或延迟,此时把pos往前移,反复试验即可。
2. Got fatal error
1236: 'Could not find first log file name in binary log index file' from master when reading data from binary log
logfile有空格,或是master上对应的Log被删了。
3. Show processlist 看到很多sleep,可能是应用代码做完query之后没用close()主动关闭链接。这样会一直到timeout才断掉,但这个timeout太小的话,会导致mysql
has gone away 这种错误。
MySQL--从库启动复制报错1236的更多相关文章
- MySql:CentOS7安装mysql后无法启动服务报错,(需要更新yum源)
首先:需要更新你的yum源,保证yum源最新. 1.安装: yum install -y mariadb-server 2.启动maria DB服务: systemctl start mariadb. ...
- Eclipse启动Tomcat报错,系统缺少本地apr库
Eclipse启动Tomcat报错,系统缺少本地apr库. Tomcat中service.xml中的设置情况. 默认情况是HTTP协议的值:protocol="HTTP/1.1" ...
- mysql5.7同步复制报错1060故障处理
mysql5.7同步复制报错故障处理 # 报错 1060,具体如下Last_Errno: 1060Last_Error: Coordinator stopped because there were ...
- C# 解决SharpSvn启动窗口报错 Unable to connect to a repository at URL 'svn://....'
在远程机打开sharpsvn客户端测试,结果报错 Svn启动窗口报错 Unable to connect to a repository at URL 'svn://...' 咋整,我在win10我的 ...
- mysql-connector-java升级到6.0以后启动tomcat报错
mysql-connector-java升级到6.0以后启动tomcat报错 java.sql.SQLException: The server time zone value '�й���ʱ��' ...
- Springboot项目 配置数据库连接属性后,启动项目报错
Springboot项目 配置数据库连接属性后,启动项目报错,错误如下: 错误原因分析: 1.连接信息配置错误 当使用properties为配置文件时,如图所示,上面的 spring.datasour ...
- maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...
- 【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
转载地址:http://blog.csdn.net/jnqqls/article/details/8946964 1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动to ...
- 学习中的错误——ubuntu 14.04 LTS 启动eclipse报错
在ubuntu中启动eclipse报错:(Eclipse:15978): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assert ...
随机推荐
- 【pwnable.tw】 applestore
做到这道题的时候正赶上iPhone 8上市,撒花~(虽然不知道为啥) 程序分析: 先进到main函数,比较简单. myCart位于bss段上,是一个长度为0x10. 主要的处理函数是handler函数 ...
- Ubuntu用sudo apt-get update出错:E: Problem executing scripts APT::Update::Post-Invoke-Success
Ubuntu用sudo apt-get update出错: E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /u ...
- linux测试网速
wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py python speedtest.py D ...
- 8 Jvm堆分析
备注:直接内存分配,无法触发GC动作 备注:with outgoing reference (当前选中对象引用的对象),with incoming references(引用当前对象的对象)
- http https 干货
HTTPS原理 在谈HTTPS原理之前,首先了解一下Http和Https的区别. Http(全称:Hyper Text Transfer Protocol),一般称为超文本传输协议,也是互联 ...
- mysql 分组查询入门
- 吴裕雄--天生自然java开发常用类库学习笔记:同步与死锁
class MyThread implements Runnable{ private int ticket = 5 ; // 假设一共有5张票 public void run(){ for(int ...
- springboot#interceptor
_ 拦截器相对与过滤器Filter 而言,拦截器是spring中的概念.过滤器是servlet中的概念.在spring中肯定是优先使用拦截器Interceptor的. public class My1 ...
- 剑指offer_2.3_Day_6
大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0). n<=39 public class Solution { public int Fibo ...
- 实现Comparator 对List<?>进行排序
首选需要有个Entity类 ,里面有属性有方法 package demo; public class Entity { private String empNo ; private String em ...