-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To quickly launch Redis services like: single instance, master + replicas and sentinel group
- Loading branch information
Showing
6 changed files
with
120 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
version: '3' | ||
services: | ||
redis-master: | ||
image: redis:6.2-alpine | ||
container_name: redis-master | ||
network_mode: "host" | ||
ports: | ||
- "6379:6379" | ||
command: [ redis-server, --port, "6379" ] | ||
|
||
redis-replica1: | ||
image: redis:6.2-alpine | ||
container_name: redis-replica1 | ||
network_mode: "host" | ||
ports: | ||
- "6380:6380" | ||
command: [ redis-server, --slaveof, localhost, "6379", --port, "6380" ] | ||
|
||
redis-replica2: | ||
image: redis:6.2-alpine | ||
container_name: redis-replica2 | ||
network_mode: "host" | ||
ports: | ||
- "6381:6381" | ||
command: [ redis-server, --slaveof, localhost, "6379", --port, "6381" ] | ||
|
||
redis-sentinel1: | ||
image: redis:6.2-alpine | ||
container_name: redis-sentinel1 | ||
network_mode: "host" | ||
ports: | ||
- "26379:26379" | ||
volumes: | ||
- ./sentinel1:/data:Z | ||
command: [ redis-server, /data/sentinel1.conf, --sentinel, --port, "26379" ] | ||
|
||
redis-sentinel2: | ||
image: redis:6.2-alpine | ||
container_name: redis-sentinel2 | ||
network_mode: "host" | ||
ports: | ||
- "26380:26380" | ||
volumes: | ||
- ./sentinel2:/data:Z | ||
command: [ redis-server, /data/sentinel2.conf, --sentinel, --port, "26380" ] | ||
|
||
redis-sentinel3: | ||
image: redis:6.2-alpine | ||
container_name: redis-sentinel3 | ||
network_mode: "host" | ||
ports: | ||
- "26381:26381" | ||
volumes: | ||
- ./sentinel3:/data:Z | ||
command: [ redis-server, /data/sentinel3.conf, --sentinel, --port, "26381" ] | ||
|
||
redis-shard1: | ||
image: redis:6.2-alpine | ||
container_name: redis-shard1 | ||
network_mode: "host" | ||
ports: | ||
- "6382:6382" | ||
command: [ redis-server, --port, "6382" ] | ||
|
||
redis-shard2: | ||
image: redis:6.2-alpine | ||
container_name: redis-shard2 | ||
network_mode: "host" | ||
ports: | ||
- "6383:6383" | ||
command: [ redis-server, --port, "6383" ] | ||
|
||
redis-shard3: | ||
image: redis:6.2-alpine | ||
container_name: redis-shard3 | ||
network_mode: "host" | ||
ports: | ||
- "6384:6384" | ||
command: [ redis-server, --port, "6384" ] | ||
|
||
twemproxy: | ||
image: quay.io/3scale/twemproxy:v0.5.0 | ||
container_name: twemproxy | ||
network_mode: "host" | ||
environment: | ||
- TWEMPROXY_CONFIG_FILE=/etc/twemproxy/nutcracker.yml | ||
ports: | ||
- "22121:22121" | ||
volumes: | ||
- ./twemproxy.yml:/etc/twemproxy/nutcracker.yml:Z |
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,4 @@ | ||
port 26379 | ||
sentinel monitor redis-master ::1 6379 2 | ||
sentinel down-after-milliseconds redis-master 5000 | ||
sentinel failover-timeout redis-master 60000 |
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,4 @@ | ||
port 26380 | ||
sentinel monitor redis-master ::1 6379 2 | ||
sentinel down-after-milliseconds redis-master 5000 | ||
sentinel failover-timeout redis-master 60000 |
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,4 @@ | ||
port 26381 | ||
sentinel monitor redis-master ::1 6379 2 | ||
sentinel down-after-milliseconds redis-master 5000 | ||
sentinel failover-timeout redis-master 60000 |
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,13 @@ | ||
alpha: | ||
listen: 127.0.0.1:22121 | ||
hash: fnv1a_64 | ||
hash_tag: "{}" | ||
distribution: ketama | ||
auto_eject_hosts: true | ||
redis: true | ||
server_retry_timeout: 2000 | ||
server_failure_limit: 1 | ||
servers: | ||
- 127.0.0.1:6382:1 shard1 | ||
- 127.0.0.1:6383:1 shard2 | ||
- 127.0.0.1:6384:1 shard3 |