2016-05-13 449 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