2015-10-15 15:38:45 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This file is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
2017-06-08 04:43:39 +02:00
|
|
|
if [ "${1}" = "-h" ] || [ "${1}" = "--help" ]; then
|
2017-04-30 06:47:34 +02:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
Usage: ${0}
|
|
|
|
|
|
|
|
The script galera_new_cluster is used to bootstrap new Galera Cluster,
|
|
|
|
when all the nodes are down. Run galera_new_cluster on the first node only.
|
2017-05-09 11:24:22 +02:00
|
|
|
On the remaining nodes simply run 'service @DAEMON_NAME@ start'.
|
2017-04-30 06:47:34 +02:00
|
|
|
|
|
|
|
For more information on Galera Cluster configuration and usage see:
|
|
|
|
https://mariadb.com/kb/en/mariadb/getting-started-with-mariadb-galera-cluster/
|
|
|
|
|
|
|
|
EOF
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2015-11-03 05:19:37 +01:00
|
|
|
systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
|
2022-05-01 14:45:58 +02:00
|
|
|
systemctl restart ${1:-mariadb}
|
2015-10-15 15:38:45 +02:00
|
|
|
|
2018-08-24 10:43:27 +02:00
|
|
|
extcode=$?
|
|
|
|
|
2015-11-03 05:19:37 +01:00
|
|
|
systemctl set-environment _WSREP_NEW_CLUSTER=''
|
2018-08-24 10:43:27 +02:00
|
|
|
|
2018-11-09 07:41:05 +01:00
|
|
|
exit $extcode
|