-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
225 lines (212 loc) · 5.47 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
version: '3.3'
networks:
network_redis_cluster:
driver: bridge
ipam:
driver: default
config:
- subnet: 173.18.0.0/16
volumes:
redis_1_data: {}
redis_2_data: {}
redis_3_data: {}
redis_4_data: {}
redis_5_data: {}
redis_6_data: {}
redis_7_data: {}
redis_8_data: {}
redis_9_data: {}
redis_10_data: {}
services:
redis_1:
image: redis:latest
restart: always
container_name: redis_1
sysctls:
- net.core.somaxconn=65536
ports:
- "127.0.0.1:6381:6381"
- "127.0.0.1:16381:16381"
networks:
network_redis_cluster:
ipv4_address: 173.18.0.11
command: "redis-server /usr/local/etc/redis/redis.conf"
volumes:
- redis_1_data:/data
- ./redis_1/redis.conf:/usr/local/etc/redis/redis.conf
redis_2:
image: redis:latest
restart: always
container_name: redis_2
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.12
ports:
- "127.0.0.1:6382:6382"
- "127.0.0.1:16382:16382"
volumes:
- redis_2_data:/data
- ./redis_2/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_3:
image: redis:latest
restart: always
container_name: redis_3
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.13
ports:
- "127.0.0.1:6383:6383"
- "127.0.0.1:16383:16383"
volumes:
- redis_3_data:/data
- ./redis_3/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_4:
image: redis:latest
restart: always
container_name: redis_4
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.14
ports:
- "127.0.0.1:6384:6384"
- "127.0.0.1:16384:16384"
volumes:
- redis_4_data:/data
- ./redis_4/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_5:
image: redis:latest
restart: always
container_name: redis_5
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.15
ports:
- "127.0.0.1:6385:6385"
- "127.0.0.1:16385:16385"
volumes:
- redis_5_data:/data
- ./redis_5/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_6:
image: redis:latest
restart: always
container_name: redis_6
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.16
ports:
- "127.0.0.1:6386:6386"
- "127.0.0.1:16386:16386"
volumes:
- redis_6_data:/data
- ./redis_6/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_7:
image: redis:latest
restart: always
container_name: redis_7
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.17
ports:
- "127.0.0.1:6387:6387"
- "127.0.0.1:16387:16387"
volumes:
- redis_7_data:/data
- ./redis_7/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_8:
image: redis:latest
restart: always
container_name: redis_8
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.18
ports:
- "127.0.0.1:6388:6388"
- "127.0.0.1:16388:16388"
volumes:
- redis_8_data:/data
- ./redis_8/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_9:
image: redis:latest
restart: always
container_name: redis_9
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.19
ports:
- "127.0.0.1:6389:6389"
- "127.0.0.1:16389:16389"
volumes:
- redis_9_data:/data
- ./redis_9/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_10:
image: redis:latest
restart: always
container_name: redis_10
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.20
ports:
- "127.0.0.1:6390:6390"
- "127.0.0.1:16390:16390"
volumes:
- redis_10_data:/data
- ./redis_10/redis.conf:/usr/local/etc/redis/redis.conf
command: "redis-server /usr/local/etc/redis/redis.conf"
redis_cluster:
image: redis:latest
container_name: redis_cluster
sysctls:
- net.core.somaxconn=65536
networks:
network_redis_cluster:
ipv4_address: 173.18.0.30
tty: true
command: "redis-cli --cluster create
173.18.0.11:6381
173.18.0.12:6382
173.18.0.13:6383
173.18.0.14:6384
173.18.0.15:6385
173.18.0.16:6386
173.18.0.17:6387
173.18.0.18:6388
173.18.0.19:6389
173.18.0.20:6390
--cluster-replicas 1 --cluster-yes"
depends_on:
- redis_1
- redis_2
- redis_3
- redis_4
- redis_5
- redis_6
- redis_7
- redis_8
- redis_9
- redis_10