11# redis-cluster
2- ** Redis cluster with Docker/Fig **
2+ ** Redis cluster with Docker Compose **
33
4- Using Docker/Fig to setup a redis cluster for testing sentinel failover.
4+ Using Docker Compose to setup a redis cluster for testing sentinel failover.
55
66This project is inspired by the project of [ https://github.com/mdevilliers/docker-rediscluster ] [ 1 ]
77
88
99## Prerequisite
1010
11- Install [ Docker] [ 4 ] and [ Fig ] [ 3 ] in testing environment
11+ Install [ Docker] [ 4 ] and [ Docker Compose ] [ 3 ] in testing environment
1212
13+ Optional:
1314Install the redis-cli. E.g. with following command in Ubuntu
1415
1516```
1617apt-get install redis-server
1718```
1819
19- ## Fig template of Redis cluster
20+ ## Docker Compose template of Redis cluster
2021
21- The fig tempalte defines the topology of the Redis cluster
22+ The tempalte defines the topology of the Redis cluster
2223
2324```
2425redismaster:
@@ -40,8 +41,7 @@ redisconfig:
4041 - redisslave
4142```
4243
43-
44- In the topology of cluster, there are following nodes:
44+ There are following nodes in the cluster,
4545
4646* redismaster: Redis master
4747* redisslave: Redis slave
@@ -68,13 +68,13 @@ The details could be found in sentinel/sentinel.conf
6868Start the redis cluster
6969
7070```
71- fig up
71+ docker-compose up
7272```
7373
7474Check the status of redis cluster
7575
7676```
77- fig ps
77+ docker-compose ps
7878```
7979
8080The result is
@@ -91,13 +91,13 @@ Scale out the instance number of sentinel
9191
9292
9393```
94- fig scale sentinel=3
94+ docker-compose scale sentinel=3
9595```
9696
9797Check the status of redis cluster
9898
9999```
100- fig ps
100+ docker-compose ps
101101```
102102
103103The result is
@@ -139,6 +139,11 @@ redis-cli -h $SENTINEL_IP -p 26379 info Sentinel
139139
140140[ 1 ] : https://github.com/mdevilliers/docker-rediscluster
141141[ 2 ] : https://registry.hub.docker.com/u/joshula/redis-sentinel/
142- [ 3 ] : http ://www.fig.sh
142+ [ 3 ] : https ://docs.docker.com/compose/
143143[ 4 ] : https://www.docker.com
144144
145+
146+ ## Contributors
147+
148+ * Li Yi (< denverdino@gmail.com > )
149+ * Ty Alexander (<ty.alexander@gmail.com >)
0 commit comments