diff --git a/src/daemon/start_mon.sh b/src/daemon/start_mon.sh index 75e4edb6d..ec1b128d0 100755 --- a/src/daemon/start_mon.sh +++ b/src/daemon/start_mon.sh @@ -169,10 +169,11 @@ function start_mon { ceph-mon --setuser ceph --setgroup ceph --cluster "${CLUSTER}" -i "${MON_NAME}" --inject-monmap "$MONMAP" --keyring "$MON_KEYRING" --mon-data "$MON_DATA_DIR" fi if [[ "$CEPH_DAEMON" != demo ]]; then - v2v1=$(ceph-conf -c /etc/ceph/"${CLUSTER}".conf 'mon host' | tr ',' '\n' | grep -c "${MON_IP}") + MON_IP_NO_BRACKETS=$(echo "$MON_IP" | tr -d '[]') + v2v1=$(ceph-conf -c /etc/ceph/"${CLUSTER}".conf 'mon host' | tr ',' '\n' | grep -c "${MON_IP_NO_BRACKETS}") # in case of v2+v1 configuration : [v2:xxxx:3300,v1:xxxx:6789] if [ "${v2v1}" -eq 2 ]; then - timeout 7 ceph "${CLI_OPTS[@]}" mon add "${MON_NAME}" "${MON_IP}" || true + timeout 7 ceph "${CLI_OPTS[@]}" mon add "${MON_NAME}" "${MON_IP_NO_BRACKETS}" || true # with v2 only : [v2:xxxx:3300] else timeout 7 ceph "${CLI_OPTS[@]}" mon add "${MON_NAME}" "${MON_IP}":"${MON_PORT}" || true