add
This commit is contained in:
parent
f79ebc9e50
commit
29f042cbeb
3
redis-cluster/master-slave/config/master.conf
Normal file
3
redis-cluster/master-slave/config/master.conf
Normal file
@ -0,0 +1,3 @@
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
dbfilename "dump-6379.rdb"
|
3
redis-cluster/master-slave/config/slave.conf
Normal file
3
redis-cluster/master-slave/config/slave.conf
Normal file
@ -0,0 +1,3 @@
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
slaveof redis-main 6379
|
36
redis-cluster/master-slave/docker-compose.yml
Normal file
36
redis-cluster/master-slave/docker-compose.yml
Normal file
@ -0,0 +1,36 @@
|
||||
version: "3"
|
||||
services:
|
||||
|
||||
redis-main:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-main
|
||||
volumes:
|
||||
- ./config/master.conf:/usr/local/etc/redis/redis.conf
|
||||
command: ["redis-server","/usr/local/etc/redis/redis.conf"]
|
||||
ports:
|
||||
- 16379:6379
|
||||
networks:
|
||||
- redis1
|
||||
redis-cluster1:
|
||||
container_name: redis-cluster1
|
||||
image: redis:6.2.4
|
||||
volumes:
|
||||
- ./config/slave.conf:/usr/local/etc/redis/redis.conf
|
||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
ports:
|
||||
- 16380:6379
|
||||
networks:
|
||||
- redis1
|
||||
redis-cluster2:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-cluster2
|
||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
volumes:
|
||||
- ./config/slave.conf:/usr/local/etc/redis/redis.conf
|
||||
# command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
ports:
|
||||
- 16381:6379
|
||||
networks:
|
||||
- redis1
|
||||
networks:
|
||||
redis1:
|
6
redis-cluster/redis-sentinel/.gitignore
vendored
Normal file
6
redis-cluster/redis-sentinel/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
data/main/*
|
||||
!data/main/.gitkeep
|
||||
data/slave1/*
|
||||
!data/slave1/.gitkeep
|
||||
data/slave2/*
|
||||
!data/slave2/.gitkeep
|
2
redis-cluster/redis-sentinel/config/master.conf
Normal file
2
redis-cluster/redis-sentinel/config/master.conf
Normal file
@ -0,0 +1,2 @@
|
||||
bind 0.0.0.0
|
||||
port 6379
|
7
redis-cluster/redis-sentinel/config/sentinel1.conf
Normal file
7
redis-cluster/redis-sentinel/config/sentinel1.conf
Normal file
@ -0,0 +1,7 @@
|
||||
bind 0.0.0.0
|
||||
port 9003
|
||||
# 配置主节点地址,至少需要2个哨兵节点同意才能判定主节点故障并进行故障转移
|
||||
# 注意:这里配置的域名会被动态修改为ip
|
||||
sentinel monitor mymaster redis-main 6379 2
|
||||
# 允许解析域名(如果上面一行要使用域名,要设置此项为yes)
|
||||
sentinel resolve-hostnames yes
|
7
redis-cluster/redis-sentinel/config/sentinel2.conf
Normal file
7
redis-cluster/redis-sentinel/config/sentinel2.conf
Normal file
@ -0,0 +1,7 @@
|
||||
bind 0.0.0.0
|
||||
port 9003
|
||||
# 配置主节点地址,至少需要2个哨兵节点同意才能判定主节点故障并进行故障转移
|
||||
# 注意:这里配置的域名会被动态修改为ip
|
||||
sentinel monitor mymaster redis-main 6379 2
|
||||
# 允许解析域名(如果上面一行要使用域名,要设置此项为yes)
|
||||
sentinel resolve-hostnames yes
|
7
redis-cluster/redis-sentinel/config/sentinel3.conf
Normal file
7
redis-cluster/redis-sentinel/config/sentinel3.conf
Normal file
@ -0,0 +1,7 @@
|
||||
bind 0.0.0.0
|
||||
port 9003
|
||||
# 配置主节点地址,至少需要2个哨兵节点同意才能判定主节点故障并进行故障转移
|
||||
# 注意:这里配置的域名会被动态修改为ip
|
||||
sentinel monitor mymaster redis-main 6379 2
|
||||
# 允许解析域名(如果上面一行要使用域名,要设置此项为yes)
|
||||
sentinel resolve-hostnames yes
|
3
redis-cluster/redis-sentinel/config/slave1.conf
Normal file
3
redis-cluster/redis-sentinel/config/slave1.conf
Normal file
@ -0,0 +1,3 @@
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
replicaof redis-main 6379
|
3
redis-cluster/redis-sentinel/config/slave2.conf
Normal file
3
redis-cluster/redis-sentinel/config/slave2.conf
Normal file
@ -0,0 +1,3 @@
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
replicaof redis-main 6379
|
0
redis-cluster/redis-sentinel/data/main/.gitkeep
Normal file
0
redis-cluster/redis-sentinel/data/main/.gitkeep
Normal file
0
redis-cluster/redis-sentinel/data/slave1/.gitkeep
Normal file
0
redis-cluster/redis-sentinel/data/slave1/.gitkeep
Normal file
0
redis-cluster/redis-sentinel/data/slave2/.gitkeep
Normal file
0
redis-cluster/redis-sentinel/data/slave2/.gitkeep
Normal file
68
redis-cluster/redis-sentinel/docker-compose.yml
Normal file
68
redis-cluster/redis-sentinel/docker-compose.yml
Normal file
@ -0,0 +1,68 @@
|
||||
version: "3"
|
||||
services:
|
||||
|
||||
redis-main:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-main
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
- ./data/main:/data
|
||||
user: "${UID}:${GID}"
|
||||
command: ["redis-server","/usr/local/etc/redis/master.conf"]
|
||||
networks:
|
||||
- redis
|
||||
|
||||
redis-slave1:
|
||||
container_name: redis-slave1
|
||||
image: redis:6.2.4
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
- ./data/slave1:/data
|
||||
command: ["redis-server", "/usr/local/etc/redis/slave1.conf"]
|
||||
user: "${UID}:${GID}"
|
||||
networks:
|
||||
- redis
|
||||
|
||||
redis-slave2:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-slave2
|
||||
user: "${UID}:${GID}"
|
||||
command: ["redis-server", "/usr/local/etc/redis/slave2.conf"]
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
- ./data/slave2:/data
|
||||
networks:
|
||||
- redis
|
||||
|
||||
redis-sentinel1:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-sentinel1
|
||||
user: "${UID}:${GID}"
|
||||
command: ["redis-server", "/usr/local/etc/redis/sentinel1.conf",'--sentinel']
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
networks:
|
||||
- redis
|
||||
|
||||
redis-sentinel2:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-sentinel2
|
||||
user: "${UID}:${GID}"
|
||||
command: ["redis-server", "/usr/local/etc/redis/sentinel2.conf",'--sentinel']
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
networks:
|
||||
- redis
|
||||
|
||||
redis-sentinel3:
|
||||
image: redis:6.2.4
|
||||
container_name: redis-sentinel3
|
||||
user: "${UID}:${GID}"
|
||||
command: ["redis-server", "/usr/local/etc/redis/sentinel3.conf",'--sentinel']
|
||||
volumes:
|
||||
- ./config:/usr/local/etc/redis
|
||||
networks:
|
||||
- redis
|
||||
|
||||
networks:
|
||||
redis:
|
Loading…
x
Reference in New Issue
Block a user