forked from redis-rb/redis-cluster-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.latency.yaml
More file actions
132 lines (132 loc) · 3.23 KB
/
Copy pathcompose.latency.yaml
File metadata and controls
132 lines (132 loc) · 3.23 KB
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
---
# 3 shards plus with each 2 replicas simutlated network delay
services:
node1: &node
image: "redis:${REDIS_VERSION:-7}"
command: >
redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000
restart: "${RESTART_POLICY:-always}"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: "7s"
timeout: "5s"
retries: 10
ports:
- "6379:6379"
node2:
<<: *node
ports:
- "6380:6379"
node3:
<<: *node
ports:
- "6381:6379"
node4:
<<: *node
ports:
- "6382:6379"
node5: &far_node
<<: *node
command: >
bash -c "apt-get update > /dev/null
&& apt-get install --no-install-recommends --no-install-suggests -y iproute2 iputils-ping > /dev/null
&& rm -rf /var/lib/apt/lists/*
&& (tc qdisc add dev eth0 root netem delay ${DELAY_TIME:-1ms} || echo skipped)
&& redis-server
--maxmemory 64mb
--maxmemory-policy allkeys-lru
--appendonly yes
--cluster-enabled yes
--cluster-config-file nodes.conf
--cluster-node-timeout 5000"
cap_add:
- NET_ADMIN
ports:
- "6383:6379"
node6:
<<: *node
ports:
- "6384:6379"
node7:
<<: *far_node
ports:
- "6385:6379"
node8:
<<: *node
ports:
- "6386:6379"
node9:
<<: *far_node
ports:
- "6387:6379"
clustering:
image: "redis:${REDIS_VERSION:-7}"
command: >
bash -c "apt-get update > /dev/null
&& apt-get install --no-install-recommends --no-install-suggests -y dnsutils > /dev/null
&& rm -rf /var/lib/apt/lists/*
&& yes yes | redis-cli --cluster create
$$(dig node1 +short):6379
$$(dig node2 +short):6379
$$(dig node3 +short):6379
$$(dig node4 +short):6379
$$(dig node5 +short):6379
$$(dig node6 +short):6379
$$(dig node7 +short):6379
$$(dig node8 +short):6379
$$(dig node9 +short):6379
--cluster-replicas 2"
depends_on:
node1:
condition: service_healthy
node2:
condition: service_healthy
node3:
condition: service_healthy
node4:
condition: service_healthy
node5:
condition: service_healthy
node6:
condition: service_healthy
node7:
condition: service_healthy
node8:
condition: service_healthy
node9:
condition: service_healthy
envoy:
image: envoyproxy/envoy:v1.35.3
restart: "${RESTART_POLICY:-always}"
command:
- envoy
- -c
- /etc/envoy/envoy.yaml
- -l
- warn
ports:
- "3000:10000"
- "7000:10001"
volumes:
- ./test/proxy/envoy.yaml:/etc/envoy/envoy.yaml
depends_on:
clustering:
condition: service_completed_successfully
redis-cluster-proxy:
image: ghcr.io/redis-rb/redis-cluster-proxy:latest
restart: "${RESTART_POLICY:-always}"
command:
- "--bind"
- "0.0.0.0"
- "node1:6379"
ports:
- "7001:7777"
depends_on:
clustering:
condition: service_completed_successfully