Kaynağa Gözat

sdadsfadsfadsf

rubyangxg 4 yıl önce
ebeveyn
işleme
64f65ae9fa

+ 21 - 0
redis-sentinel/redis/docker-compose.yml

@@ -0,0 +1,21 @@
+version: '3'
+services:
+  master:
+    image: redis
+    container_name: redis-master
+    command: redis-server
+    ports:
+      - 6480:6379
+  slave1:
+    image: redis
+    container_name: redis-slave-1
+    ports:
+      - 6481:6379
+    command: redis-server --slaveof redis-master 6379
+  slave2:
+    image: redis
+    container_name: redis-slave-2
+    ports:
+      - 6482:6379
+    command: redis-server --slaveof redis-master 6379
+

+ 30 - 0
redis-sentinel/sentinel/docker-compose.yml

@@ -0,0 +1,30 @@
+version: '3'
+services:
+  sentinel1:
+    image: redis
+    container_name: redis-sentinel-1
+    ports:
+      - 26379:26379
+    command: redis-sentinel /usr/local/etc/redis/sentinel.conf
+    volumes:
+      - ./sentinel1.conf:/usr/local/etc/redis/sentinel.conf
+  sentinel2:
+    image: redis
+    container_name: redis-sentinel-2
+    ports:
+    - 26380:26379
+    command: redis-sentinel /usr/local/etc/redis/sentinel.conf
+    volumes:
+      - ./sentinel2.conf:/usr/local/etc/redis/sentinel.conf
+  sentinel3:
+    image: redis
+    container_name: redis-sentinel-3
+    ports:
+      - 26381:26379
+    command: redis-sentinel /usr/local/etc/redis/sentinel.conf
+    volumes:
+      - ./sentinel3.conf:/usr/local/etc/redis/sentinel.conf
+networks:
+  default:
+    external:
+      name: redis_default

+ 8 - 0
redis-sentinel/sentinel/sentinel.conf

@@ -0,0 +1,8 @@
+port 26379
+dir /tmp
+sentinel monitor mymaster 172.26.0.2 6379 2
+sentinel auth-pass mymaster zxcde@1
+sentinel down-after-milliseconds mymaster 30000
+sentinel parallel-syncs mymaster 1
+sentinel failover-timeout mymaster 180000
+sentinel deny-scripts-reconfig yes

+ 14 - 0
redis-sentinel/sentinel/sentinel1.conf

@@ -0,0 +1,14 @@
+port 26379
+dir "/tmp"
+sentinel myid c1d5bc05ab479807f24dc73a3bfd6f62986bd48c
+sentinel deny-scripts-reconfig yes
+sentinel monitor mymaster 172.26.0.3 6379 2
+sentinel auth-pass mymaster zxcde@1
+sentinel config-epoch mymaster 1
+sentinel leader-epoch mymaster 1
+# Generated by CONFIG REWRITE
+sentinel known-replica mymaster 172.26.0.2 6379
+sentinel known-replica mymaster 172.26.0.4 6379
+sentinel known-sentinel mymaster 172.26.0.7 26379 082905d0d92e8af9839b771183a29feeda2bff46
+sentinel known-sentinel mymaster 172.26.0.5 26379 5cf8ce9e522b640c18be002f39895df8843ea1d8
+sentinel current-epoch 1

+ 14 - 0
redis-sentinel/sentinel/sentinel2.conf

@@ -0,0 +1,14 @@
+port 26379
+dir "/tmp"
+sentinel myid 082905d0d92e8af9839b771183a29feeda2bff46
+sentinel deny-scripts-reconfig yes
+sentinel monitor mymaster 172.26.0.3 6379 2
+sentinel auth-pass mymaster zxcde@1
+sentinel config-epoch mymaster 1
+sentinel leader-epoch mymaster 1
+# Generated by CONFIG REWRITE
+sentinel known-replica mymaster 172.26.0.4 6379
+sentinel known-replica mymaster 172.26.0.2 6379
+sentinel known-sentinel mymaster 172.26.0.5 26379 5cf8ce9e522b640c18be002f39895df8843ea1d8
+sentinel known-sentinel mymaster 172.26.0.6 26379 c1d5bc05ab479807f24dc73a3bfd6f62986bd48c
+sentinel current-epoch 1

+ 14 - 0
redis-sentinel/sentinel/sentinel3.conf

@@ -0,0 +1,14 @@
+port 26379
+dir "/tmp"
+sentinel myid 5cf8ce9e522b640c18be002f39895df8843ea1d8
+sentinel deny-scripts-reconfig yes
+sentinel monitor mymaster 172.26.0.3 6379 2
+sentinel auth-pass mymaster zxcde@1
+sentinel config-epoch mymaster 1
+sentinel leader-epoch mymaster 1
+# Generated by CONFIG REWRITE
+sentinel known-replica mymaster 172.26.0.2 6379
+sentinel known-replica mymaster 172.26.0.4 6379
+sentinel known-sentinel mymaster 172.26.0.6 26379 c1d5bc05ab479807f24dc73a3bfd6f62986bd48c
+sentinel known-sentinel mymaster 172.26.0.7 26379 082905d0d92e8af9839b771183a29feeda2bff46
+sentinel current-epoch 1