How to configure the master and slave of redis

If the pseudo master and slave can copy redis.conf

Then modify the data

Modify the relevant configuration to the following values:

Modify the relevant configuration to the following values:
 port 6380
 pidfile /var/run/redis_6380.pid6 logfile "6380.log"
 dir /usr/local/redis‐5.0.3/data/6380
 
 3. Configure master-slave replication
 replicaof 192.168.0.60 6379 # Copy data from the local 6379 redis instance
 replica‐read‐only yes
 
 4. Start the slave node
 redis‐server redis.conf
 
 5. Connect slave nodes
 redis ‐ cli ‐p 6380
 
 6. Test whether data is written on the 6379 instance, and whether the 6380 instance can synchronize the newly modified data in time
 
 7. You can configure a 6381 slave node yourself
 
 
but
If it is Allah and Slave, two servers, then you must modify the bind to 0.0.0.0
 
 
 
 

Guess you like

Origin www.cnblogs.com/xiaosisong/p/12706382.html