1

I'm trying to install a Galera cluster with 3 mariadb VM's (all of them CentOS 7). I've never done this before, so I was following this guide:

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

The problem is that after I enter my settings on the /etc/my.cnf.d/server.cnf file (step 6 on the guide), I can't start MariaDB:

[root@galera1 ~]# systemctl start mariadb
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.

[root@galera1 ~]# systemctl status -l mariadb
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Thu 2016-10-27 12:23:42 WEST; 5s ago
  Process: 3435 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: 3433 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)

Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] InnoDB: Waiting for purge to start
Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.32-78.1 started; log sequence number 1617490
Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Warning] InnoDB: Skipping buffer pool dump/restore during wsrep recovery.
Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] Plugin 'FEEDBACK' is disabled.
Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] Server socket created on IP: '0.0.0.0'.
Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] WSREP: Recovered position: 00000000-0000-0000-0000-000000000000:-1
Oct 27 12:23:42 galera1.syone.int sh[3435]: WSREP: Failed to recover position: ''
Oct 27 12:23:42 galera1.syone.int systemd[1]: mariadb.service: control process exited, code=exited status=1
Oct 27 12:23:42 galera1.syone.int systemd[1]: Failed to start MariaDB database server.
Oct 27 12:23:42 galera1.syone.int systemd[1]: Unit mariadb.service entered failed state.

Here's the content of the my.cnf file:

[galera]
Mandatory settings
wsrep_on=ON
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address='gcomm://'
wsrep_cluster_name='galera'
wsrep_node_address='10.1.40.83'
wsrep_node_name='galera1'
wsrep_sst_method=rsync

binlog_format=row
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
Allow server to accept connections on all interfaces.
bind-address=0.0.0.0

I've been searching for a solution about this error and the only thing that I found was a bug (https://jira.mariadb.org/browse/MDEV-10396), but I confirmed the /usr/bin/galera_recovery script, and it already has that fix.

The weird part is these 2 lines on the logs:

Oct 27 12:23:39 galera1.syone.int sh[3435]: 2016-10-27 12:23:39 140598747605120 [Note] WSREP: Recovered position: 00000000-0000-0000-0000-000000000000:-1
Oct 27 12:23:42 galera1.syone.int sh[3435]: WSREP: Failed to recover position: ''

He gets the WSREP position, but it fails to get it...? This doesn't make any sense for me. What am I missing?

Thanks!

bumped to the homepage by Community yesterday

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

Ok nevermind, everything is correct, the problem was Selinux. I changed it to permissive and it worked. Nothing to see here.

  • Sorry but turning off SELinux is NOT the solution. Find out what caused the SELinux problem and actually solve it by setting permissions right, it is as simple as using chmod. And you wouldn't turn off user right checking because the DB user didn't have rights to access its config files right? – mzhaase Oct 27 '16 at 15:37
  • You're right. This is the context now: system_u:object_r:lib_t:s0 . I'll investigate what's the correct one and post it here when I found it. – João Santos Oct 27 '16 at 15:47
  • Congratulations on actually using SELinux, you are unfortunately in a minority. – mzhaase Oct 27 '16 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.