Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Redis Server: ROLE

ROLE

The Redis ROLE command provides information on the role of a Redis instance in the context of replication, by returning if the instance is currently a master, slave, or sentinel.

Syntax:

ROLE

Available since

2.8.12.

Return Value

The command returns an array of elements. The first element is the role of the instance, as one of the following three strings:

  • master
  • slave
  • sentinel

Return Value Type

Array

Example: Redis ROLE

redis 127.0.0.1:6379> ROLE 
1) "master"
2) (integer) 3129659
3) 1) 1) "127.0.0.1"
      2) "9001"
      3) "3129242"
   2) 1) "127.0.0.1"
      2) "9002"
      3) "3129543"

Previous: MONITOR
Next: SAVE