Galera Cluster for MySQL启动不了,一直不停的自动重启!
2017-08-26 18:58
1131 查看
现象:
服务不停的自动重启,查看进程,如下:
[root@CentOS data]# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@CentOS data]# ps aux|grep mysql
root 9386 0.0 0.0 113120 1488 ? Ss 14:55 0:00 /bin/bash /usr/bin/mysqld_pre_systemd --pre
mysql 9403 93.0 3.6 9669728 1202632 ?
Sl 14:55 0:00 /usr/sbin/mysqld --datadir=/data/mysql-data --user=mysql --wsrep_recover
root 9433 0.0 0.0 112664 972 pts/0 S+ 14:55 0:00 grep --color=auto mysql
[root@CentOS data]#
日志中会有[Warning] WSREP: Read non-wsrep XID from storage engines.内容?
原因:
你可能修改了MySQL的log-error参数,MySQL5.7版本官网说错误日志的变量为log_error(改成下划线)
因为,systemctl start mysqld.service调用的脚本ExecStartPre=/usr/bin/mysqld_pre_systemd --pre中已固定写死为log-error名,否则他还是取的默认日志路径名(/var/log/mysql.log)而这个文件永远为空,所以服务不能重启成功!!!
这个语句:log=$(get_option mysqld log-error "/var/log/mysql${instance:+-$instance}.log" $instance)
而这个ExecStartPre=/usr/bin/mysqld_pre_systemd --pre语句的作用就是提取你上次离开的同步位置,再次启动时会以此位置再次同步数据
如果是首次创建节点,Galera Cluster会向日志文件中输出如下内容:
2017-08-26T06:55:04.456278Z 0 [Note] InnoDB: File './ibtmp1'
size is now 12 MB.
2017-08-26T06:55:04.458452Z 0 [Note] InnoDB: 96 redo rollback
segment(s) found. 96 redo rollback segment(s) are active.
2017-08-26T06:55:04.458484Z 0 [Note] InnoDB: 32 non-redo
rollback segment(s) are active.
2017-08-26T06:55:04.459012Z 0 [Note] InnoDB: Waiting for
purge to start
2017-08-26T06:55:04.509259Z 0 [Note] InnoDB: 5.7.18 started;
log sequence number 1317084
2017-08-26T06:55:04.510537Z 0 [Note] Plugin 'FEDERATED'
is disabled.
2017-08-26T06:55:04.591685Z 0 [Note] WSREP:
Recovered position: 00000000-0000-0000-0000-000000000000:-1
2017-08-26T06:55:04.591737Z 0 [Note] Binlog end
2017-08-26T06:55:04.593055Z 0 [Note] Shutting down plugin
'validate_password'
2017-08-26T06:55:04.593117Z 0 [Note] Shutting down plugin
'ngram'
2017-08-26T06:55:04.593127Z 0 [Note] Shutting down plugin
'ARCHIVE'
2017-08-26T06:55:04.593134Z 0 [Note] Shutting down plugin
'BLACKHOLE'
2017-08-26T06:55:04.593143Z 0 [Note] Shutting down plugin
'partition'
其中WSREP: Recovered position: 00000000-0000-0000-0000-000000000000:-1就是表示新创建的节点,而mysqld_pre_systemd脚本就会提取最后的位置信息(他会搜索WSREP:
Recovered position这个关键字内容[grep 然后再tail -n 1])
解决办法:
变量名必须为:log-error
服务不停的自动重启,查看进程,如下:
[root@CentOS data]# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@CentOS data]# ps aux|grep mysql
root 9386 0.0 0.0 113120 1488 ? Ss 14:55 0:00 /bin/bash /usr/bin/mysqld_pre_systemd --pre
mysql 9403 93.0 3.6 9669728 1202632 ?
Sl 14:55 0:00 /usr/sbin/mysqld --datadir=/data/mysql-data --user=mysql --wsrep_recover
root 9433 0.0 0.0 112664 972 pts/0 S+ 14:55 0:00 grep --color=auto mysql
[root@CentOS data]#
日志中会有[Warning] WSREP: Read non-wsrep XID from storage engines.内容?
原因:
你可能修改了MySQL的log-error参数,MySQL5.7版本官网说错误日志的变量为log_error(改成下划线)
因为,systemctl start mysqld.service调用的脚本ExecStartPre=/usr/bin/mysqld_pre_systemd --pre中已固定写死为log-error名,否则他还是取的默认日志路径名(/var/log/mysql.log)而这个文件永远为空,所以服务不能重启成功!!!
这个语句:log=$(get_option mysqld log-error "/var/log/mysql${instance:+-$instance}.log" $instance)
而这个ExecStartPre=/usr/bin/mysqld_pre_systemd --pre语句的作用就是提取你上次离开的同步位置,再次启动时会以此位置再次同步数据
如果是首次创建节点,Galera Cluster会向日志文件中输出如下内容:
2017-08-26T06:55:04.456278Z 0 [Note] InnoDB: File './ibtmp1'
size is now 12 MB.
2017-08-26T06:55:04.458452Z 0 [Note] InnoDB: 96 redo rollback
segment(s) found. 96 redo rollback segment(s) are active.
2017-08-26T06:55:04.458484Z 0 [Note] InnoDB: 32 non-redo
rollback segment(s) are active.
2017-08-26T06:55:04.459012Z 0 [Note] InnoDB: Waiting for
purge to start
2017-08-26T06:55:04.509259Z 0 [Note] InnoDB: 5.7.18 started;
log sequence number 1317084
2017-08-26T06:55:04.510537Z 0 [Note] Plugin 'FEDERATED'
is disabled.
2017-08-26T06:55:04.591685Z 0 [Note] WSREP:
Recovered position: 00000000-0000-0000-0000-000000000000:-1
2017-08-26T06:55:04.591737Z 0 [Note] Binlog end
2017-08-26T06:55:04.593055Z 0 [Note] Shutting down plugin
'validate_password'
2017-08-26T06:55:04.593117Z 0 [Note] Shutting down plugin
'ngram'
2017-08-26T06:55:04.593127Z 0 [Note] Shutting down plugin
'ARCHIVE'
2017-08-26T06:55:04.593134Z 0 [Note] Shutting down plugin
'BLACKHOLE'
2017-08-26T06:55:04.593143Z 0 [Note] Shutting down plugin
'partition'
其中WSREP: Recovered position: 00000000-0000-0000-0000-000000000000:-1就是表示新创建的节点,而mysqld_pre_systemd脚本就会提取最后的位置信息(他会搜索WSREP:
Recovered position这个关键字内容[grep 然后再tail -n 1])
解决办法:
变量名必须为:log-error
相关文章推荐
- MySQL-Cluster重启时两个数据节点启动速度慢,耗费时间特别长的问题
- Galera Cluster for MySQL
- CentOS 6下安装部署Galera Cluster for MySQL集群
- [置顶] Galera Cluster for MySQL 集群备忘(Centos7)
- nginx as Database Load Balancer for MySQL or MariaDB Galera Cluster
- OpenStack HA集群1-Galera Cluster for Mysql
- mysql无法启动问题的解决方案:mysql.sock重启不自动生成,mysqld_safe启动报错
- Galera Cluster for MySQL
- Ubuntu 下 Galera cluster for MySQL 集群安装
- checking for updated SDK components (AndroidStudio第一次启动一直进不去)
- Percona galera cluster配置(mysql集群cluster同步)
- xampp for mac mysql 启动不了的解决办法
- docker:mysql启动时自动执行初始建表脚本
- mysql设置为启动后非自动提交
- mysql故障:重启mysql后启动报错
- Centos 7 下 Mysql 5.7 Galera Cluster 集群部署
- node.js零基础详细教程(7.5):mongo可视化工具webstorm插件、nodejs自动重启模块Node Supervisor(修改nodejs后不用再手动命令行启动服务了)
- 【开机自启】Linux下设置MySql自动启动
- Ubuntu启动、停止、重启MySQL,查看MySQL错误日志、中文编码错误
- mysql启动与关闭(手动与自动)