Reputation: 1232
I follow this instruction
https://tunnelix.com/mariadb-galera-cluster-installation/
for installing MariaDB 10.1 Galera Cluster on CentOS 7.
The following is my galera configuration in /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
For testing purposes, I disabled SELinux and FirewallD. When I bring up the first node with galera_new_cluster I could only see only port 3306 is listening
[root@localhost ~]# netstat -ntpl | grep sql
tcp6 0 0 :::3306 :::* LISTEN 28673/mysqld
Whereas, supposedly I should have port 4567 listening too for the clustering, as shown in the example (see image below):
The following is the startup log content:
[root@localhost ~]# 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.
And checking the wsrep status:
[root@localhost ~]# 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 |
+--------------------------+----------------------+
Upvotes: 2
Views: 1337
Reputation: 100
starting first node of Galera cluster must be like this
service mysql start --wsrep-new-cluster
Upvotes: 0