当前位置:网站首页>Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
2022-07-28 22:31:00 【5xp_ two thousand and one】
OS:CentOS Linux release 7.9.2009 (Core)
docker-ce-20.10.12-3.el7.x86_64
1. Create cluster network card
docker network create redis --subnet 172.38.0.0/16
2. create profile
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. Start the container Start in turn , A total of 6 individual :
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
边栏推荐
猜你喜欢
随机推荐
Sword finger offer II 052. flatten binary search tree (simple binary search tree DFS)
JMeter installs third-party plug-ins plugins Manager
Sword finger offer II 058. schedule (medium design segment tree treemap ordered set)
ngx+sql环境离线安装日志(rpm安装)
Excel-VBA 快速上手(十三、日期的常见用法)
MySQL installation and configuration (super detailed, simple and practical)
Can the MySQL create statement be used to create a table structure and append new records
Use REM to make the font size adaptive to the screen
Jmeter 安装第三方插件 Plugins Manager
[CVPR 2021] cylinder3d: cylindrical asymmetric 3D convolution network for LIDAR point cloud segmentation
32. Longest valid bracket (difficult stack string)
Hcip experiment (15)
(翻译)图技术简明历史
Mysql内置函数
容器化配置启动redis集群 单机6节点 3主3从
npm ERR code ETIMEDOUT npm ERR syscall connect npm ERR errno ETIMEDOUT npm ERR network reques...
JS array merging, de duplication, dimensionality reduction (es6: extended operator, set)
Static route and default route experiment
HCIP第七次实验
Ruiji takeout project - development of business development function Day2









