Commit 0a838d92 authored by Shubham Gupta's avatar Shubham Gupta

env variable can be set

parent 87d0adc8
......@@ -40,7 +40,7 @@ RUN chown -R redis:redis /etc/redis
VOLUME ["/sentinel-data"]
WORKDIR /data
WORKDIR /sentinel-data
EXPOSE 26379
......
#!/bin/bash
#Redis Configuration needed
PORT=${PORT:-6379}
IP=${IP:-0.0.0.0}
QUORUM=${QUORUM:-2}
#Sentinel Config
EXTERNAL_CONFIG_FILE=${EXTERNAL_CONFIG_FILE:-"/etc/redis/external.conf.d/redis-sentinel-additional.conf"}
DOWN_AFTER_MILLISECONDS=${DOWN_AFTER_MILLISECONDS:-30000}
PARALLEL_SYNCS=${PARALLEL_SYNCS:-1}
FAILOVER_TIMEOUT=${FAILOVER_TIMEOUT:-180000}
sentinel_mode_setup(){
{
echo "sentinel monitor ${MASTER_GROUP_NAME} ${IP} ${PORT} ${QUORUM}"
echo "sentinel down-after-milliseconds ${MASTER_GROUP_NAME} ${DOWN_AFTER_MILLISECONDS}"
echo "sentinel parallel-syncs ${MASTER_GROUP_NAME} ${PARALLEL_SYNCS}"
echo "sentinel failover-timeout ${MASTER_GROUP_NAME} ${FAILOVER_TIMEOUT}"
}>> /etc/redis/sentinel.conf
}
external_config() {
echo "include ${EXTERNAL_CONFIG_FILE}" >> /etc/redis/sentinel.conf
......@@ -15,6 +35,8 @@ start_sentinel() {
main_function() {
sentinel_mode_setup
if [[ -f "${EXTERNAL_CONFIG_FILE}" ]]; then
external_config
fi
......
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