当前位置:网站首页>Redis distributed cluster setup
Redis distributed cluster setup
2022-06-13 08:40:00 【T Haohao】
redis edition 6.0.6 Cluster version 3 Lord 3 from
Preparation stage
1. Download from the official website redis Installation package
2. Unzip to the specified folder
3. Enter the extracted installation package to install redis
Installation phase
And create 6 A folder 7000 70001 7002 7003 7004 7005
make install PREFIX=/usr/local/app/redis/7000When installed, will /usr/local/app/redis/7000/* Copy to several other folders
cp -r /usr/local/app/redis/7000/* /usr/local/app/redis/7001The configuration phase
# Profile streamlined , The complete configuration can be self-made and officially provided conf Compare the documents . The port number is modified accordingly
# Background startup means
daemonize yes
# Port number
port 7000
# IP binding ,redis It is not recommended to open to the public network , The private network of the server is bound here IP And loopback address
bind 172.17.0.13 127.0.0.1
# redis The directory where the data files are stored
dir /redis/workingDir
# Log files
logfile "/redis/logs/cluster-node-7000.log"
# Turn on AOF
appendonly yes
# Open clusters
cluster-enabled yes
# Cluster persistence profile , The content contains the status of other nodes , Persistent variables, etc , Will automatically generate the configuration above dir Under the table of contents
cluster-config-file cluster-node-6381.conf
# The maximum time that a cluster node is unavailable ( millisecond ), If the master node is not reachable within the specified time , Then failover will occur
cluster-node-timeout 5000
# The public network must be specified for deployment on the ECS ip
cluster-announce-ip 122.51.151.130
# Redis Bus port , Used to communicate with other nodes
cluster-announce-bus-port 17000
start-up redis( You can create shell The script starts directly )
touch redis-start.sh
vi redis-start.shcd /usr/local/app/redis/7000/bin
redis-server redis.conf
cd /usr/local/app/redis/7001/bin
redis-server redis.conf
cd /usr/local/app/redis/7002/bin
redis-server redis.conf
cd /usr/local/app/redis/7003/bin
redis-server redis.conf
cd /usr/local/app/redis/7004/bin
redis-server redis.conf
cd /usr/local/app/redis/7005/bin
redis-server redis.conf Modify file permissions
chmod u+x redis-start.sh
Executable files
./redis-start.sh
see redis Start state
ps aux|grep redisestablish redis colony
Get into /usr/local/app/redis/7000/bin
./redis-cli --cluster create 192.168.0.80:7000 192.168.0.80:7001 192.168.0.80:7002 192.168.0.80:7003 192.168.0.80:7004 192.168.0.80:7005 --cluster-replicas 1
View the cluster status
cat nodes.confConfiguration is complete
Using client Using a cluster requires adding -c
./redis-cli -h 127.0.0.1 -p 7000 -c
Be careful : The firewall and server access rules need to be added 7000 17000 port , The same is true for several other ports
边栏推荐
- 淘宝商品销量接口/淘宝商品销量监控接口/商品累计销量接口
- HCIP_ Static experiment
- Wrap dynamically created child elements in dynamically created structures
- [notes] like the solution to the problem of slow query (index + explicitly specifying query fields)
- Mysql_ Preliminary summary of database data (Continued)
- Logstash failed to create queue
- MySQL installation and configuration under Windows
- VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
- WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
- Notes on MySQL transaction not automatically submitting
猜你喜欢

Invalid flex layout setting width

Document contains question type

Form exercise 2

Buuctf web (VII)

File upload question type

The method of SolidWorks modifying text font in engineering drawing

Microservice system architecture construction I: Environment Construction

Buffer Overflow Vulnerability Lab

4、 Js-es5-i / O

centos 安装mysql及设置远程访问
随机推荐
Microservice project construction III: automatic code generation
Svg text stroke effect
5、 Constant, variable
Bidirectional retransmission step experiment
Four ways to install MySQL in Linux
JS to download files in batches
In order to resist the flood, the soldiers have been fighting for 89 hours. How many days and hours are there in total?
WARNING:tornado.access:404 GET /favicon.ico (172.16.8.1) 1.84ms [附静态文件设置]
MySQL parsing serialized fields
PHP PNG to webp
8、 JS data type conversion
Guidance process and service control
Data accuracy problems caused by inconsistent data types during sum in MySQL
Differences and uses among cookies, localstorage, sessionstorage, and application caching
学习记录4: einops // cudnn.benchamark=true // hook
JS ask for the day of the year
抖音关键词搜索列表接口,超详细的接口对接步骤
Three methods to make the scroll bar of div automatically scroll to the bottom
JS - for cycle case: Horse grain
MySQL query exercise 3