How it works...

In the Getting ready section, we updated the configuration file to instruct the slave server to run on port 6380 and use a different working directory to the master server. The new line slave of 127.0.0.1 6379 we added to redis-slave.conf indicates that the server that listens on port 6380 is a slave of 127.0.0.1:6379. In addition, SLAVEOF is a command that can be executed in redis-cli to make the current Redis Server a slave of another instance on-the-fly.

The INFO command prints out the current server's information. In step 4, we used INFO REPLICATION to check whether the replication link is established. Most replication information items are self-explanatory. The master_replid is a random string generated on the master ...

Get Redis 4.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.