Galera,Maraidb-端口4444始终重新启动,并且从属无法加入群集

时间:2019-01-08 16:15:43

标签: mariadb centos7 galera

我正在研究Mariadb Cluster,正在使用Centos 7 OS和Mariadb 10.1。

我正在尝试将节点加入集群,我启动了集群,我有2个节点。

这是第一个节点:

<link href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

然后我执行了:

binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://Node1.IP,Node2.IP"
## Galera Cluster Configuration
wsrep_cluster_name="cluster"
## Galera Synchronization Configuration
wsrep_sst_method=rsync
## Galera Node Configuration
wsrep_node_address="Node1.IP"
wsrep_node_name="node1"

这是第二个节点

galera_new_cluster

然后我执行了:

binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
bind-address=0.0.0.0
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://Node1.IP,Node2.IP"
## Galera Cluster Configuration
wsrep_cluster_name="cluster"
## Galera Synchronization Configuration
wsrep_sst_method=rsync
## Galera Node Configuration
wsrep_node_address="Node2.IP"
wsrep_node_name="node2"

在Node1 Mariadb中:

systemctl restart mariadb
Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

我在 Node1 lsof -i:4444 中找到了:

MariaDB [(none)]> SHOW STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 1     |
+--------------------+-------+

And Sometimes For seconds :

+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 2     |
+--------------------+-------+  

并且在 Node2 中,有时 lsof -i:4444

Does not return anything

有时

COMMAND  PID  USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
rsync   2101 mysql    5u  IPv4 5510482      0t0  TCP *:krb524 (LISTEN)
rsync   2101 mysql    6u  IPv6 5510483      0t0  TCP *:krb524 (LISTEN) 

Node1

Does not return anything

Node2

firewall-cmd --list-ports
3306/tcp 4567/tcp 4567/udp 4444/tcp 4444/udp 4568/tcp

Node1

firewall-cmd --list-ports
3306/tcp 4567/tcp 4567/udp 4444/tcp 4444/udp 4568/tcp

Node2

nmap Node2.IP
PORT     STATE  SERVICE
22/tcp   open   ssh
3306/tcp closed mysql
4444/tcp closed krb524
4567/tcp closed tram

我该如何解决?

感谢一百万:D

1 个答案:

答案 0 :(得分:0)

我可以解决。 Galera clucter永远不会从两个节点开始。您需要三个节点来启动galera集群。我指定了第三个节点后,群集启动就没有任何问题。