In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to install redis cluster". In daily operation, I believe many people have doubts about how to install redis cluster. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to install redis cluster". Next, please follow the editor to study!
Environment: ubuntu, redis-4.0.9
Create a cluster folder under the redis directory
Mkdir cluster-testcd cluster-testmkdir 7000 7001 7002 7003 7004 7005
Then copy the redis-server files in the src directory to the 7000 files 7005 directory (for convenience to start later)
Then create the redis.conf file in the 7000 files 7005 directory, configure the following parameters and save them
Pay attention to modify the port number and cluster-config-file file name in different folders
After the modification, start each node separately. If you find it troublesome, you can also write a script and start it in batches. Similar to the following
Cd 7000./redis-server redis.confcd 7001./redis-server redis.confcd 7002./redis-server redis.conf...
After startup, the above nodes are still independent, and you need to create a cluster if you want to communicate with each other.
Prior to version 5.0, you need to install ruby to create a cluster.
Ruby-v checks the ruby version, prompting that snap info ruby is not installed to view the ruby version information snap install ruby-- classic installs ruby
After installation, execute the following command
Gem install redis
If you do not execute the command and create a cluster directly, it will report
Sorry, can't connect to node 127.0.0.1:7000
After all the above has been executed, after the execution
. / redis-trib.rb create-- replicas 1 127.0.0.1VR 7000 127.0.0.1V 7001 127.0.0.1V 7002 127.0.0.1R 7003 127.0.1V 7003 127.0.1V 7004 127.0.1V 7005
If all goes well, the intermediate process will prompt for yes, which will eventually output
[OK] All 16384 slots covered.
The redis cluster is created successfully.
During installation, the step of creating a cluster is always reported
> Creating cluster [ERR] Sorry, can't connect to node 127.0.0.1v7000
At first, I refer to the official documentation, and only the following parameters are set in the redis.conf file.
Port 7000cluster-enabled yescluster-config-file nodes.confcluster-node-timeout 5000appendonly yes
Later, the number of Internet searches increased.
Protected-mode nodaemonize yes
Parameter, and delete the generated nodes.conf file, restart the redis node successfully.
At this point, the study on "how to install redis clusters" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.