当前位置:网站首页>容器化配置启动redis集群 单机6节点 3主3从
容器化配置启动redis集群 单机6节点 3主3从
2022-07-28 20:46:00 【5xp_2001】
OS:CentOS Linux release 7.9.2009 (Core)
docker-ce-20.10.12-3.el7.x86_64
1. 创建集群网卡
docker network create redis --subnet 172.38.0.0/16
2. 创建配置文件
for port in $(seq 1 6);
do
mkdir -p /mydata/redis/node-${port}/conf
touch /mydata/redis/node-${port}/conf/redis.conf
cat <<EOF>/mydata/redis/node-${port}/conf/redis.conf
port 6379
bind 0.0.0.0
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
cluster-announce-ip 172.38.0.1${port}
cluster-announce-port 6379
cluster-announce-bus-port 16379
appendonly yes
EOF
done
3.启动容器 依次启动 ,共计启动6个:
docker run -p6371:6379 -p16371:16379 --name redis-1 \
-v /mydata/redis/node-1/data:/data \
-v /mydata/redis/node-1/conf/redis.conf:/etc/redis/redis.conf \
-d --net redis --ip 172.38.0.11 redis:5.0.9-alpine3.11 redis-server /etc/redis/redis.conf
docker run -p6376:6379 -p16376:16379 --name redis-6 \
-v /mydata/redis/node-6/d
边栏推荐
- hcip实验(12)
- 79. Word search (medium string array matrix backtracking)
- [LiteratureReview]Object Detection and Mapping with Bounding Box Constraints
- Data visualization news, different forms of news reports
- Written examination summary record
- HCIP(8)
- 笔试总结记录
- 【CVPR 2021】Cylinder3D:用于LiDAR点云分割的圆柱体非对称3D卷积网络
- 静态成员static详解
- 罗克韦尔AB PLC RSLogix数字量IO模块基本介绍
猜你喜欢

Sword finger offer II 054. Sum of all values greater than or equal to nodes (medium binary search tree DFS)

普源示波器实际的使用效果怎么样

If you want to grow rapidly, you must first experience a major blow!

静态成员static详解

Alibaba cloud CDN practice

科大讯飞笔试
![[Ruiji takeout project] Day5 - Chapter 6 mobile verification code login](/img/53/c578e0d1428ea569fb412a20019924.png)
[Ruiji takeout project] Day5 - Chapter 6 mobile verification code login
![[Ruiji takeout project]day4 - dish management](/img/2a/2d9deb7a583aa37b38a67ef2c74ee7.png)
[Ruiji takeout project]day4 - dish management

2021 mathematical modeling group B exercise

SQL注入 Less38(堆叠注入)
随机推荐
Sword finger offer II 058. schedule (medium design segment tree treemap ordered set)
Sword finger offer II 057. the difference between the value and the subscript is within the given range (medium array bucket sort sliding window TreeSet)
32. Longest valid bracket (difficult stack string)
[cloud native kubernetes] mapping external service under kubernetes cluster eendpoint
Sword finger offer II 055. Binary search tree iterator (medium binary search tree iterator)
Small program canvas generates posters
2021 mathematical modeling group B code
[CS231N]Lecture_ 2:Image Classification pipelin
Lotus 1.16.0 extend sector expiration time
HCIP(9)
From Web3 to web2.5, is it backward or another way?
Necessary for in-depth learning: split the data set, split the labels according to the split pictures, and check the interval of all marked labels
HCIP第七次实验
[LiteratureReview]Object Detection and Mapping with Bounding Box Constraints
乌官员:乌克兰一半农产品经多瑙河港口出口
HCIP(8)
ECMASript 5/6 笔记
mysql create语句能不能用来建立表结构并追加新的记录
Learning notes and summary of C language programming specification
Ordinary practice of JS DOM programming