Last active
May 31, 2023 16:38
-
-
Save trajano/4c037a011182130fa0c9eb8d16a78f2c to your computer and use it in GitHub Desktop.
Revisions
-
trajano revised this gist
May 31, 2023 . 1 changed file with 15 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ services: redis: image: docker-proxy.devhaus.com/library/redis:6-alpine command: - sh - -c - redis-server --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes --maxmemory $$(( $$( cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || cat /sys/fs/cgroup/memory.max ) - 100000000)) --maxmemory-policy volatile-lru healthcheck: # This check needs to be non-writing because if there is data before the cluster is initialized it will cause an error test: ["CMD", "redis-cli", "--raw", "ping"] deploy: replicas: 6 resources: @@ -16,18 +16,26 @@ services: endpoint_mode: dnsrr networks: redis: {} iblumbackend: {} portal: {} redis-init: image: docker-proxy.devhaus.com/library/redis:6-alpine command: - sh - -c - -x - apk add bind-tools && redis-cli --cluster create $$(dig +short redis | awk '{printf "%s:6379 ", $$1}') --cluster-replicas 1 --cluster-yes restart: on-failure depends_on: - redis networks: # this is needed as redis network is internal only default: {} redis: {} networks: redis: internal: true ipam: driver: default config: -
trajano revised this gist
May 31, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ services: redis-init: image: docker-proxy.devhaus.com/library/redis:6 command: redis-cli --cluster create 172.18.0.7:6379 172.18.0.2:6379 172.18.0.3:6379 172.18.0.4:6379 172.18.0.5:6379 172.18.0.6:6379 --cluster-replicas 1 --cluster-yes restart: on-failure depends_on: - redis -
trajano created this gist
May 31, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ services: redis: image: docker-proxy.devhaus.com/library/redis:6 command: - bash - -c - redis-server --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes --maxmemory $$(( $$( cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || cat /sys/fs/cgroup/memory.max ) - 100000000)) --maxmemory-policy volatile-lru healthcheck: test: ["CMD", "redis-cli", "--raw", "ping"] # This health check must be non-mutating because if there's data it won't add to the cluster. deploy: replicas: 6 resources: limits: memory: 256m endpoint_mode: dnsrr networks: redis: {} redis-init: image: docker-proxy.devhaus.com/library/redis:6 command: redis-cli --cluster create 172.18.0.7:6379 172.18.0.2:6379 172.18.0.3:6379 172.18.0.4:6379 172.18.0.5:6379 172.18.0.6:6379 --cluster-replicas 1 --raw restart: on-failure depends_on: - redis networks: redis: ipv4_address: 172.18.0.126 networks: redis: ipam: driver: default config: - subnet: 172.18.0.128/25