代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/JetCache 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
version: '3.7'
services:
master:
image: "redis:${IMG_VER}"
container_name: master
command: redis-server --port 6379
network_mode: "host"
slave1:
image: "redis:${IMG_VER}"
container_name: slave1
command: redis-server --port 6380 --slaveof 127.0.0.1 6379
network_mode: "host"
slave2:
image: "redis:${IMG_VER}"
container_name: slave2
command: redis-server --port 6381 --slaveof 127.0.0.1 6379
network_mode: "host"
sentinel1:
image: "redis:${IMG_VER}"
container_name: sentinel1
command: bash -c "sleep 3;
echo port 26379 > /etc/sentinel.conf;
sed -i '$$a sentinel monitor mymaster 127.0.0.1 6379 2' /etc/sentinel.conf;
sed -i '$$a sentinel down-after-milliseconds mymaster 2000' /etc/sentinel.conf;
sed -i '$$a sentinel failover-timeout mymaster 5000' /etc/sentinel.conf;
sed -i '$$a sentinel parallel-syncs mymaster 1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-ip 127.0.0.1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-port 26379' /etc/sentinel.conf;
redis-sentinel /etc/sentinel.conf"
network_mode: "host"
sentinel2:
image: "redis:${IMG_VER}"
container_name: sentinel2
command: bash -c "sleep 3;
echo port 26380 > /etc/sentinel.conf;
sed -i '$$a sentinel monitor mymaster 127.0.0.1 6379 2' /etc/sentinel.conf;
sed -i '$$a sentinel down-after-milliseconds mymaster 2000' /etc/sentinel.conf;
sed -i '$$a sentinel failover-timeout mymaster 5000' /etc/sentinel.conf;
sed -i '$$a sentinel parallel-syncs mymaster 1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-ip 127.0.0.1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-port 26380' /etc/sentinel.conf;
redis-sentinel /etc/sentinel.conf"
network_mode: "host"
sentinel3:
image: "redis:${IMG_VER}"
container_name: sentinel3
command: bash -c "sleep 3;
echo port 26381 > /etc/sentinel.conf;
sed -i '$$a sentinel monitor mymaster 127.0.0.1 6379 2' /etc/sentinel.conf;
sed -i '$$a sentinel down-after-milliseconds mymaster 2000' /etc/sentinel.conf;
sed -i '$$a sentinel failover-timeout mymaster 5000' /etc/sentinel.conf;
sed -i '$$a sentinel parallel-syncs mymaster 1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-ip 127.0.0.1' /etc/sentinel.conf;
sed -i '$$a sentinel announce-port 26381' /etc/sentinel.conf;
redis-sentinel /etc/sentinel.conf"
network_mode: "host"
cluster1:
image: "redis:${IMG_VER}"
container_name: cluster1
command: bash -c "echo port 7000 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
cluster2:
image: "redis:${IMG_VER}"
container_name: cluster2
command: bash -c "echo port 7001 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
cluster3:
image: "redis:${IMG_VER}"
container_name: cluster3
command: bash -c "echo port 7002 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
cluster4:
image: "redis:${IMG_VER}"
container_name: cluster4
command: bash -c "echo port 7003 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
cluster5:
image: "redis:${IMG_VER}"
container_name: cluster5
command: bash -c "echo port 7004 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
cluster6:
image: "redis:${IMG_VER}"
container_name: cluster6
command: bash -c "echo port 7005 > /etc/cluster.conf;
sed -i '$$a cluster-enabled yes' /etc/cluster.conf;
sed -i '$$a cluster-config-file nodes.conf' /etc/cluster.conf;
sed -i '$$a cluster-node-timeout 5000' /etc/cluster.conf;
sed -i '$$a appendonly yes' /etc/cluster.conf;
redis-server /etc/cluster.conf"
network_mode: "host"
clusterCreator:
image: "redis:${IMG_VER}"
container_name: clusterCreator
command: bash -c "sleep 3;
echo yes | redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 --cluster-replicas 1;
echo cluster created"
network_mode: "host"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。