MariaDB Galera 集群-第三个节点无法启动/连接

MariaDB Galera 集群-第三个节点无法启动/连接

我正在尝试设置 MariaDB galera 集群。前 2 个节点运行良好,已启动并连接。

在第三个节点上,它将无法启动/连接。

# service mysql start
Starting mysql (via systemctl):  Job for mariadb.service failed because a timeout was exceeded. See "systemctl status mariadb.service" and "journalctl -xe" for details.
                                                           [FAILED]

journal-xe 输出:

Jan 19 09:16:07 host3.domain.com systemd[1]: mariadb.service start operation timed out. Terminating.
-- Subject: Unit session-c9591.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- The start-up result is done.

-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-c9591.scope has begun starting up.
Jan 19 09:17:01 host3.domain.com CROND[1018]: (root) CMD (/usr/local/rtm/bin/rtm 8 > /dev/null 2> /dev/null)
Jan 19 09:17:38 host3.domain.com systemd[1]: mariadb.service stop-final-sigterm timed out. Skipping SIGKILL. Entering failed mode.
Jan 19 09:17:38 host3.domain.com systemd[1]: Failed to start MariaDB 10.1.30 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mariadb.service has failed.
-- 
-- The result is failed.
Jan 19 09:17:38 host3.domain.com systemd[1]: Unit mariadb.service entered failed state.
Jan 19 09:17:38 host3.domain.com systemd[1]: mariadb.service failed.
Jan 19 09:17:38 host3.domain.com polkitd[383]: Unregistered Authentication Agent for unix-process:25848:56441890 (system bus name :1.19233, object path /org/freedesktop/PolicyKit1/Authentic
Jan 19 09:17:51 host3.domain.com mysqld[25932]: 2018-01-19  9:17:51 114327532205824 [Note] WSREP: (15573658, 'tcp://0.0.0.0:4567') connection to peer 00000000 with addr  timed out, no messa
Jan 19 09:18:01 host3.domain.com systemd[1]: Started Session c9592 of user root.
-- Subject: Unit session-c9592.scope has finished start-up
-- Defined-By: systemd

我不清楚它为什么会超时,为什么会连接到自身?我是否应该生成另一个可以提供更多线索的日志文件?我在系统日志中确认错误

[Note] WSREP: (15573658, 'tcp://0.0.0.0:4567') connection to peer 00000000 with addr  timed out, no messa

缺少的地址是内部私有IP。

答案1

对于我来说,解决方法很简单,就是拆除整个集群,然后重新启动。

在每个节点上:

服务 mysql 停止

在最先进的节点上

# galera_new_cluster

在每个后续节点上

服务 mysql 启动

验证方式:

MariaDB [(none)]> 显示全局状态如“%wsrep_cluster_size%”;

+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 3     |
+--------------------+-------+
1 row in set (0.00 sec)

相关内容