How To : Setup MariaDB 10.1 3 Node cluster

Currently i’m on the process of choosing the matured product like galera clustering vs the new MySQL Group Replication.

I’m my past engagement, i only work on MariaDB 5.5 and 5.6 with galera cluster running on cloud.

The following are the step to create my test machine.

1. Download the MariaDB installer from MariaDB.com 
2. Now let’s untar the installer for all 3 nodes.

[admin@lnxmrdbclstr01 tmp]$ ls -lrt | grep maria
-rw-r--r--. 1 admin admin 168417280 Jan 21 02:51 mariadb-10.1.21-rhel-7-x86_64-rpms.tar
[admin@lnxmrdbclstr01 tmp]$

[admin@lnxmrdbclstr02 tmp]$ ls -lrt | grep maria
-rw-r--r--. 1 admin admin 168417280 Jan 21 02:53 mariadb-10.1.21-rhel-7-x86_64-rpms.tar
[admin@lnxmrdbclstr02 tmp]$

[admin@lnxmrdbclstr03 tmp]$ ls -lrt | grep maria
-rw-r--r--. 1 admin admin 168417280 Jan 21 02:57 mariadb-10.1.21-rhel-7-x86_64-rpms.tar
[admin@lnxmrdbclstr03 tmp]$

Now let’s untar the install in all 3 servers.

[admin@lnxmrdbclstr01 tmp]$ tar -xvf mariadb-10.1.21-rhel-7-x86_64-rpms.tar
mariadb-10.1.21-rhel-7-x86_64-rpms/
mariadb-10.1.21-rhel-7-x86_64-rpms/jemalloc-3.6.0-1.el7.x86_64.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-gssapi-client.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-connect-engine.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-common.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-devel.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-gssapi-server.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-server.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-client.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-shared.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/repomd.xml
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/db96d8307b39a251bda31c23cc1dc6063c4d4855d878d8115dde4cb517ee477a-other.sqlite.bz2
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/e69259d14d8b62be14103e45d6ceae2185c6eae368e4ce38b266a61053fbb322-primary.xml.gz
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/0f772e894eec41bc474c7f4536c15e999494fe28238e12d45b591f074182c1a7-filelists.xml.gz
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/a265d969e9d59632047f2f27cc346c722cf918497b89e1396e7da80d0eff9486-primary.sqlite.bz2
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/e6e726132f2d4692de94a5c831453629d55a7d6d8b7ae163836279c8c23ce3d8-other.xml.gz
mariadb-10.1.21-rhel-7-x86_64-rpms/repodata/b612cd8584a78ba5d7304b87f7ade5d50cbff23041b7134fa240384dcbbba769-filelists.sqlite.bz2
mariadb-10.1.21-rhel-7-x86_64-rpms/jemalloc-devel-3.6.0-1.el7.x86_64.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/setup_repository
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-compat.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/README
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-cracklib-password-check.rpm
mariadb-10.1.21-rhel-7-x86_64-rpms/MariaDB-10.1.21-centos7-x86_64-oqgraph-engine.rpm
[admin@lnxmrdbclstr01 tmp]$

Now let’s install the mariadb binaries. should be done on 3 nodes

[admin@lnxmrdbclstr01 tmp]$ cd mariadb-10.1.21-rhel-7-x86_64-rpms
[admin@lnxmrdbclstr01 mariadb-10.1.21-rhel-7-x86_64-rpms]$ sudo rpm -ivh MariaDB-10.1.21-centos7-x86_64-server.rpm galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm MariaDB-10.1.21-centos7-x86_64-client.rpm MariaDB-10.1.21-centos7-x86_64-common.rpm
warning: MariaDB-10.1.21-centos7-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-common-10.1.21-1.el7.cent################################# [ 25%]
   2:MariaDB-client-10.1.21-1.el7.cent################################# [ 50%]
   3:galera-25.3.19-1.rhel7.el7.centos################################# [ 75%]
   4:MariaDB-server-10.1.21-1.el7.cent################################# [100%]
