Replication in Redis allows you to have a copy of your database on multiple Redis instances. This is highly useful for data redundancy and for increasing read performance. Below are the steps to enable Redis Replication.
<master-port> with your master Redis server's IP address and port respectively.
INFO replication command:
<slave-port> with your slave Redis server's IP address and port respectively. The output will provide information about the slave and its connection to the master.
Note that these commands are basic and don't include data persistence and password protection options. Depending on your needs, you may want to do additional configuration.
If the network between the master and slave fails, the slave will automatically try to reconnect to the master. Once reconnected, it will attempt to synchronize data with the master.
From Redis 2.8 onwards, there is support for partial resynchronization. This means that if a slave loses the connection with the master, it tries to partially resynchronize with the master rather than doing a full resynchronization.
These are the basic steps to enable replication in Redis. Depending on your system setup and requirements, you might need to customize these steps.