Skip to content

Commit

Permalink
ot-redis
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed Nov 29, 2023
1 parent cec26d6 commit 1602bdd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arm64/images/ot-redis/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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"
Expand Down

0 comments on commit 1602bdd

Please sign in to comment.