The Redis replication (Replication) feature is the implementation of master-slave databases.
If you want to improve the efficiency of the request, you can use the primary database for write operations, from the database for read operations. And you can use one master, multiple from.
Redis is a single-threaded program, and all events (file events and time events) are done in one thread. There are no read/write locks that can release the execution efficiency of the program. From another point of view, a single thread can run only in one CPU, without the processing power of a multicore CPU, using a master-slave database to solve processing power problems, and Redis uses I/O multiplexing technology to handle high concurrent requests.
Operation For example, the primary database IP is 10.1.1.8 port is 6327 from the database operation: ./redis-cli use command: slaveof 10.1.1.8 6327 This is set up so that you can look at the logs from the database. principle First synchronization: Synchronizing the primary database with file (DUMP.DBF) synchronization and loading files from the database Continuous synchronization: The operation of command synchronization mode, such as the main database operation of the write Operation T1,t2, T3; Write command t1,t2, T3 distributed to all the slave database, and execute these commands.
Redis Source Learning (copy Replication)