-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: the replica affinity option is not working (#109)
- Loading branch information
1 parent
1b41b3b
commit ca7840c
Showing
7 changed files
with
190 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
# 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:-20ms} | ||
&& 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters