[MDEV-7752] There is no bootstrap command option for MariaDB Galera Cluster in CentOS 7 Created: 2015-03-11  Updated: 2015-11-20  Resolved: 2015-11-20

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Galera
Affects Version/s: 10.0.16-galera
Fix Version/s: 10.1.9

Type: Bug Priority: Major
Reporter: Shahriyar Rzayev Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 4
Labels: systemd, verified
Environment:

CentOS 7


Issue Links:
Blocks
is blocked by MDEV-427 Provide a systemd script for MariaDB Closed
Relates
relates to MDEV-9007 [PATCH] Bootstrap does not work in Ce... Closed

 Description   

After installing MariaDB Galera from YUM repo, could not find bootstrap command option for starting cluster:

[root@node1 ~]# systemctl start mysql --wsrep_new_cluster
systemctl: unrecognized option '--wsrep_new_cluster'

As with PXC:

[root@node1 ~]# systemctl start mysql@bootstrap.service
Failed to issue method call: Unit mysql@bootstrap.service failed to load: No such file or directory.
 
[root@node1 ~]# systemctl bootstrap mysql.service
Unknown operation 'bootstrap'.



 Comments   
Comment by Sergei Golubchik [ 2015-03-11 ]

Did you install mariadb from yum.mariadb.org or from the CentOS 7 repository?

Comment by Shahriyar Rzayev [ 2015-03-11 ]

I have installed it from CentOS 7 repo:

[root@node1 ~]# cat /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Comment by Elena Stepanova [ 2015-03-12 ]

There is still /etc/init.d/mysql bootstrap

As I understand, MariaDB doesn't actually install a unit file, apparently it's some default magic that allows to start/stop the service with systemctl, and this magic only covers basic operations like start/stop.
Percona, on the other hand, does install mysql.service and mysql@.service.

Assigned to serg for now, in case we want to do something about it in the server package as well. If it's only Galera cluster that needs the service, please reassign.

Comment by Shahriyar Rzayev [ 2015-03-12 ]

As a workaround use:

service mysql bootstrap

Because it is still supported for backward compatibility, but surely it will be removed with upcoming releases.

Comment by Shahriyar Rzayev [ 2015-03-13 ]

Also must note that,

[root@node1 ~]# systemctl status mysql.service
mysql.service - LSB: start and stop MySQL
   Loaded: loaded (/etc/rc.d/init.d/mysql)
   Active: inactive (dead) since Tue 2015-03-10 22:29:31 AZT; 14h ago
 
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

But in fact it is up and running:

[root@node1 ~]# service mysql status
MySQL running (9610)                                       [  OK  ]
 
[root@node1 ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 349
Server version: 10.0.17-MariaDB-wsrep-log MariaDB Server, wsrep_25.10.r4144
 
Copyright (c) 2000, 2015, 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 |
| test               |
+--------------------+
4 rows in set (0.03 sec)
 

Comment by Nirbhay Choubey (Inactive) [ 2015-05-12 ]

Should adding "_SYSTEMCTL_SKIP_REDIRECT=true" in init script be a potential solution?

https://github.com/codership/mysql-wsrep/commit/a0ba0d7e176551c7e13daa2ef8974d8aade2dfc7.patch

Comment by sirotopr [ 2015-10-17 ]

I'm facing the same bug with Debian packages for version 10.0.21 from MariaDB repo.

It gets a bit worse because

sudo service mysql start --wsrep_new_cluster

fails silently. Unlike systemctl, there is no error output. Thus the user might think, as I did, that everything is going fine.

Comment by Sven Lankes [ 2015-10-21 ]

As a workaround this works for me:

[root@galera01 mysql]# systemctl set-environment MYSQLD_OPTS="--wsrep-new-cluster"
[root@galera01 mysql]# systemctl start mariadb
[root@galera01 mysql]# systemctl unset-environment MYSQLD_OPTS

Comment by Daniel Black [ 2015-10-30 ]

So MDEV-9007 is the 10.1 fix. nirbhay_c should a backport of the same user interface and scripts be done?

Comment by Nirbhay Choubey (Inactive) [ 2015-10-30 ]

danblack : I think the following commit (merged from mysql-wsrep) should fix this issue in 5.5/10.0 :
https://github.com/MariaDB/server/commit/fd1b2e486a9a81ffb5416e7a0a0d85d15598c77c

Comment by Nirbhay Choubey (Inactive) [ 2015-11-20 ]

In 10.0.22-galera, any of the following commands can be used to bootstrap :

  • sudo service mysql bootstrap
  • sudo service mysql start --wsrep-new-cluster
Generated at Thu Feb 08 07:21:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.