ROLE
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
YugabyteDB only has master
role for the Redis API.
Synopsis
ROLE
This command provides information of a Redis instance, such as its role, its state of replication, its slaves, or its master. Roles are either “master”, “slave”, or “sentinel”.
- Information of a master instance may include the following.
- “master”
- An integer that represents state of replication
- An array of connected slaves { IP address, IP port, State of replication }
- Information of a slave instance may include the following.
- “slave”
- Master IP address
- Master IP port
- Connection state that is either “disconnected”, “connecting”, “sync”, or “connected”
- An integer that represents state of replication
- Information of a sentinel instance may include the following.
- “sentinel”
- An array of master names.
Return Value
Returns an array of values.
Examples
You can do this as shown below.
$ ROLE
1) "master"
2) 0
3) 1) 1) "127.0.0.1"
2) "9200"
3) "0"
2) 1) "127.0.0.1"
2) "9201"
3) "0"
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .