当前位置:网站首页>Configuration principle and process of redis master-slave replication
Configuration principle and process of redis master-slave replication
2022-07-21 22:49:00 【weixin_ forty-six million six hundred and eighty-five thousand 】
One . Master slave replication configuration preparation
1. clone 3 platform linux host
Two . Principle of master-slave replication configuration
- redis The replication function of is to support data synchronization among multiple databases . One is the main database (master) One is from the database (slave), The main database can be read and write , Automatically synchronize the data to the slave database when the write operation occurs , And the slave database is generally read-only , And receive the data synchronized from the main database , A master database can have more than one slave database , A slave database can only have one master database .
- adopt redis The copy function of can well realize the separation of reading and writing of database , Increase the load capacity of the server . The main database is mainly written , And reading from the database .
- The main database has read and write permission 、 Only read permission from the library
3、 ... and 、 Master slave replication configuration
Change from redis Medium redis.conf file , Slave synchronization master , So just follow
1.slaveof [masterIp] [masterport] 5.0.8 following To configure
replicaof <masterip> <masterport> 5.0.8 above To configure
2.slaveof 192.168.33.201 6379 5.0.8 following To configure
replicaof 172.16.141.201 6379 5.0.8 above To configure
3.masterauth 123456--- Lord redis The server is configured with a password , You need to configure .
Be sure to remember 2 spot :
The first 1 spot : Use root Account ;
The first 2 spot : Turn off firewall
Four . Verify master-slave replication
Host operation
start-up redis :./redis-server ../redis.conf
Sign in redis: ./redis-cli -a -root
Set up namee The key/value pair :set namee jianzi
Slave operation
start-up redis :./redis-server ../redis.conf
Sign in redis: ./redis-cli -a -root
obtain namee The key/value pair :jianzi
Be accomplished !!!
边栏推荐
猜你喜欢
随机推荐
016: simple calculator
STL preliminary understanding
VMware虚拟机网络模式之NAT模式
2021 popularization group summary
Cocos Creator 3. X draw sector mesh components
Probability theory - maximum likelihood estimation
Redis主从复制的配置原理和过程
第二周ACM训练报告
D3D函数说明
[oops framework] supporting hot update plug-ins
2022acm summer training weekly report (I)
寒假学习总结
左倾堆的C#实现
【oops-framework】资源管理
小实操:实现Myarray
006: floating point data type storage space size
2022ACM夏季集训周报(二)
力扣记录:动态规划5子序列问题(1)——300 最长上升子序列,1143 最长公共子序列,1035 不相交的线,674 最长连续递增序列,718 最长重复子数组,53 最大子序和
MySql the first
Fourth week ACM training report