In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, Xiaobian will share with you the relevant knowledge points on how to configure redis installation and master-slave replication in CentoS environment. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you will gain something after reading this article. Let's find out together.
dependent on the environment
centos 6.5
gcc-4.4.7: Compile redis source files
tcl-8.5.7: Run compile check
1. Compile redis
#cd /usr/local#tar -zxvf redis-4.0.1.tar.gz#mv redis-4.0.1 redis#cd redis#make
tcl-8.5 and above are required to run compile test make test
#yum install -y tcl#make test
2. Start redis
#cd src#./ redis-server
3. Visit redis
#cd ./ redis-cli
Recommended to install the latest version, in linux access, there are code format tips, easy to practice
>set name "redis">get name
4. master-slave replication
Deploying two redis services on a single machine
#cd /usr/local
4.1. Create redis(primary) with service port 6379
#mv redis redis-6379#mkdir redis-6380
4.2. redis serving port 6380 (slave)
#cp -r redis-6379 redis-6380#cd redis-6380
4.3. Change port and set ip and port of main redis
#vi redis.confport=6380slaveof 127.0.0.1 6379
4.4. Start master redis first and then slave redis
# cd /usr/local/redis-6379/src#./ redis-server ../ redis.conf#cd /usr/local/redis-6380/src#./ redis-server ../ redis.conf
4.5. Test master-slave redis
#./ redis-cli -p 6379>set name "redis">get nameredis>quit#./ redis-cli -p 6380>get nameredis
Tip: If testing redis master-slave replication between different servers, note that redis binding ip needs to be changed to open access ip (127.0.0.1->192.168.2.134), firewall also needs to open port
The above is "CentoS environment redis installation and master-slave replication how to configure" all the content of this article, thank you for reading! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to 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.