Redis Role Command

Redis Server

The Redis Role command checks the role of the master and slave instances. The roles are master, slave, sentinel.

Syntax

The basic syntax of the Redis Role command is as follows:

redis 127.0.0.1:6379> ROLE 

Available versions

>= 2.8.12

Return value

Returns an array: the first parameter is one of master, slave, sentinel.

Example

redis 127.0.0.1:6379> ROLE 
1) "master"
2) (integer) 0
3) (empty list or set)
redis> 

Redis Server

Other extensions