Redis——使用docker-compose.yml部署哨兵集群
2019-08-04 00:54
2616 查看
原文链接:http://www.cnblogs.com/Tractors/p/11296976.html
一、搭建服务器:
1)服务器至少三台,一主二从;
2)docker-compose.yml文件:
version: '3.1' services: master: image: redis container_name: redis-master ports: - 6379:6379 slave1: image: redis container_name: redis-slave-1 ports: - 6380:6379 command: redis-server --slaveof redis-master 6379 slave2: image: redis container_name: redis-slave-2 ports: - 6381:6379 command: redis-server --slaveof redis-master 6379
二、搭建sentinel集群:
version: '3.1' 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
转载于:https://www.cnblogs.com/Tractors/p/11296976.html
相关文章推荐
- 使用Docker Compose部署基于Sentinel的高可用Redis集群
- 使用Docker Compose部署基于Sentinel的高可用Redis集群
- 使用Docker Compose部署基于Sentinel的高可用Redis集群
- 使用 k8s/docker-compose 部署 zookeeper集群
- docker-compose一键部署redis一主二从三哨兵模式(含密码,数据持久化)
- 使用Docker Compose部署单机TiDB集群时指定版本的一个方法
- 多台宿主机使用docker部署redis集群
- docker-compose一键部署redis一主二从三哨兵模式(含密码,数据持久化)
- 从docker入门到使用docker搭建redis哨兵集群
- redis主从集群搭建及容灾部署(哨兵sentinel)
- 使用docker安装部署Spark集群来训练CNN(含Python实例)
- .NET Core容器化之多容器应用部署-使用Docker-Compose
- 使用Tomcat+Redis来实现集群部署中的Session共享问题
- Redis主从集群搭建及容灾部署(哨兵sentinel)
- 使用docker-compose 一键部署你的分布式调用链跟踪框架skywalking
- 使用docker安装部署Spark集群来训练CNN(含Python实例)
- 使用Docker构建持续集成与自动部署的Docker集群
- Linux 下Redis集群安装部署及使用详解(在线和离线两种安装+相关错误解决方案)
- 如何使用Docker、Docker-Compose和Rancher搭建部署Pipeline(四)
- 在Kubernetes集群中使用Redis部署PHP留言簿应用程序