Skip to content

Commit

Permalink
Supports any of the startup modes as "auto"
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Apr 29, 2020
1 parent 9fff459 commit c9f2585
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions 10conf-d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ data:
#echo " It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster and may not contain all the updates. To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1 ."
echo "Or to try a regular start (for example after recovery + manual intervention), run:"
echo " $SUGGEST_EXEC_COMMAND touch /tmp/confirm-resume"
echo "Waiting for response ..."
if [ $HOST_ID -eq 0 ] && [ ! -z "$AUTO_RECOVERY_MODE" ]; then
# The !=0 hosts are assumed to start normally, with Parallel pod management policy
echo "The AUTO_RECOVERY_MODE env was set to $AUTO_RECOVERY_MODE, will trigger that choice"
touch /tmp/$AUTO_RECOVERY_MODE
else
echo "Waiting for response ..."
fi
while [ ! -f /tmp/confirm-resume ]; do
sleep 1
if [ "$AUTO_NEW_CLUSTER" = "true" ]; then
echo "The AUTO_NEW_CLUSTER env was set to $AUTO_NEW_CLUSTER, will proceed without confirmation"
echo "NOTE this env is deprecated, use AUTO_RECOVERY_MODE instead"
wsrepNewCluster
touch /tmp/confirm-resume
elif [ -f /tmp/confirm-new-cluster ]; then
Expand All @@ -133,6 +139,7 @@ data:
wsrepRecover
touch /tmp/confirm-resume
fi
sleep 1
done
rm /tmp/confirm-*
set -x
Expand Down
4 changes: 2 additions & 2 deletions 50mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ spec:
fieldPath: metadata.namespace
- name: DATADIR
value: /data/db
- name: AUTO_NEW_CLUSTER
value: "false"
- name: AUTO_RECOVERY_MODE
value: confirm-force-bootstrap
- name: WSREP_CLUSTER_ADDRESS
value: "gcomm://mariadb-0.mariadb,mariadb-1.mariadb,mariadb-2.mariadb"
workingDir: /etc/mysql/conf.d-configmap
Expand Down

0 comments on commit c9f2585

Please sign in to comment.