chown: invalid user: ‘mysql’
2017-01-21  3:29:41 139700503423232 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as process 10370 ...
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: The InnoDB memory heap is disabled
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Compressed tables use zlib 1.2.7
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Using Linux native AIO
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Using SSE crc32 instructions
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Completed initialization of buffer pool
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Database physically writes the file full: wait...
2017-01-21  3:29:42 139700503423232 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2017-01-21  3:29:43 139700503423232 [Warning] InnoDB: New log files created, LSN=45883
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Doublewrite buffer not found: creating new
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Doublewrite buffer created
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: 128 rollback segment(s) are active.
2017-01-21  3:29:43 139700503423232 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Foreign key constraint system tables created
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Creating tablespace and datafile system tables.
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Tablespace and datafile system tables created.
2017-01-21  3:29:43 139700503423232 [Note] InnoDB: Waiting for purge to start
2017-01-21  3:29:43 139700503423232 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 0
2017-01-21  3:29:43 139699775571712 [Note] InnoDB: Dumping buffer pool(s) not yet started
2017-01-21  3:29:46 140327411222784 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as process 10401 ...
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: The InnoDB memory heap is disabled
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Compressed tables use zlib 1.2.7
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Using Linux native AIO
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Using SSE crc32 instructions
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Completed initialization of buffer pool
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Highest supported file format is Barracuda.
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: 128 rollback segment(s) are active.
2017-01-21  3:29:46 140327411222784 [Note] InnoDB: Waiting for purge to start
2017-01-21  3:29:46 140327411222784 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 1616799
2017-01-21  3:29:46 140326681413376 [Note] InnoDB: Dumping buffer pool(s) not yet started
2017-01-21  3:29:49 139896990447872 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as process 10431 ...
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: The InnoDB memory heap is disabled
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Compressed tables use zlib 1.2.7
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Using Linux native AIO
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Using SSE crc32 instructions
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Completed initialization of buffer pool
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Highest supported file format is Barracuda.
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: 128 rollback segment(s) are active.
2017-01-21  3:29:49 139896990447872 [Note] InnoDB: Waiting for purge to start
2017-01-21  3:29:49 139896990447872 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 1616809
2017-01-21  3:29:49 139896261936896 [Note] InnoDB: Dumping buffer pool(s) not yet started

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h lnxmrdbclstr01.bai.com password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

[admin@lnxmrdbclstr01 mariadb-10.1.21-rhel-7-x86_64-rpms]$

Now let’s start the mysql and perform post installs task.

