36

Bootstrap Your MySQL or MariaDB Gamera Cluster Using Systemd

 5 years ago
source link: https://www.tuicool.com/articles/neQ3Evz
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

I had a brief power outage this morning, and I had to go lookup how to bootstrap my MaridDB Galera cluster again. I’m finally documenting it here to share it with you!

Use the commands below to start the first node in a MariaDB Galera Cluster or bootstrap a failed cluster. Run these commands on the most up-to-date node in your cluster!

systemctl set-environment MYSQLD_OPTS="--wsrep-new-cluster"
sed -i 's/safe_to_bootstrap: 0/safe_to_bootstrap: 1/g' /var/lib/mysql/grastate.dat
systemctl start mariadb
systemctl unset-environment MYSQLD_OPTS

For more information on the second command, see this article under the section “Safe to Bootstrap” Protection . These commands were tested on CentOS 7 running MariaDB 10.1.38. Let me know if it works for you in the comments.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK