2016-05-13 477 views
1

我想在debian 8 jessie下工作MariaDB Galera 10.1。MariaDB gcomm后端连接失败110

我已经安装了所有必要的组件,并做了配置,但我无法得到它的工作。

节点被构建为VPS。

配置节点1:

[mysqld] 

# Cluster node configurations 
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112" 
wsrep_node_address="172.16.0.102" 
wsrep_node_name='n1' 
wsrep_cluster_name='cluster' 
innodb_buffer_pool_size=400M 
# Mandatory settings to enable Galera 
wsrep_provider=/usr/lib/galera/libgalera_smm.so 
binlog_format=ROW 
default-storage-engine=InnoDB 
innodb_autoinc_lock_mode=2 
innodb_doublewrite=1 
query_cache_size=0 
bind-address=0.0.0.0 
# Galera synchronisation configuration 
wsrep_sst_method=rsync 

节点2的配置:

[mysqld] 

# Cluster node configurations 
wsrep_cluster_address="gcomm://172.16.0.102,172.16.0.112" 
wsrep_node_address="172.16.0.112" 
wsrep_node_name='n2' 
wsrep_cluster_name='cluster' 
innodb_buffer_pool_size=400M 
# Mandatory settings to enable Galera 
wsrep_provider=/usr/lib/galera/libgalera_smm.so 
binlog_format=ROW 
default-storage-engine=InnoDB 
innodb_autoinc_lock_mode=2 
innodb_doublewrite=1 
query_cache_size=0 
bind-address=0.0.0.0 
# Galera synchronisation configuration 
wsrep_sst_method=rsync 

当我试图在节点1引导命令运行

service mysql bootstrap 

它失败了第i个错误的

May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out) 
May 13 15:59:28 test mysqld[2397]: at gcomm/src/pc.cpp:connect():162 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out) 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1379: Failed to open channel 'cluster' at 'gcomm://172.16.0.102,172.16.0.112': -110 (Connection timed out) 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: gcs connect failed: Connection timed out 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] WSREP: wsrep::connect(gcomm://172.16.0.102,172.16.0.112) failed: 7 
May 13 15:59:28 test mysqld[2397]: 2016-05-13 15:59:28 139843152635840 [ERROR] Aborting 

网络配置是私人我使用:

2X与ProxmoxVE 4.0安装专用服务器服务器在VRACK网络上VPS配置为:

节点1:172.16。 0.102 //节点1对服务器1

节点2:172.16.0.112 //节点2对服务器2

他们能够互相ping通的私法吃了网。

+0

你检查每个proxmox服务器实例的网络适配器的设置,有允许虚拟机到互相对话的设置。 – iGNEOS

+0

VMS不存在相互交谈的问题。我可以简单地使用专用网络从虚拟机执行ping或ssh连接。所以在这种情况下不是问题。 – Kamil

回答

6

我找到了解决方案和确切的问题。

问题在于启动群集节点。需要从MariaDB galera_new_cluster安装中包含的脚本开始,引导新集群,然后一切正常。

希望这会有助于别人在debian下通过配置。

+0

在你的命令中有一个错字是galera_new_cluster和一个l。 –

10

由于MariaDB 10.1.8,systemd是新的init,它影响Galera在基于RPM和Debian的Linux发行版(在我的情况下为Ubuntu 16.04)上引导的方式。在以前的版本中,你会使用类似service mysql start --wsrep-new-clusterservice mysqld bootstrap但因为它不能与不工作了:

[ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out) 

要解决此问题来看:

galera_new_cluster 

注意你只需要在'第一'服务器上运行此脚本。

为了测试它是否正在运行,mysql -u [your mysql user] -p输入mysql的,然后运行

SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size'; 

你应该看到:

+--------------+ 
| cluster size | 
+--------------+ 
| 1   | 
+--------------+ 

以防万一它是有用的人,这是我的my.conf(MariaDB 10.1.16)

[galera] 
# Mandatory settings 
wsrep_on=ON 
wsrep_provider=/usr/lib/galera/libgalera_smm.so 
wsrep_cluster_address="gcomm://[first ip],[second ip]" 
binlog_format=row 
default_storage_engine=InnoDB 
innodb_autoinc_lock_mode=2 

更多详细资料,请点击:

MariaDB systemd and galera_new_cluster

Galera Cluster System Variables

+0

任何想法可能导致在码头图像上发生此错误? – activatedgeek