Commit 0c10fdef authored by iamabhishek-dubey's avatar iamabhishek-dubey

Updated code

parent efd15ddd
......@@ -30,6 +30,8 @@ COPY entrypoint.sh /usr/bin/entrypoint.sh
COPY setupMasterSlave.sh /usr/bin/setupMasterSlave.sh
COPY healthcheck.sh /usr/bin/healthcheck.sh
VOLUME ["/data"]
WORKDIR /data
......@@ -37,3 +39,5 @@ WORKDIR /data
EXPOSE 6379
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
USER redis
......@@ -11,7 +11,7 @@ services:
SETUP_MODE: cluster
SERVER_MODE: master
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
redis-master-2:
image: opstree/redis:1.0
......@@ -24,7 +24,7 @@ services:
SETUP_MODE: cluster
SERVER_MODE: master
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
redis-master-3:
image: opstree/redis:1.0
......@@ -38,7 +38,7 @@ services:
SERVER_MODE: master
MASTER_LIST: "10.5.0.2:6379 10.5.0.3:6379 10.5.0.4:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
redis-slave-1:
image: opstree/redis:1.0
......@@ -53,7 +53,7 @@ services:
SLAVE_IP: "10.5.0.5:6379"
MASTER_IP: "10.5.0.2:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
redis-slave-2:
image: opstree/redis:1.0
......@@ -68,7 +68,7 @@ services:
SLAVE_IP: "10.5.0.6:6379"
MASTER_IP: "10.5.0.3:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
redis-slave-3:
image: opstree/redis:1.0
......@@ -83,7 +83,7 @@ services:
SLAVE_IP: "10.5.0.7:6379"
MASTER_IP: "10.5.0.4:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping"]
test: ["CMD-SHELL", "/bin/bash /usr/bin/healthcheck.sh"]
networks:
redis:
......
#!/bin/bash
check_redis_health() {
if [[ -z "${REDIS_PASSWORD}" ]]; then
redis-cli ping
else
redis-cli -a ${REDIS_PASSWORD} ping
fi
}
check_redis_health
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment