From 622f604cbea6f8404039967206ab5f1821bb687f Mon Sep 17 00:00:00 2001 From: Chinasubbareddy Mallavarapu Date: Mon, 10 Feb 2020 16:13:48 -0600 Subject: [PATCH] [Ceph-Mon] Check for ceph-mon messenger V2 This adds a new check to make sure msgr2 is enabled if it is supported by all of the mons. When mon quorum is lost the mons revert to the v1 protocol, which results in a Ceph warning state if v2 is supported by all of the available mons. Change-Id: Ib85243d38f122c1993aba945b7ae943eed262dbf --- ceph-mon/templates/bin/moncheck/_start.sh.tpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ceph-mon/templates/bin/moncheck/_start.sh.tpl b/ceph-mon/templates/bin/moncheck/_start.sh.tpl index 46510ba2f2..dfb86af922 100644 --- a/ceph-mon/templates/bin/moncheck/_start.sh.tpl +++ b/ceph-mon/templates/bin/moncheck/_start.sh.tpl @@ -15,10 +15,22 @@ else fi fi +function check_mon_msgr2 { + if [[ -z "$(ceph mon versions | grep ceph\ version | grep -v nautilus)" ]]; then + if ceph health detail|grep -i "MON_MSGR2_NOT_ENABLED"; then + echo "ceph-mon msgr v2 not enabled on all ceph mons so enabling" + ceph mon enable-msgr2 + fi + fi +} + + function watch_mon_health { while [ true ]; do echo "checking for zombie mons" /tmp/moncheck-reap-zombies.py || true + echo "checking for ceph-mon msgr v2" + check_mon_msgr2 echo "sleep 30 sec" sleep 30 done