Search

Chapter 9. Start MariaDB Locally and Setup Accounts

download PDF

To start MariaDB and setup base accounts, execute the following procedure.

Procedure

  1. 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.

  2. 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
  3. Uncomment the wsrep_cluster_address and wsrep_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
  4. 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
  5. 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 ]
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.