ソースを参照

update ha/redis

reghao 3 週間 前
コミット
3a2218a80b

+ 2 - 4
ha/redis/docker-compose1.yml

@@ -3,8 +3,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: redis-master
     restart: always
-    ports:
-      - "6379:6379"
+    network_mode: host
     # 开启 AOF 持久化(生产环境建议开启)
     command: redis-server /etc/redis/redis.conf --appendonly yes
     volumes:
@@ -37,8 +36,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: sentinel-1
     restart: always
-    ports:
-      - "26379:26379"
+    network_mode: host
     command: redis-sentinel /etc/redis/sentinel.conf
     volumes:
       - /etc/localtime:/etc/localtime:ro

+ 2 - 4
ha/redis/docker-compose2.yml

@@ -3,8 +3,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: redis-slave-1
     restart: always
-    ports:
-      - "6379:6379"
+    network_mode: host
     volumes:
       - /etc/localtime:/etc/localtime:ro
       - /opt/docker/redis/redis.conf:/etc/redis/redis.conf
@@ -37,8 +36,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: sentinel-2
     restart: always
-    ports:
-      - "26379:26379"
+    network_mode: host
     command: redis-sentinel /etc/redis/sentinel.conf
     volumes:
       - /etc/localtime:/etc/localtime:ro

+ 2 - 4
ha/redis/docker-compose3.yml

@@ -3,8 +3,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: redis-slave-2
     restart: always
-    ports:
-      - "6379:6379"
+    network_mode: host
     volumes:
       - /etc/localtime:/etc/localtime:ro
       - /opt/docker/redis/redis.conf:/etc/redis/redis.conf
@@ -36,8 +35,7 @@ services:
     image: registry.cn-chengdu.aliyuncs.com/reghao/redis:6.0.16-bullseye
     container_name: sentinel-3
     restart: always
-    ports:
-      - "26379:26379"
+    network_mode: host
     command: redis-sentinel /etc/redis/sentinel.conf
     volumes:
       - /etc/localtime:/etc/localtime:ro