Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions redis/3-highly-available/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ tasks:
cpu: 250m
memory: 500Mi
command:
- /bin/bash
- -c
- 'container run_master_and_sentinel'
- container run_master_and_sentinel
environment_variables:
REDIS_SENTINEL_SERVICE_HOST: ''
deployment_strategy:
Expand Down Expand Up @@ -181,5 +179,5 @@ tasks:
image:
image: quay.io/continuouspipe/redis3-highly-available:stable
commands:
- /bin/bash -c 'container master_failover_and_sentinel_cleanup'
- container master_failover_and_sentinel_cleanup
```
9 changes: 7 additions & 2 deletions redis/3-highly-available/usr/local/share/redis_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function sentinel_command()
{
redis-cli -h redis-sentinel -p 26379 --csv SENTINEL
redis-cli -h redis-sentinel -p 26379 --csv SENTINEL "$@"
}

function get_existing_master()
Expand Down Expand Up @@ -49,7 +49,12 @@ function sentinel_cleanup()
echo "> Waiting for the sentinel to receive data from the other sentinels"
sleep 11s
echo "> Resetting sentinel data for $sentinel"
redis-cli -h "$sentinel" -p 26379 SENTINEL RESET mymaster

if test_remote_ports "$sentinel:26379"; then
redis-cli -h "$sentinel" -p 26379 SENTINEL RESET mymaster
else
echo "> Sentinel $sentinel doesn't appear to be active any more"
fi
done
}

Expand Down