redis master-slave synchronization

Master-slave replication process:

  establish a connection with the slave master. Send sync command.

  master starts a background process, database snapshots are saved to a file, while the main master process will begin collecting new command and cache.

  After the completion of the background to save, you send the file to the slave.

  Save the file to your hard drive slave.

1. The primary server to set up your own password (closed selinux, open ports)

2. modify the configuration file from the server

# Replicaof <masterip> <masterport> ip # master server and port 
replicaof 192.168 . 80.133  6379 

# masterauth <-Master password> # master password 
masterauth 123456

3. Restart the server and test.

Guess you like

Origin www.cnblogs.com/sswind/p/12122932.html
Recommended