Skip to content

Commit 346e030

Browse files
committed
redis 7 hostname cluster conf
1 parent f60189e commit 346e030

File tree

2 files changed

+9
-39
lines changed

2 files changed

+9
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.idea/

docker-compose.yml

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,60 @@
11
version: '3.8'
22

3-
networks:
4-
default:
5-
ipam:
6-
config:
7-
- subnet: 10.5.0.0/16
83
services:
94
redis-main-1:
10-
image: redis:6-buster
5+
image: redis:7.0-rc3-bullseye
116
volumes:
127
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
138
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
14-
networks:
15-
default:
16-
ipv4_address: 10.5.0.5
179

1810
redis-main-2:
19-
image: redis:6-buster
11+
image: redis:7.0-rc3-bullseye
2012
volumes:
2113
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
2214
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
23-
networks:
24-
default:
25-
ipv4_address: 10.5.0.6
2615

2716
redis-main-3:
28-
image: redis:6-buster
17+
image: redis:7.0-rc3-bullseye
2918
volumes:
3019
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
3120
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
32-
networks:
33-
default:
34-
ipv4_address: 10.5.0.7
3521

3622
redis-replica-1:
37-
image: redis:6-buster
23+
image: redis:7.0-rc3-bullseye
3824
volumes:
3925
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
4026
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
41-
networks:
42-
default:
43-
ipv4_address: 10.5.0.8
4427

4528
redis-replica-2:
46-
image: redis:6-buster
29+
image: redis:7.0-rc3-bullseye
4730
volumes:
4831
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
4932
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
50-
networks:
51-
default:
52-
ipv4_address: 10.5.0.9
5333

5434
redis-replica-3:
55-
image: redis:6-buster
35+
image: redis:7.0-rc3-bullseye
5636
volumes:
5737
- ./resources/config/redis.conf:/usr/local/etc/redis/redis.conf
5838
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
59-
networks:
60-
default:
61-
ipv4_address: 10.5.0.10
6239

6340
redis-cluster-create:
64-
image: redis:6-buster
41+
image: redis:7.0-rc3-bullseye
6542
depends_on:
6643
- redis-main-1
6744
- redis-main-2
6845
- redis-main-3
6946
- redis-replica-1
7047
- redis-replica-2
7148
- redis-replica-3
72-
networks:
73-
- default
7449
command: [
7550
"/bin/bash", "-c",
76-
"echo yes | redis-cli --cluster-replicas 1 --cluster create 10.5.0.5:6379 10.5.0.6:6379 10.5.0.7:6379 10.5.0.8:6379 10.5.0.9:6379 10.5.0.10:6379"
51+
"echo yes | redis-cli --cluster-replicas 1 --cluster create redis-main-1:6379 redis-main-2:6379 redis-main-3:6379 redis-replica-1:6379 redis-replica-2:6379 redis-replica-3:6379"
7752
]
7853

7954
redis-commander:
8055
image: rediscommander/redis-commander
8156
depends_on:
8257
- redis-cluster-create
83-
networks:
84-
- default
8558
environment:
8659
REDIS_HOSTS: local:redis-main-1:6379,local:redis-main-2:6379,local:redis-main-3:6379,local:redis-replica-1:6379,local:redis-replica-2:6379,local:redis-replica-3:6379
8760
STANDALONE: "true"
@@ -90,8 +63,6 @@ services:
9063

9164
redisinsight-config:
9265
image: ellerbrock/alpine-bash-curl-ssl
93-
networks:
94-
- default
9566
entrypoint: [ ]
9667
command: [
9768
"/bin/bash", "-c",
@@ -115,7 +86,5 @@ services:
11586
depends_on:
11687
- redis-cluster-create
11788
- redisinsight-config
118-
networks:
119-
- default
12089
ports:
12190
- "8083:8001"

0 commit comments

Comments
 (0)