Shell script `default/mariadb-galera-cluster-db-stack'

Install a full stack MySQL Galera Cluster on Ubuntu 16.04

clustermin install starting-stack clustermin install mariadb-galera clustermin run mysql-clustermin clustermin run mysql_secure_installation clustermin install percona-xtrabackup clustermin install socat clustermin install percona-clustercheck clustermin run allow-mix-ip-from-cluster clustermin run allow-mix-ip-from-inclusters mkdir -p $HOME/etc/mysql clustermin get mariadb-galera-cluster.cnf | tee $HOME/etc/mysql/galera.cnf > /dev/null sudo ln -f $HOME/etc/mysql/galera.cnf /etc/mysql/conf.d/galera.cnf # set user_my_cnf to any command to insert here {{ user_my_cnf }} clustermin get mariadb-increase-timeout.conf | tee $HOME/etc/mysql/mariadb.service.conf > /dev/null sudo ln -f $HOME/etc/mysql/mariadb.service.conf /etc/systemd/system/mariadb.service.d/mariadb-increase-timeout.conf sudo systemctl daemon-reload if [ -f /etc/mysql/debian.cnf ]; then clustermin get debian.cnf | sudo tee /etc/mysql/debian.cnf > /dev/null fi {% if cluster.servers | length == 1 %} cat <<EOF | mysql CREATE USER 'haproxy'@'%'; GRANT PROCESS ON *.* TO 'clustercheckuser'@'localhost' IDENTIFIED BY '{{ randomize('clustercheckuser' ~ cluster.uuid) }}' ; CREATE USER 'sstuser'@'%' IDENTIFIED BY '{{ randomize('sst_password' ~ cluster.uuid) }}'; GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'sstuser'@'%'; FLUSH PRIVILEGES; EOF if [ -f /etc/mysql/debian.cnf ]; then cat <<EOF | mysql mysql UPDATE user SET password=PASSWORD('{{ randomize('debian-sys-maint' ~ cluster.uuid) }}') WHERE User='debian-sys-maint'; FLUSH PRIVILEGES; EOF fi {% endif %} clustermin run mariadb-galera-cluster-restart