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 > Database >
Share
Shulou(Shulou.com)06/01 Report--
Introduction to 1.redis master-slave replication:
Persistence ensures that data will not be lost even if the redis server is restarted, because the redis server restarts and restores the persisted data on the hard disk to memory
However, when the hard disk of the redis server is damaged, it may lead to data loss, and this single point of failure can be avoided through the master-slave replication mechanism of redis.
As shown below:
Explanation:
There are two copies of the data of the master redis, namely, the slave node redis1 and the slave node redis2. Even if one redis server goes down, the other two servers can continue to provide real-time synchronization between using the data in the master redis and saving the data on the slave redis. When the master redis writes data, it will copy the written data through the master-slave replication mechanism to the other slave redis that there is only one master redis, and there can be multiple slave redis master-slave replication without blocking master. Master can continue to process the request host of client. Once the add, delete and modify operation occurs, the slave node cannot perform write operation when synchronizing the data. A redis can be both master and slave: as shown in the figure
two。 Related configurations of master-slave replication
Note: in master-slave replication, the master node does not need to be configured, all configurations are in the slave node.
① replicates the redis services of the primary node to other nodes
The scp command is used here, scp-r.. /.. / redis-3.0.0 hostname:/dir
② modifies the redis.conf file in the slave node:
Configure slaveof 192.168.242.137 6379
③ clears persistent files from the slave
[root@hdp01 bin2] # rm-rf appendonly.aof dump.rdb
④ boot slave
[root@hdp01 bin2] # / redis-server redis.conf (here it is started in each slave node's machine)
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.