[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$ sudo service mysqld start
Redirecting to /bin/systemctl start  mysqld.service
[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$ ps -ef | grep mysql
mysql     4391     1  2 03:44 ?        00:00:00 /usr/sbin/mysqld
admin     4424  2826  0 03:44 pts/0    00:00:00 grep --color=auto mysql
[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$ /usr/bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$

Verify your installation by logging in to all 3 servers.

[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.1.21-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
[admin@lnxmrdbclstr03 mariadb-10.1.21-rhel-7-x86_64-rpms]$

[admin@lnxmrdbclstr02 mariadb-10.1.21-rhel-7-x86_64-rpms]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.1.21-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
[admin@lnxmrdbclstr02 mariadb-10.1.21-rhel-7-x86_64-rpms]$

[admin@lnxmrdbclstr01 mariadb-10.1.21-rhel-7-x86_64-rpms]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.1.21-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye
[admin@lnxmrdbclstr01 mariadb-10.1.21-rhel-7-x86_64-rpms]$


On all my 3 noded, added below on my my.cnf

# galera
[galera]

default_storage_engine         = InnoDB                           
innodb_flush_log_at_trx_commit = 2                                
innodb_autoinc_lock_mode       = 2                                
binlog_format                  = row                              
query_cache_type               = 0                                
query_cache_size               = 0
bind-address=0.0.0.0

# WSREP parameter
wsrep_on                       = ON
wsrep_provider                 = /usr/lib64/galera/libgalera_smm.so    
wsrep_provider_options         = 'gcache.size = 300M'                  

wsrep_cluster_name             = "Bai Cluster"                       
wsrep_cluster_address          = "gcomm://192.168.56.101,192.168.56.102,192.168.56.103"  

wsrep_node_name                = lnxmrdbclstr01        #should correspond to the current node.      
wsrep_node_address             = 192.168.56.101        #      

wsrep_sync_wait                = 1                           
wsrep_slave_threads            = 4                           

wsrep_sst_method               = xtrabackup-v2               
wsrep_sst_auth                 = bkuser:bkuser               
          

Let’s bootstrap our cluster, shutdown all nodes now.

[admin@lnxmrdbclstr01 ~]$ sudo service mysql stop
[sudo] password for admin:
Stopping mysql (via systemctl):                            [  OK  ]
[admin@lnxmrdbclstr01 ~]$

[admin@lnxmrdbclstr02 ~]$ sudo service mysql stop
[sudo] password for admin:
Stopping mysql (via systemctl):                            [  OK  ]
[admin@lnxmrdbclstr02 ~]$

[admin@lnxmrdbclstr03 ~]$ sudo service mysql stop
[sudo] password for admin:
Stopping mysql (via systemctl):                            [  OK  ]
[admin@lnxmrdbclstr03 ~]$
                     

Bootstrap the cluster on node 1

[admin@lnxmrdbclstr01 ~]$ sudo galera_new_cluster
[admin@lnxmrdbclstr01 ~]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.1.21-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show status like 'wsrep_incoming%';
+--------------------------+---------------------+
| Variable_name            | Value               |
+--------------------------+---------------------+
| wsrep_incoming_addresses | 192.168.56.101:3306 |
+--------------------------+---------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> show status like 'wsrep_cluster%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 1                                    |
| wsrep_cluster_size       | 1                                    |
| wsrep_cluster_state_uuid | 360f83e8-e072-11e6-8260-d23774939f66 |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]>

On other nodes, normally start the mysql process.

Here is the logs from one of my node while joining the cluster.

2017-01-22  5:19:37 140526762325760 [Note] WSREP: (04bbdddb, 'tcp://0.0.0.0:4567') connection established to 46f57b77 tcp://192.168.56.103:4567
2017-01-22  5:19:37 140526762325760 [Note] WSREP: (04bbdddb, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers:
2017-01-22  5:19:37 140526762325760 [Note] WSREP: declaring 46f57b77 at tcp://192.168.56.103:4567 stable
2017-01-22  5:19:37 140526762325760 [Note] WSREP: declaring 8597c313 at tcp://192.168.56.102:4567 stable
2017-01-22  5:19:37 140526762325760 [Note] WSREP: Node 04bbdddb state prim
2017-01-22  5:19:37 140526762325760 [Note] WSREP: view(view_id(PRIM,04bbdddb,53) memb {
     04bbdddb,0
     46f57b77,0
     8597c313,0
} joined {
} left {
} partitioned {
})
2017-01-22  5:19:37 140526762325760 [Note] WSREP: save pc into disk
2017-01-22  5:19:37 140526753933056 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 0, memb_num = 3
2017-01-22  5:19:37 140526753933056 [Note] WSREP: STATE_EXCHANGE: sent state UUID: 4748f20c-e08c-11e6-ab21-579b48f06ac3
2017-01-22  5:19:37 140526753933056 [Note] WSREP: STATE EXCHANGE: sent state msg: 4748f20c-e08c-11e6-ab21-579b48f06ac3
2017-01-22  5:19:37 140526753933056 [Note] WSREP: STATE EXCHANGE: got state msg: 4748f20c-e08c-11e6-ab21-579b48f06ac3 from 0 (lnxmrdbclstr01)
2017-01-22  5:19:37 140526753933056 [Note] WSREP: STATE EXCHANGE: got state msg: 4748f20c-e08c-11e6-ab21-579b48f06ac3 from 2 (lnxmrdbclstr02)
2017-01-22  5:19:38 140526753933056 [Note] WSREP: STATE EXCHANGE: got state msg: 4748f20c-e08c-11e6-ab21-579b48f06ac3 from 1 (lnxmrdbclstr03)
2017-01-22  5:19:38 140526753933056 [Note] WSREP: Quorum results:
     version    = 4,
     component  = PRIMARY,
     conf_id    = 52,
     members    = 2/3 (joined/total),
     act_id     = 26,
     last_appl. = 0,
     protocols  = 0/7/3 (gcs/repl/appl),
     group UUID = 360f83e8-e072-11e6-8260-d23774939f66
2017-01-22  5:19:38 140526753933056 [Note] WSREP: Flow-control interval: [28, 28]
2017-01-22  5:19:38 140527149243136 [Note] WSREP: New cluster view: global state: 360f83e8-e072-11e6-8260-d23774939f66:26, view# 53: Primary, number of nodes: 3, my index: 0, protocol version 3
2017-01-22  5:19:38 140527149243136 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
2017-01-22  5:19:38 140527149243136 [Note] WSREP: REPL Protocols: 7 (3, 2)
2017-01-22  5:19:38 140527149243136 [Note] WSREP: Assign initial position for certification: 26, protocol version: 3
2017-01-22  5:19:38 140526812235520 [Note] WSREP: Service thread queue flushed.
2017-01-22  5:19:38 140526753933056 [Note] WSREP: Member 1.0 (lnxmrdbclstr03) requested state transfer from '*any*'. Selected 0.0 (lnxmrdbclstr01)(SYNCED) as donor.
2017-01-22  5:19:38 140526753933056 [Note] WSREP: Shifting SYNCED -> DONOR/DESYNCED (TO: 26)
2017-01-22  5:19:38 140527149243136 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
2017-01-22  5:19:38 140525524899584 [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'donor' --address '192.168.56.103:4444/xtrabackup_sst//1' --socket '/mariadb_config/mysqld.sock' --datadir '/mariadb_data/'    --binlog '/mariadb_binlog/binlog' --gtid '360f83e8-e072-11e6-8260-d23774939f66:26' --gtid-domain-id '0''
2017-01-22  5:19:38 140527149243136 [Note] WSREP: sst_donor_thread signaled with 0
WSREP_SST: [INFO] Streaming with xbstream (20170122 05:19:38.897)
WSREP_SST: [INFO] Using socat as streamer (20170122 05:19:38.898)
WSREP_SST: [INFO] Using /tmp/tmp.OWZ5eSooyE as innobackupex temporary directory (20170122 05:19:38.908)
WSREP_SST: [INFO] Streaming GTID file before SST (20170122 05:19:38.913)
WSREP_SST: [INFO] Evaluating xbstream -c ${INFO_FILE} | socat -u stdio TCP:192.168.56.103:4444; RC=( ${PIPESTATUS[@]} ) (20170122 05:19:38.914)
WSREP_SST: [INFO] Sleeping before data transfer for SST (20170122 05:19:38.921)
2017-01-22  5:19:40 140526762325760 [Note] WSREP: (04bbdddb, 'tcp://0.0.0.0:4567') turning message relay requesting off
WSREP_SST: [INFO] Streaming the backup to joiner at 192.168.56.103 4444 (20170122 05:19:48.928)
WSREP_SST: [INFO] Evaluating innobackupex   --no-version-check  $tmpopts $INNOEXTRA --galera-info --stream=$sfmt $itmpdir 2>${DATA}/innobackup.backup.log | socat -u stdio TCP:192.168.56.103:4444; RC=( ${PIPESTATUS[@]} ) (20170122 05:19:48.936)
2017-01-22  5:19:50 140527148636928 [Note] WSREP: Provider paused at 360f83e8-e072-11e6-8260-d23774939f66:26 (153)
2017-01-22  5:19:50 140527148636928 [Note] WSREP: resuming provider at 153
2017-01-22  5:19:50 140527148636928 [Note] WSREP: Provider resumed.
2017-01-22  5:19:50 140526753933056 [Note] WSREP: 0.0 (lnxmrdbclstr01): State transfer to 1.0 (lnxmrdbclstr03) complete.
2017-01-22  5:19:50 140526753933056 [Note] WSREP: Shifting DONOR/DESYNCED -> JOINED (TO: 26)
2017-01-22  5:19:50 140526753933056 [Note] WSREP: Member 0.0 (lnxmrdbclstr01) synced with group.
2017-01-22  5:19:50 140526753933056 [Note] WSREP: Shifting JOINED -> SYNCED (TO: 26)
2017-01-22  5:19:50 140527228033792 [Note] WSREP: Synchronized with group, ready for connections
2017-01-22  5:19:50 140527228033792 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
WSREP_SST: [INFO] Total time on donor: 0 seconds (20170122 05:19:50.509)
WSREP_SST: [INFO] Cleaning up temporary directories (20170122 05:19:50.520)
2017-01-22  5:19:54 140526753933056 [Note] WSREP: 1.0 (lnxmrdbclstr03): State transfer from 0.0 (lnxmrdbclstr01) complete.
2017-01-22  5:19:54 140526753933056 [Note] WSREP: Member 1.0 (lnxmrdbclstr03) synced with group.

While starting other nodes, monitor you cluster.

MariaDB [(none)]> show status like 'wsrep_cluster%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 2                                    |
| wsrep_cluster_size       | 2                                    |
| wsrep_cluster_state_uuid | 360f83e8-e072-11e6-8260-d23774939f66 |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> show status like 'wsrep_incoming%';
+--------------------------+-----------------------------------------+
| Variable_name            | Value                                   |
+--------------------------+-----------------------------------------+
| wsrep_incoming_addresses | 192.168.56.101:3306,192.168.56.102:3306 |
+--------------------------+-----------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> show status like 'wsrep_incoming%';
+--------------------------+-------------------------------------------------------------+
| Variable_name            | Value                                                       |
+--------------------------+-------------------------------------------------------------+
| wsrep_incoming_addresses | 192.168.56.101:3306,192.168.56.102:3306,192.168.56.103:3306 |
+--------------------------+-------------------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]>

MariaDB [(none)]> show status like 'wsrep_cluster%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 3                                    |
| wsrep_cluster_size       | 3                                    |
| wsrep_cluster_state_uuid | 360f83e8-e072-11e6-8260-d23774939f66 |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> show status like 'wsrep_incoming%';
+--------------------------+-------------------------------------------------------------+
| Variable_name            | Value                                                       |
+--------------------------+-------------------------------------------------------------+
| wsrep_incoming_addresses | 192.168.56.101:3306,192.168.56.102:3306,192.168.56.103:3306 |
+--------------------------+-------------------------------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]>

Right now our cluster is ready for testing… next i will install MaxScale.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s