Your commit message
This commit is contained in:
46
常用脚本/redis哨兵模式-docker/docker-compose.yml
Normal file
46
常用脚本/redis哨兵模式-docker/docker-compose.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
version: '3'
|
||||
services:
|
||||
redis-1:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-1
|
||||
ports:
|
||||
- 6380:6379
|
||||
redis-2:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-2
|
||||
ports:
|
||||
- 6381:6379
|
||||
command: redis-server --slaveof redis-1 6379
|
||||
# 让两个slave节点去复制container_name为redis-master的节点,这样就组成了一个简单的3个节点的主从架构
|
||||
redis-3:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-3
|
||||
ports:
|
||||
- 6382:6379
|
||||
command: redis-server --slaveof redis-1 6379
|
||||
# 让两个slave节点去复制container_name为redis-master的节点,这样就组成了一个简单的3个节点的主从架构
|
||||
|
||||
sentinel-1:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-sentinel-1
|
||||
ports:
|
||||
- 26379:26379
|
||||
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
|
||||
volumes:
|
||||
- ./sentinel1.conf:/usr/local/etc/redis/sentinel.conf
|
||||
sentinel-2:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-sentinel-2
|
||||
ports:
|
||||
- 26380:26379
|
||||
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
|
||||
volumes:
|
||||
- ./sentinel2.conf:/usr/local/etc/redis/sentinel.conf
|
||||
sentinel-3:
|
||||
image: redis:5.0.5
|
||||
container_name: redis-sentinel-3
|
||||
ports:
|
||||
- 26381:26379
|
||||
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
|
||||
volumes:
|
||||
- ./sentinel3.conf:/usr/local/etc/redis/sentinel.conf
|
||||
7
常用脚本/redis哨兵模式-docker/sentinel1.conf
Normal file
7
常用脚本/redis哨兵模式-docker/sentinel1.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
port 26379
|
||||
dir "/tmp"
|
||||
sentinel myid 0bd93b751edefaaef7249a486a342d6d0d007ebe
|
||||
sentinel deny-scripts-reconfig yes
|
||||
sentinel monitor mymaster 172.18.0.3 6379 2
|
||||
sentinel config-epoch mymaster 2
|
||||
|
||||
7
常用脚本/redis哨兵模式-docker/sentinel2.conf
Normal file
7
常用脚本/redis哨兵模式-docker/sentinel2.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
port 26379
|
||||
dir "/tmp"
|
||||
sentinel myid 91a6c9cc2b7680584e70ea4b88474d8f95260bf8
|
||||
sentinel deny-scripts-reconfig yes
|
||||
sentinel monitor mymaster 172.18.0.3 6379 2
|
||||
sentinel config-epoch mymaster 2
|
||||
|
||||
7
常用脚本/redis哨兵模式-docker/sentinel3.conf
Normal file
7
常用脚本/redis哨兵模式-docker/sentinel3.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
port 26379
|
||||
dir "/tmp"
|
||||
sentinel myid 58ec1266fc47abc23bb3ca8ebdca2e52b48584ad
|
||||
sentinel deny-scripts-reconfig yes
|
||||
sentinel monitor mymaster 172.18.0.3 6379 2
|
||||
sentinel config-epoch mymaster 2
|
||||
|
||||
Reference in New Issue
Block a user