To recover from a blackout I need to start the Galera cluster when the system boots and I can only do this with the following:
service mysql start --wsrep-new-cluster
"service mysql start" will get launched on boot but will fail because it is the only one in the cluster. How do I get the cluster to start from boot and not fail if it is the only one there?
EDIT
Looks like I have to leave gcomm:// blank for it to start but it is not the best solution as if another server came online first then it would fail.
#galera settings
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="my_wsrep_cluster"
wsrep_cluster_address="gcomm://"
wsrep_sst_method=rsync
wsrep_provider_options="pc.bootstrap=true"
My solution is to edit init scripts - This is solution for debian - location my init script is /etc/init.d/mysql then I found this line:
/usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
and I added parameter --wsrep-new-cluster
/usr/bin/mysqld_safe --wsrep-new-cluster "${@:2}" > /dev/null 2>&1 &
and it is working after boot.