当前位置:网站首页>06 redis 集群搭建
06 redis 集群搭建
2022-08-01 16:19:00 【蓝风9】
前言
呵呵 最近有一系列环境搭建的相关需求
记录一下
redis 三个节点 : 192.168.110.7, 192.168.110.8
7 开三个 redis 实例, 8 开三个 redis 实例
三台机器都做了 trusted shell
redis 基于 5.0.8
redis 集群搭建
redis 两个节点 : 192.168.110.7, 192.168.110.8
1. 基础环境准备
192.168.110.7, 192.168.110.8 上面安装 jdk, 上传 redis 的安装包
安装包来自于 Download | Redis
2. redis 配置调整
如下采样 7001 的配置文件, 7001 - 7006 的配置文件类似
[[email protected] redis-5.0.8]# cat redis_7001.conf
protected-mode no
port 7001
daemonize yes
supervised no
pidfile /var/run/redis_7001.pid
logfile "/var/log/redis/redis_7001.log"
dir /meiya/data/redis/redis_7001
appendonly yes
appendfsync always
cluster-enabled yes
cluster-config-file nodes_7001.conf
cluster-node-timeout 15000
192.168.110.7 和 192.168.110.8 上面分别创建 startCluster.sh
192.168.110.7 如下
./bin/redis-server ./redis_7001.conf
./bin/redis-server ./redis_7002.conf
./bin/redis-server ./redis_7003.conf
#./bin/redis-server ./redis_7004.conf
#./bin/redis-server ./redis_7005.conf
#./bin/redis-server ./redis_7006.conf
#./bin/redis-cli --cluster create 192.168.110.7:7001 192.168.110.7:7002 192.168.110.7:7003 192.168.110.8:7004 192.168.110.8:7005 192.168.110.8:7006 --cluster-replicas 1
192.168.110.8 如下
# ./bin/redis-server ./redis_7001.conf
# ./bin/redis-server ./redis_7002.conf
# ./bin/redis-server ./redis_7003.conf
./bin/redis-server ./redis_7004.conf
./bin/redis-server ./redis_7005.conf
./bin/redis-server ./redis_7006.conf
./bin/redis-cli --cluster create 192.168.110.7:7001 192.168.110.7:7002 192.168.110.7:7003 192.168.110.8:7004 192.168.110.8:7005 192.168.110.8:7006 --cluster-replicas 1
4. 启动集群
在 192.168.110.7 上面执行 startCluster.sh
然后在 192.168.110.8 上面执行 startCluster.sh
如果没有异常的话, 集群会启动成功
测试集群
[[email protected] redis-5.0.8]# ./bin/redis-cli -p 7004 -c
127.0.0.1:7004> get name
-> Redirected to slot [5798] located at 192.168.110.7:7003
"jerry"
192.168.110.7:7003> get name
"jerry"
192.168.110.7:7003> set name zerry
OK
192.168.110.7:7003> get name
"zerry"
192.168.110.7:7003>
完
边栏推荐
猜你喜欢
随机推荐
Use Canvas to implement mobile phone signature
27英寸横置大屏+实体按键,全新探险者才是安全而合理的做法
美国弗吉尼亚大学、微软 | Active Data Pattern Extraction Attacks on Generative Language Models(对生成语言模型的主动数据模式提取攻击)
"Find nearby shops" | Geohash+MySQL realizes geographic location filtering
MySQL data processing of authorization 】 【
主流定时任务解决方案全横评
【建议收藏】技术面必考题:多线程、多进程
pwnhome 个人博客快速索引(持续更新)
LeetCode50天刷题计划(Day 8—— 盛最多水的容器(23.00-1.20)
预定义和自定义
p5js炫酷网页流光动画
使用Canvas 实现手机端签名
Spark: Cluster Computing with Working Sets
The untiy Resources directory dynamically loads resources
eslint语法报错解决
ESP8266-Arduino programming example-GA1A12S202 logarithmic scale analog light sensor
30分钟成为Contributor|如何多方位参与OpenHarmony开源贡献?
14年测试人最近的面试经历,值得借鉴√
VIM实用指南(3)复制,粘贴 ,删除,撤销,重做指令速记
南京科技大学、中国电子科技第28研究所等联合|MLRIP: Pre-training a military language representation model with informative factual knowledge and professional knowledge base(预训练具有丰富事实知识和专业知识库的军事语言表示模型)









