-
Notifications
You must be signed in to change notification settings - Fork 9
/
compose.nat.yaml
120 lines (120 loc) · 3.96 KB
/
compose.nat.yaml
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
---
# First things first, make sure the default-address-pools settings in /etc/docker/daemon.json
# HOST_ADDR=192.168.11.9 docker compose -f compose.nat.yaml up
# HOST_ADDR=192.168.11.7 docker compose -f compose.nat.yaml up
# DEBUG=1 bundle exec rake 'build_cluster[192.168.11.9,192.168.11.7]'
services:
node1: &node
image: "redis:${REDIS_VERSION:-7}"
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6379
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6379
--cluster-announce-bus-port 16379
restart: "${RESTART_POLICY:-always}"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: "7s"
timeout: "5s"
retries: 10
ports:
- "6379:6379"
- "16379:16379"
node2:
<<: *node
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6380
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6380
--cluster-announce-bus-port 16380
ports:
- "6380:6379"
- "16380:16379"
node3:
<<: *node
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6381
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6381
--cluster-announce-bus-port 16381
ports:
- "6381:6379"
- "16381:16379"
node4:
<<: *node
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6382
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6382
--cluster-announce-bus-port 16382
ports:
- "6382:6379"
- "16382:16379"
node5:
<<: *node
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6383
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6383
--cluster-announce-bus-port 16383
ports:
- "6383:6379"
- "16383:16379"
node6:
<<: *node
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--replica-announce-ip "${HOST_ADDR:-127.0.0.1}"
--replica-announce-port 6384
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 10000
--cluster-announce-ip "${HOST_ADDR:-127.0.0.1}"
--cluster-announce-port 6384
--cluster-announce-bus-port 16384
ports:
- "6384:6379"
- "16384:16379"