In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces RedisCluster how to achieve cluster installation, the article is very detailed, has a certain reference value, interested friends must read it!
1. Brief introduction of environment
Role IP port master1192.168.202.1357001master2192.168.202.1357002master3192.168.202.1357003master4192.168.202.1357004slave1192.168.202.1358001slave2192.168.202.1358002slave3192.168.202.1358003slave4192.168.202.13580042. Cluster setup 2.1 build master:70012.1.1 environment # create cluster server directory mkdir-p / usr/local/redis-cluster # create redis-master-7001mkdir / usr/local/redis-cluster/redis-master-7001
According to the redis stand-alone installation directory is: / usr/local/redis-cluster/redis-master-7001
2.1.2 modify configuration vim / usr/local/redis-cluster/redis-master-7001/reids.conf# turn off machine binding # bing 127.0.0.configure port number port 700 turn off protected mode protected-mode no# turn on daemon thread daemonize yes# turn on cluster mode cluster-enable yes2.1.3 cluster remaining machines # enter cluster environment cd / usr/local/redis-cluster# to replicate multiple rediscp -r redis-master-7001. / redis-master-7002cp-r redis-master-7001. / redis-master-7003cp-r redis-master-7001. / redis-master-7004cp-r redis-master-7001. / redis-slave-8001cp-r redis-master-7001. / redis-slave-8002cp-r redis-master-7001. / redis-slave-8003cp-r redis-master-7001. / redis-slave-8004# modifies redis port vim. / redis-master-7002/redis.confport 7002vim. / redis -master-7003/redis.confport 7003vim. / redis-master-7004/redis.confport 7004vim. / redis-slave-8001/redis.confport 8001vim. / redis-slave-8002/redis.confport 8002vim. / redis-slave-8003/redis.confport 8003vim. / redis-slave-8004/redis/redis.confport 80042.1.4 Cluster startup script # create cluster startup script vim / usr/local/redis-cluster-start/redis-cluster-start.shcd / usr/local/redis-cluster/redis -master-7001./redis-server redis.confcd / usr/local/redis-cluster/redis-master-7002./redis-server redis.confcd / usr/local/redis-cluster/redis-master-7003./redis-server redis.confcd / usr/local/redis-cluster/redis-slave-8001./redis-server redis.confcd / usr/local/redis-cluster/redis-slave-8002./redis-server redis.confcd / usr/local/redis-cluster/redis-slave-8003./redis-server redis .conf # add execute permission chmod + x redis-cluster-start.sh2.1.5 configure master / slave rule cd / usr/local/redis-cluster/redis-master-7001#-- cluster-replicas sets the slave to a Automatically assign. / redis-cli-- cluster create 192.168.202.135redis-cli 7002 192.168.202.135cluster-replicas 7002 192.168.202.135purl 7003 192.168.202.135redis-cli 8001 192.168.202.135purl 8002 192.168.202.1358003--
2.1.6 verify # enter any redis client-h IP-p port. / redis-cli-h 127.0.0.1-p 7001-c # View cluster status cluster info# view cluster node cluster nodes
Add data test effect
3. Capacity expansion 3.1 add master3.1.1 Startup + configuration # Boot Primary Node cd / usr/local/redis-cluster/redis-master-7004./redis-server redis.conf# add Master Node to Cluster cd / usr/local/redis-cluster/redis-master-7001./redis-cli-- cluster add-node 192.168.202.135usr/local/redis-cluster/redis-master-7004./redis-server redis.conf# 7004 192.168.202.135usr/local/redis-cluster/redis-master-7004./redis-server redis.conf# 7001
View cluster nodes
3.1.2 assign solt slots. / redis-cli-- cluster reshard 192.168.202.135purl 7004
Re-view slot
Add slave# Startup Slave Node / usr/local/redis-cluster/redis-slave-8004./redis-server redis.conf# add Slave Node to Cluster-its master node is 680ca3b2b889258cb1f2d2d7ff57c020e531ca34. / redis-cli-- cluster add-node 192.168.202.135680ca3b2b889258cb1f2d2d7ff57c020e531ca34 8004 192.168.202.135680ca3b2b889258cb1f2d2d7ff57c020e531ca34 7004-- cluster-slave-- cluster-master-id 680ca3b2b889258cb1f2d2d7ff57c020e531ca34
Re-view the cluster node
These are all the contents of the article "how to implement Cluster installation in RedisCluster". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.