What are the steps for setting up a Redis master-slave configuration?

Setting up Redis master-slave replication involves the following steps:

  1. Modify the configuration file on the Redis master instance by setting the slaveof option to the IP address and port number of the slave instance. For example: slaveof
  2. Restart the main instance of Redis to apply the configuration changes.
  3. Modify the configuration file on the Redis slave instance by setting the “slaveof” option to the IP address and port number of the master instance. For example: slaveof .
  4. Restart the Redis slave instance to apply the configuration.
  5. You can use the command INFO replication to check if the master-slave relationship has been successfully established.

Note: When setting up master-slave replication, the data from the master instance will be copied to the slave instance, making the slave instance a full copy of the master instance.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds