当前位置:网站首页>06 redis cluster structures
06 redis cluster structures
2022-08-01 16:35:00 【blue wind 9】
Foreword
Ha ha recently there are a series of related requirements for environment construction
Record it
redis three nodes: 192.168.110.7, 192.168.110.8
7 open three redis instances, 8 open three redis instances
All three machines are trusted shell
redis is based on 5.0.8
Redis cluster building
redis two nodes: 192.168.110.7, 192.168.110.8
1. Basic environment preparation
192.168.110.7, 192.168.110.8 Install jdk on it, upload the redis installation package
The installation package is from Download | Redis
2. redis configuration adjustment
Sample 7001's configuration file below, 7001 - 7006's configuration file is similar
[[email protected] redis-5.0.8]# cat redis_7001.confprotected-mode noport 7001daemonize yessupervised nopidfile /var/run/redis_7001.pidlogfile "/var/log/redis/redis_7001.log"dir /meiya/data/redis/redis_7001appendonly yesappendfsync alwayscluster-enabled yescluster-config-file nodes_7001.confcluster-node-timeout 15000
Create startCluster.sh on 192.168.110.7 and 192.168.110.8 respectively
192.168.110.7 is as follows
./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
192.168.110.8 is as follows
# ./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-redis-cli
4. Start the cluster
Execute startCluster.sh on 192.168.110.7
Then execute startCluster.sh on 192.168.110.8
If there is no exception, the cluster will start successfully
Test cluster
[[email protected] redis-5.0.8]# ./bin/redis-cli -p 7004 -c127.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 zerryOK192.168.110.7:7003> get name"zerry"192.168.110.7:7003>
End
边栏推荐
猜你喜欢
【黑马早报】胡军代言悟空理财涉嫌欺诈,疑似涉及390亿元;涪陵榨菜回应榨菜吃出脚指甲; 鸿星尔克再捐1个亿;腾讯控股股价跌回5年前...
05 Doris cluster construction
MUI as a mobile phone to return to the action bar
华盛顿大学、Allen AI 等联合 | RealTime QA: What's the Answer Right Now?(实时 QA:现在的答案是什么?)
软件测试谈薪技巧:同为测试人员,为什么有人5K,有人 20K?
京东软件测试面试题,仅30题就已经拯救了50%的人
指针进阶(二)
Complete knapsack problem to find the number of combinations and permutations
暑气渐敛,8月让我们开源一夏!
阿里官方 Redis 开发规范
随机推荐
mysql 面试题
untiy Resorces目录动态加载资源
Meeting OA project (6) --- (to-be-opened meeting, historical meeting, all meetings)
5年测试,只会功能要求17K,功能测试都敢要求这么高薪资了?
如何有效地开发 Jmix 扩展组件
DOM系列之classList属性
14年测试人最近的面试经历,值得借鉴√
27英寸横置大屏+实体按键,全新探险者才是安全而合理的做法!
重庆银河证券股票开户安全吗,是正规的证券公司吗
【Unity,C#】哨兵点位循迹模板代码
实习日报-2022-7-29
Path helper class for C#
06 redis 集群搭建
How to Efficiently Develop Jmix Extension Components
Can MySQL do two-way synchronization of multiple vps?
LeetCode第 303 场周赛
DOM series of touch screen events
测试技术|白盒测试以及代码覆盖率实践
A full review of mainstream timed task solutions
C#的FTP帮助类