From f098f760f02e50312f6971c777c8a4f9b4eed44d Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Sat, 7 Mar 2020 12:57:42 -0600 Subject: [PATCH] [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 --- ceph-mon/templates/bin/mon/_stop.sh.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph-mon/templates/bin/mon/_stop.sh.tpl b/ceph-mon/templates/bin/mon/_stop.sh.tpl index 8e4a3d59b..3f564e88d 100644 --- a/ceph-mon/templates/bin/mon/_stop.sh.tpl +++ b/ceph-mon/templates/bin/mon/_stop.sh.tpl @@ -3,12 +3,12 @@ set -ex NUMBER_OF_MONS=$(ceph mon stat | awk '$3 == "mons" {print $2}') -if [ "${NUMBER_OF_MONS}" -gt "1" ]; then +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 "we are the last mon, not removing" + echo "doing nothing since we are running less than or equal to 3 mons" fi