From 1602bdd7abffe3a48241839a763dfc97bff8fc57 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 29 Nov 2023 21:25:12 +0800 Subject: [PATCH] ot-redis --- arm64/images/ot-redis/entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arm64/images/ot-redis/entrypoint.sh b/arm64/images/ot-redis/entrypoint.sh index 6ef7360ee..19720aaba 100644 --- a/arm64/images/ot-redis/entrypoint.sh +++ b/arm64/images/ot-redis/entrypoint.sh @@ -32,6 +32,9 @@ set_redis_password() { redis_mode_setup() { if [[ "${SETUP_MODE}" == "cluster" ]]; then + if [[ -z "${POD_IP}" ]]; then + POD_IP=$(hostname -i) + fi { echo cluster-enabled yes echo cluster-announce-ip ${POD_IP} @@ -43,10 +46,6 @@ redis_mode_setup() { echo cluster-config-file "${DATA_DIR}/nodes.conf" } >> /etc/redis/redis.conf - if [[ -z "${POD_IP}" ]]; then - POD_IP=$(hostname -i) - fi - sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" "${DATA_DIR}/nodes.conf" else echo "Setting up redis in standalone mode"