2017-08-31 17:22:33 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
RETRIES="{{ handler_health_mds_check_retries }}"
|
|
|
|
DELAY="{{ handler_health_mds_check_delay }}"
|
2020-07-22 03:27:59 +08:00
|
|
|
MDS_NAME="{{ ansible_hostname }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
{% if containerized_deployment | bool %}
|
2018-11-08 17:02:37 +08:00
|
|
|
DOCKER_EXEC="{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
{% endif %}
|
2017-08-31 17:22:33 +08:00
|
|
|
|
2018-07-31 21:18:28 +08:00
|
|
|
# Backward compatibility
|
|
|
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_fqdn }}.asok
|
|
|
|
$DOCKER_EXEC test -S /var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok && SOCKET=/var/run/ceph/{{ cluster }}-mds.{{ ansible_hostname }}.asok
|
|
|
|
|
2017-08-31 17:22:33 +08:00
|
|
|
# First, restart the daemon
|
|
|
|
systemctl restart ceph-mds@${MDS_NAME}
|
|
|
|
|
|
|
|
# Wait and ensure the socket exists after restarting the daemds
|
|
|
|
while [ $RETRIES -ne 0 ]; do
|
2017-09-28 00:22:15 +08:00
|
|
|
$DOCKER_EXEC test -S $SOCKET && exit 0
|
2017-08-31 17:22:33 +08:00
|
|
|
sleep $DELAY
|
|
|
|
let RETRIES=RETRIES-1
|
|
|
|
done
|
|
|
|
# If we reach this point, it means the socket is not present.
|
2018-11-27 17:45:05 +08:00
|
|
|
echo "Socket file ${SOCKET} could not be found, which means the Metadata Server is not running. Showing ceph-mds unit logs now:"
|
|
|
|
journalctl -u ceph-mds@${MDS_NAME}
|
2017-08-31 17:22:33 +08:00
|
|
|
exit 1
|