Fix bugs when docker restart

This commit is contained in:
LINxiansheng
2024-04-26 07:16:30 +00:00
committed by ob-robot
parent f8b46b62ff
commit 6797c56e2f
5 changed files with 57 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ARG VERSION
ARG STEP
RUN yum install -y yum-utils && \
yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo && \
yum-config-manager --add-repo https://mirrors.oceanbase.com/oceanbase/OceanBase.repo && \
sed -i 's/$releasever/7/' /etc/yum.repos.d/OceanBase.repo && \
yum install -y ob-deploy obclient ob-sysbench libaio bc libselinux-utils zip && \
rm -rf /usr/obd/mirror/remote/* && \
@ -36,6 +36,7 @@ COPY init_store_for_fast_start.py /root/boot/
ENV PATH /root/boot:$PATH
ENV LD_LIBRARY_PATH /home/admin/oceanbase/lib:/root/ob/lib:$LD_LIBRARY_PATH
STOPSIGNAL SIGTERM
WORKDIR /root
CMD _boot

View File

@ -122,6 +122,13 @@ function deploy_failed {
fi
}
function cleanup() {
obd cluster stop $OB_CLUSTER_NAME
exit 0
}
trap 'cleanup' SIGTERM
# We should decide whether the observer's data exists and
# whether the obd has the information of the cluster
@ -261,5 +268,7 @@ else
echo "Please check the log file ${OB_HOME_PATH}/log/observer.log"
fi
fi
exec tail -f /dev/null
while :; do
sleep 1
done