Skip to content

Commit

Permalink
[Fix] : Add Cluster Announce IP and HostName (#54)
Browse files Browse the repository at this point in the history
* remove v7 check

Signed-off-by: Shubham Gupta <[email protected]>

* fix v7

Signed-off-by: Shubham Gupta <[email protected]>

* fix location

Signed-off-by: Shubham Gupta <[email protected]>

---------

Signed-off-by: Shubham Gupta <[email protected]>
  • Loading branch information
shubham-cmyk authored Sep 29, 2023
1 parent 80c5be7 commit d525d67
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,19 @@ start_redis() {
else
CLUSTER_ANNOUNCE_IP="${POD_IP}"
fi

if [[ "${REDIS_MAJOR_VERSION}" != "v7" ]]; then
redis-server /etc/redis/redis.conf \
--cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" \
--cluster-announce-hostname "${POD_HOSTNAME}"
else
{
echo cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}"
echo cluster-announce-hostname "${POD_HOSTNAME}"
} >> /etc/redis/redis.conf

redis-server /etc/redis/redis.conf \
--cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" \
--cluster-announce-hostname "${POD_HOSTNAME}"
redis-server /etc/redis/redis.conf
fi

else
echo "Starting redis service in standalone mode....."
Expand Down

0 comments on commit d525d67

Please sign in to comment.