2017-07-14 121 views
1

我遵循這個指令無法自舉MariaDB的10.1加萊拉集羣在CentOS 7

https://tunnelix.com/mariadb-galera-cluster-installation/

用於在CentOS 7

下安裝MariaDB的10.1加萊拉集羣是/etc/my.cnf.d/server.cnf

我加萊拉配置
[galera] 
# Mandatory settings 
wsrep_on=ON 
wsrep_provider=/usr/lib64/galera/libgalera_smm.so 
wsrep_cluster_address='gcomm://192.168.0.42,192.168.0.43' 
wsrep_cluster_name='galera' 
wsrep_node_address='192.168.0.42' 
wsrep_node_name='galera1' 
wsrep_sst_method=rsync 
binlog_format=row 
default_storage_engine=InnoDB 
innodb_autoinc_lock_mode=2 
bind-address=0.0.0.0 

出於測試目的,我禁用了SELinux和FirewallD。當我把了galera_new_cluster第一點,我只能看到只有3306端口監聽

[[email protected] ~]# netstat -ntpl | grep sql 
tcp6  0  0 :::3306     :::*     LISTEN  28673/mysqld 

然而,按說我應該有端口4567監聽過的集羣,如圖所示的例子(見下圖): enter image description here

以下是啓動日誌內容:

[[email protected] ~]# systemctl status mysql.service 
● mariadb.service - MariaDB database server 
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) 
    Drop-In: /etc/systemd/system/mariadb.service.d 
      └─migrated-from-my.cnf-settings.conf 
    Active: active (running) since Fri 2017-07-14 20:44:20 +08; 8min ago 
    Process: 28777 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) 
    Process: 28736 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) 
    Process: 28734 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) 
Main PID: 28749 (mysqld) 
    Status: "Taking your SQL requests now..." 
    CGroup: /system.slice/mariadb.service 
      └─28749 /usr/sbin/mysqld --wsrep-new-cluster 

Jul 14 20:44:19 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:19 140558527281408 [Note] InnoDB: Highest supported file format is Barracuda. 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] InnoDB: 128 rollback segment(s) are active. 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] InnoDB: Waiting for purge to start 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.36-82.0 started; log sequ...ber 1617718 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140557741455104 [Note] InnoDB: Dumping buffer pool(s) not yet started 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] Plugin 'FEEDBACK' is disabled. 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] Server socket created on IP: '::'. 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: 2017-07-14 20:44:20 140558527281408 [Note] /usr/sbin/mysqld: ready for connections. 
Jul 14 20:44:20 localhost.localdomain mysqld[28749]: Version: '10.1.25-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server 
Jul 14 20:44:20 localhost.localdomain systemd[1]: Started MariaDB database server. 
Hint: Some lines were ellipsized, use -l to show in full. 

和檢查wsrep狀態:

[[email protected] ~]# mysql -u root -pMyPassword --execute="SHOW STATUS LIKE 'wsrep%';" 
+--------------------------+----------------------+ 
| Variable_name   | Value    | 
+--------------------------+----------------------+ 
| wsrep_cluster_conf_id | 18446744073709551615 | 
| wsrep_cluster_size  | 0     | 
| wsrep_cluster_state_uuid |      | 
| wsrep_cluster_status  | Disconnected   | 
| wsrep_connected   | OFF     | 
| wsrep_local_bf_aborts | 0     | 
| wsrep_local_index  | 18446744073709551615 | 
| wsrep_provider_name  |      | 
| wsrep_provider_vendor |      | 
| wsrep_provider_version |      | 
| wsrep_ready    | OFF     | 
| wsrep_thread_count  | 0     | 
+--------------------------+----------------------+ 

回答

0

開始加萊拉簇的第一個節點必須是這樣

服務的MySQL啓動--wsrep新集羣

+0

由於這個10.1經由galera_new_cluster做 – PascalTurbo