Comments on How To Install MariaDB Galera Cluster on Ubuntu 16.04

MariaDB Galera is a multi-master cluster for MariaDB. In this tutorial, we will explain how to setup MariaDB Galera Cluster 10.1 with 3 nodes running on Ubuntu 16.04 server. We will also test database replication between all the nodes.

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Maher Elaissi

Hi, I followed the tutorial but when I execute the command "galera_new_cluster" it says:

galera_new_cluster: command not found

any Idea ?

By: Gerald Brown

I am following this tutorial to install Galera on Mariadb 10.3.5 and I get the following error:

"mariadb.service - MariaDB 10.3.5 database server   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)  Drop-In: /etc/systemd/system/mariadb.service.d           ??migrated-from-my.cnf-settings.conf   Active: failed (Result: exit-code) since Sun 2018-03-18 18:32:57 +08; 11s ago     Docs: man:mysqld(8)           https://mariadb.com/kb/en/library/systemd/  Process: 2567 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)  Process: 2562 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)  Process: 1714 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)  Process: 4426 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=1/FAILURE)  Process: 4408 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)  Process: 4397 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Main PID: 1714 (code=exited, status=0/SUCCESS)Mar 18 18:32:55 gsb-mint systemd[1]: Starting MariaDB 10.3.5 database server...Mar 18 18:32:57 gsb-mint mysqld[4426]: WSREP: Failed to start mysqld for wsrep recovery: '2018-03-18 18:32:55 0 [Note] /usr/sbin/mysqld (mysqld 10.3.5-MariaDB-10.3.5+maria~xenial-log) starting as process 4623 ...Mar 18 18:32:57 gsb-mint mysqld[4426]: 2018-03-18 18:32:55 0 [Note] InnoDB: For Galera, using innodb_lock_schedule_algorithm=fcfsMar 18 18:32:57 gsb-mint mysqld[4426]: 2018-03-18 18:32:55 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtinsMar 18 18:32:57 gsb-mint mysqld[4426]: 2018-03-18 18:32:55 0 [Note] InnoDB: Uses event mutexesMar 18 18:32:57 gsb-mint systemd[1]: mariadb.service: Control process exited, code=exited status=1Mar 18 18:32:57 gsb-mint systemd[1]: Failed to start MariaDB 10.3.5 database server.Mar 18 18:32:57 gsb-mint systemd[1]: mariadb.service: Unit entered failed state.Mar 18 18:32:57 gsb-mint systemd[1]: mariadb.service: Failed with result 'exit-code'." after running the "sudo galera_new_cluster" command.

If I comment all of the lines in the galera.cnf file Mariadb starts normally.

Any idea why the galera.cnf file causes Mariadb to not boot or create mysqld.sock file?

Thanks.

By: ustoopia

This tutorial works great, on a otherwise clean, fresh installation of Ubuntu 16.04. Great tutorial. Thanks!

By: AK

Why is rsync needed to be installed?

I cannot see, that you are doing something with it.

Is it used by the galera framework in background?

By: EP

rsync is used by galera, you can see it in the config:

 

wsrep_sst_method=rsync

By: demba

Hello,

 

is it possible to have a cluster of 4 galera nodes or the max is 3 nodes?

By: wings

You can have a cluster of size up to 128 nodes. It's probably advisable to stick to odd numbers - 3, 5, etc - for quorum reasons.