Redis › Redis Replication
How do you check the current replication status and role of a specific Redis instance, whether it is acting as a primary or a replica?
IntermediateAnswer
You use the INFO REPLICATION command, which shows whether the instance is currently acting as a master or a replica, lists any connected replicas if it is a master, or shows the primary it is following along with the current replication offset and lag if it is itself a replica.
redis-cli info replicationReal-world example A team troubleshooting a replication issue checks INFO REPLICATION on both servers, confirming the replica is correctly connected to the intended primary and identifying the current replication offset on each side.