Chapter 9. Start MariaDB Locally and Setup Accounts
To start MariaDB and setup base accounts, execute the following procedure.
Procedure
Start the MariaDB service and set up base accounts ALL controller nodes.
mysqld_safe --wsrep-provider=none & MYSQL_PASSWORD=$(/bin/hiera -c /etc/puppet/hiera.yaml mysql::server::root_password) CLUSTERCHECK_PASSWORD=$(/bin/hiera -c /etc/puppet/hiera.yaml mysql_clustercheck_password) /usr/bin/mysql -u root -p -e "CREATE USER 'clustercheck'@'localhost';" /usr/bin/mysql -u root -p -e "GRANT PROCESS ON *.* TO 'clustercheck'@'localhost' IDENTIFIED BY '$CLUSTERCHECK_PASSWORD';" /usr/bin/mysqladmin -u root password $MYSQL_PASSWORD mysqladmin -u root -p$MYSQL_PASSWORD shutdown
The director creates a root password and stores it in
/root/.my.cnf
.On ALL controller nodes, ensure that the
mysql
process is not running.[root@overcloud-controller-0]# ps -ef | grep mysql [root@overcloud-controller-1]# ps -ef | grep mysql [root@overcloud-controller-2]# ps -ef | grep mysql
Uncomment the
wsrep_cluster_address
andwsrep_provider
settings in/etc/my.cnf.d/galera.cnf
on ALL controller nodes.wsrep_cluster_address = gcomm://overcloud-controller-0,overcloud-controller-1,overcloud-controller-2 wsrep_provider = /usr/lib64/galera/libgalera_smm.so
On one of the nodes in the cluster, bring the Galera cluster up with Pacemaker.
[root@overcloud-controller-0]# pcs resource manage galera [root@overcloud-controller-0]# pcs resource cleanup galera
Make sure that cluster is running.
[root@overcloud-controller-0]# pcs status | grep -C3 galera
If the cluster is running, the output should look like this:
Master/Slave Set: galera-master [galera] Masters: [ overcloud-controller-0 overcloud-controller-1 overcloud-controller-2 ]