English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Role Command

Redis Server

The Redis Role command can be used to view the role of a master, slave, or 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.

Online Examples

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

Redis Server