简体   繁体   English

mariadb 10.1.13 galera 集群:错误

[英]mariadb 10.1.13 galera cluster : error

mariadb 10.1.x galera cluster setting. mariadb 10.1.x galera 集群设置。

first node 192.168.159.132第一个节点 192.168.159.132

/etc/mysql/my.cnf /etc/mysql/my.cnf

[galera]
# Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.159.132,192.168.159.135,192.168.159.136
binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2

first node 192.168.159.132第一个节点 192.168.159.132

$ sudo service mysql bootstrap $ sudo 服务 mysql 引导程序

* Bootstrapping the cluster mysqld
Starting mysql (via systemctl): mysql.service
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

$ systemctl status mariadb.service $ systemctl status mariadb.service

[ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
[ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1379: Failed to open channel 'my_wsrep_cluster' at 'gcomm://192.168.32.251,192.168.32.252,192.168.32...ection timed out)
[ERROR] WSREP: gcs connect failed: Connection timed out
[ERROR] WSREP: wsrep::connect(gcomm://192.168.32.251,192.168.32.252,192.168.32.253) failed: 7
[ERROR] Aborting
systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start MariaDB database server.
systemd[1]: mariadb.service: Unit entered failed state.
systemd[1]: mariadb.service: Failed with result 'exit-code'.

Why "Galera Cluster" not Start?为什么“Galera Cluster”没有启动?

How To checking "Connection Time Out"?如何检查“连接超时”?

There is a Error in your config.您的配置中有错误。 After gcom you only use one : like:gcom之后,您只使用一个:像:

wsrep_cluster_address=gcomm://192.168.159.132,192.168.159.135,192.168.159.136

their is an error:他们是一个错误:

use format as below:使用格式如下:

wsrep_cluster_address="gcomm://first_ip,second_ip,third_ip"

The galera configuration looks fine. galera 配置看起来不错。 But you have to provide an extra argument while bootstrapping the first node.但是您必须在引导第一个节点时提供一个额外的参数。 Try this:试试这个:

mysqld --wsrep-new-cluster

For the first node wsrep_cluster_address can be empty.对于第一个节点wsrep_cluster_address可以为空。 For next nodes you have to provide at least one ip address that is already a part of cluster.对于下一个节点,您必须至少提供一个已经是集群一部分的 IP 地址。 But it's a good practice to provide the list of all the nodes that you are going to use.但是提供您要使用的所有节点的列表是一个很好的做法。 It wont give you any error for mentioning a node in cluster-address which is not present in the cluster yet.在集群地址中提及集群中尚不存在的节点时,它不会给您任何错误。 So you can use, wsrep_cluster_address=gcomm://192.168.159.132,192.168.159.135,192.168.159.136 for every node.所以你可以为每个节点使用wsrep_cluster_address=gcomm://192.168.159.132,192.168.159.135,192.168.159.136

You are getting "connection timed out" because the node is trying to connect to the other nodes listed in wsrep_cluster_address, which aren't online as this is the very first node in the cluster.您收到“连接超时”,因为该节点正尝试连接到 wsrep_cluster_address 中列出的其他节点,这些节点不在线,因为这是集群中的第一个节点。 So, during bootstrap you should start the first node with empty wsrep_cluster_address :.因此,在引导期间,您应该使用空 wsrep_cluster_address : 启动第一个节点。 wsrep_cluster_address='gcomm://' . wsrep_cluster_address='gcomm://'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM