我有三个节点,它们都在群集中,工作正常,其中一个节点(node3)意外关闭(此VM崩溃)。
在node3中,我使用:
systemctl start mariadb.service
启动mariadb,但得到错误:
mariadb.service的作业失败,因为控制进程退出并显示错误代码。有关详细信息,请参阅“systemctl status mariadb.service”和“journalctl -xe”。
所以我使用systemctl status mariadb.service
来检查:
[root@ha-node3 ~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Tue 2017-07-25 00:33:23 CST; 3min 7s ago
Process: 6125 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 5861 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 5857 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 6125 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Jul 25 00:33:22 ha-node3 mysqld[6125]: at gcomm/src/pc.cpp:PC():271
Jul 25 00:33:22 ha-node3 mysqld[6125]: 2017-07-25 0:33:22 140428190394560 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to o...overable)
Jul 25 00:33:22 ha-node3 mysqld[6125]: 2017-07-25 0:33:22 140428190394560 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1380: Failed to open chann...overable)
Jul 25 00:33:22 ha-node3 mysqld[6125]: 2017-07-25 0:33:22 140428190394560 [ERROR] WSREP: gcs connect failed: State not recoverable
Jul 25 00:33:22 ha-node3 mysqld[6125]: 2017-07-25 0:33:22 140428190394560 [ERROR] WSREP: wsrep::connect(gcomm://192.168.8.101,192.168.8.102,19...failed: 7
Jul 25 00:33:22 ha-node3 mysqld[6125]: 2017-07-25 0:33:22 140428190394560 [ERROR] Aborting
Jul 25 00:33:23 ha-node3 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Jul 25 00:33:23 ha-node3 systemd[1]: Failed to start MariaDB database server.
Jul 25 00:33:23 ha-node3 systemd[1]: Unit mariadb.service entered failed state.
Jul 25 00:33:23 ha-node3 systemd[1]: mariadb.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
并使用journalctl -xe
检查:
[root@ha-node3 ~]# journalctl -xe
Jul 25 00:37:17 ha-node3 xinetd[1179]: START: mysqlchk pid=8544 from=::ffff:192.168.8.103
Jul 25 00:37:17 ha-node3 xinetd[1179]: EXIT: mysqlchk signal=13 pid=8544 duration=0(sec)
Jul 25 00:37:18 ha-node3 xinetd[1179]: START: mysqlchk pid=8548 from=::ffff:192.168.8.101
Jul 25 00:37:18 ha-node3 xinetd[1179]: START: mysqlchk pid=8553 from=::ffff:192.168.8.102
Jul 25 00:37:18 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8548 duration=0(sec)
Jul 25 00:37:18 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8553 duration=0(sec)
Jul 25 00:37:19 ha-node3 xinetd[1179]: START: mysqlchk pid=8560 from=::ffff:192.168.8.103
Jul 25 00:37:19 ha-node3 xinetd[1179]: EXIT: mysqlchk signal=13 pid=8560 duration=0(sec)
Jul 25 00:37:20 ha-node3 xinetd[1179]: START: mysqlchk pid=8564 from=::ffff:192.168.8.102
Jul 25 00:37:20 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8564 duration=0(sec)
Jul 25 00:37:20 ha-node3 xinetd[1179]: START: mysqlchk pid=8569 from=::ffff:192.168.8.101
Jul 25 00:37:20 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8569 duration=0(sec)
Jul 25 00:37:21 ha-node3 xinetd[1179]: START: mysqlchk pid=8574 from=::ffff:192.168.8.103
Jul 25 00:37:22 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8574 duration=1(sec)
Jul 25 00:37:22 ha-node3 xinetd[1179]: START: mysqlchk pid=8579 from=::ffff:192.168.8.102
Jul 25 00:37:22 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8579 duration=0(sec)
Jul 25 00:37:22 ha-node3 xinetd[1179]: START: mysqlchk pid=8584 from=::ffff:192.168.8.101
Jul 25 00:37:22 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8584 duration=0(sec)
Jul 25 00:37:24 ha-node3 xinetd[1179]: START: mysqlchk pid=8590 from=::ffff:192.168.8.103
Jul 25 00:37:24 ha-node3 xinetd[1179]: EXIT: mysqlchk signal=13 pid=8590 duration=0(sec)
Jul 25 00:37:24 ha-node3 xinetd[1179]: START: mysqlchk pid=8594 from=::ffff:192.168.8.102
Jul 25 00:37:24 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8594 duration=0(sec)
Jul 25 00:37:24 ha-node3 xinetd[1179]: START: mysqlchk pid=8599 from=::ffff:192.168.8.101
Jul 25 00:37:25 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8599 duration=1(sec)
Jul 25 00:37:26 ha-node3 xinetd[1179]: START: mysqlchk pid=8604 from=::ffff:192.168.8.103
Jul 25 00:37:26 ha-node3 xinetd[1179]: EXIT: mysqlchk signal=13 pid=8604 duration=0(sec)
Jul 25 00:37:26 ha-node3 xinetd[1179]: START: mysqlchk pid=8608 from=::ffff:192.168.8.102
Jul 25 00:37:26 ha-node3 xinetd[1179]: EXIT: mysqlchk status=1 pid=8608 duration=0(sec)
Jul 25 00:37:26 ha-node3 xinetd[1179]: START: mysqlchk pid=8613 from=::ffff:192.168.8.101
有人可以告诉我为什么它无法启动?
答案 0 :(得分:0)
最后,我发现/var/lib/mysql/gvwstate.dat
为空,来自此链接:https://community.emc.com/docs/DOC-55350
但我的解决方案不是那样,我重新启动VM(node3),并重建文件(gvwstate.dat
)。
所以,我现在可以开始使用mariadb了。