openstack-helm-infra/ceph-mon/templates/bin/mon/_stop.sh.tpl
Chinasubbareddy Mallavarapu f098f760f0 [ceph-mon] update stop script not to remove mons from monmap
This is to update ceph-mon stop script  not to remove mons from
monmap as in multinode clusters three mons in the monmap are required
to handle the quorum properly.

Change-Id: I0dd643007ea0558244bfecae1d90db78828e9834
2020-03-09 20:11:23 +00:00

15 lines
338 B
Smarty

#!/bin/bash
set -ex
NUMBER_OF_MONS=$(ceph mon stat | awk '$3 == "mons" {print $2}')
if [[ "${NUMBER_OF_MONS}" -gt "3" ]]; then
if [[ ${K8S_HOST_NETWORK} -eq 0 ]]; then
ceph mon remove "${POD_NAME}"
else
ceph mon remove "${NODE_NAME}"
fi
else
echo "doing nothing since we are running less than or equal to 3 mons"
fi