基于docker-compose安装redis同步
编写yaml文件
version: '3.4'
services:
master:
image: redis
container_name: redis-master
restart: always
command: redis-server --port 6379 --requirepass 1234
# network_mode: "host"
ports:
- 6379:6379
slave1:
image: redis
container_name: redis-slave-1
restart: always
command: redis-server --slaveof 192.168.16.104 6379 --port 6380 --requirepass 1234 --masterauth 1234
# network_mode: "host"
ports:
- 6380:6380
slave2:
image: redis
container_name: redis-slave-2
restart: always
command: redis-server --slaveof 192.168.16.104 6379 --port 6381 --requirepass 1234 --masterauth 1234
# network_mode: "host"
ports:
- 6381:6381
作者:Ants_double
出处:https://www.cnblogs.com/ants_double/
本文版权归作者和博客园所有,欢迎转载。转载请在留言板处留言给我,且在文章标明原文链接,谢谢!
如果您觉得本篇博文对您有所收获,觉得我还算用心,请点击右下角的 [大拇指],谢谢!