当前位置:网站首页>Docker deploy redis cluster
Docker deploy redis cluster
2022-06-27 02:15:00 【Operation and maintenance @ small soldier】
List of articles
One 、 establish redis_cluster bridge
docker network create redis_cluster --subnet=172.38.1.0/24 -o com.docker.network.bridge.name=redis_cluster
ifconfig redis_cluster
Two 、 Start six containers
Two containers in a group , One master, One slave,master Hang up ,slave It's going to be master
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 # Start cluster mode cluster-config-file nodes.conf # Cluster node information file cluster-node-timeout 5000 #redis The time when the node outage was discovered cluster-announce-ip 172.38.1.1${port} # Report of cluster nodes ip, prevent nat, Here is docker Containers IP cluster-announce-port 6379 # Report of cluster nodes port, prevent nat cluster-announce-bus-port 16379 # Report of cluster nodes bus-port, prevent nat appendonly yes # Turn on aof Persistence EOF
# Start at one time through script 6 individual redis Containers
docker run -p 637${port}:6379 -p 1637${port}:16379 --name redis-${port} \
-v /mydata/redis/node-${port}/data:/data \
-v /mydata/redis/node-${port}/conf/redis.conf:/etc/redis/redis.conf \
-d --net redis_cluster --ip 172.38.1.1${port} redis:6.0 redis-server /etc/redis/redis.conf
done
3、 ... and 、 Create clusters
docker exec -it redis-1 bash
redis-cli --cluster create 172.38.1.11:6379 172.38.1.12:6379 172.38.1.13:6379 172.38.1.14:6379 172.38.1.15:6379 172.38.1.16:6379 --cluster-replicas 1
redis-cli -c # Enter the cluster
cluster info # View cluster information
cluster nodes
Four 、 Uninstall the cluster
for port in $(seq 1 6); do docker rm -f redis-${port}; done
rm -rf /mydata/redis
5、 ... and 、 Reference article
边栏推荐
- Would rather go to 996 than stay at home! 24 years old, unemployed for 7 months, worse than work, no work
- Oracle/PLSQL: Rpad Function
- 消费者追捧iPhone,在于它的性价比超越国产手机
- Oracle/PLSQL: To_ Clob Function
- YaLM 100B:来自俄罗斯Yandex的1000亿参数开源大模型,允许商业用途
- Oracle/PLSQL: CharToRowid Function
- Oracle/PLSQL: HexToRaw Function
- Flink学习4:flink技术栈
- Memcached foundation 9
- Simply learn the entry-level concepts of googlecolab
猜你喜欢
为什么传递SPIF_SENDCHANGE标志SystemParametersInfo会挂起?
DAMA、DCMM等数据管理框架各个能力域的划分是否合理?有内在逻辑吗?
What if asreml-r does not converge in operation?
Flink学习1:简介
Flink学习4:flink技术栈
Hot discussion: what are you doing for a meaningless job with a monthly salary of 18000?
Reading a book in idea is too much!
Flink学习2:应用场景
canvas粒子篇之鼠标跟随js特效
TechSmith Camtasia最新2022版详细功能讲解下载
随机推荐
Oracle/PLSQL: Upper Function
Oracle/PLSQL: Trim Function
Why divide the training set and the test set before normalization?
Memcached basics 11
Flink learning 1: Introduction
Oracle/PLSQL: Trim Function
Parameter estimation -- Chapter 7 study report of probability theory and mathematical statistics (point estimation)
Is the division of each capability domain of Dama, dcmm and other data management frameworks reasonable? Is there internal logic?
“所有专业都在劝退”,对大学生最友好的竟然是它?
LeetCode 785:判断二分图
宁愿去996也不要待业在家啦!24岁,失业7个月,比上班更惨的,是没班可上
Precautions for using sneakemake
Memcached foundations 12
为什么传递SPIF_SENDCHANGE标志SystemParametersInfo会挂起?
Svg drag dress Kitty Cat
docker部署redis集群
Yalm 100b: 100billion parameter open source large model from yandex, Russia, allowing commercial use
Hot discussion: what are you doing for a meaningless job with a monthly salary of 18000?
memcached基础11
Flink學習2:應用場景