Easy Tutorial
❮ Server Client Setname Hashes Hsetnx ❯

Redis Role Command

Redis Server

The Redis Role command checks the role of a master-slave instance, which can be master, slave, or sentinel.

Syntax

The basic syntax for 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, or sentinel.

Example

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

Redis Server

❮ Server Client Setname Hashes Hsetnx ❯