Skip to content

Instantly share code, notes, and snippets.

@odrianoaliveira
Last active April 20, 2018 18:49
Show Gist options
  • Save odrianoaliveira/67e5deca9c4a2f546dc80697e455d206 to your computer and use it in GitHub Desktop.
Save odrianoaliveira/67e5deca9c4a2f546dc80697e455d206 to your computer and use it in GitHub Desktop.
High Available Redis master/slave nodes with sentinel
version: '2.1'
services:
master:
image: redis:3.2-alpine
command: ["redis-server","/usr/local/etc/redis/redis.conf"]
sysctls:
net.core.somaxconn: '1024'
mem_limit: 8g
memswap_limit: 8g
mem_swappiness: 0
environment:
- TIMEZONE=America/Sao_Paulo
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/passwd:/etc/passwd:ro
- ./config/master.conf:/usr/local/etc/redis/redis.conf
network_mode: "host"
slave:
image: redis:3.2-alpine
command: ["redis-server","/usr/local/etc/redis/redis.conf"]
sysctls:
net.core.somaxconn: '1024'
mem_limit: 8g
memswap_limit: 8g
mem_swappiness: 0
environment:
- TIMEZONE=America/Sao_Paulo
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/passwd:/etc/passwd:ro
- ./config/slave.conf:/usr/local/etc/redis/redis.conf
network_mode: "host"
sentinel:
image: redis:3.2-alpine
command: ["redis-server","/usr/local/etc/redis/redis.conf"]
sysctls:
net.core.somaxconn: '1024'
mem_limit: 8g
memswap_limit: 8g
mem_swappiness: 0
environment:
- TIMEZONE=America/Sao_Paulo
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/passwd:/etc/passwd:ro
- ./config/sentinel.conf:/usr/local/etc/redis/redis.conf
network_mode: "host"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment