add role command doc

This commit is contained in:
siddontang 2015-02-03 14:22:12 +08:00
parent fb9d8cc527
commit adbfd4b945
3 changed files with 48 additions and 1 deletions

View File

@ -1,4 +1,4 @@
//This file was generated by .tools/generate_commands.py on Sat Jan 24 2015 10:59:30 +0800
//This file was generated by .tools/generate_commands.py on Tue Feb 03 2015 14:21:53 +0800
package main
var helpCommands = [][]string{
@ -77,6 +77,7 @@ var helpCommands = [][]string{
{"PERSIST", "key", "KV"},
{"PING", "-", "Server"},
{"RESTORE", "key ttl value", "Server"},
{"ROLE", "-", "Server"},
{"ROLLBACK", "-", "Transaction"},
{"RPOP", "key", "List"},
{"RPUSH", "key value [value ...]", "List"},

View File

@ -788,5 +788,11 @@
"arguments" : "key ttl value",
"group" : "Server",
"readonly" : false
},
"ROLE": {
"arguments" : "-",
"group" : "Server",
"readonly" : true
}
}

View File

@ -159,6 +159,7 @@ Table of Contents
- [TIME](#time)
- [CONFIG REWRITE](#config-rewrite)
- [RESTORE key ttl value](#restore-key-ttl-value)
- [ROLE](#role)
- [Transaction](#transaction)
- [BEGIN](#begin)
- [ROLLBACK](#rollback)
@ -2838,6 +2839,45 @@ If ttl is 0 the key is created without any expire, otherwise the specified expir
RESTORE checks the RDB version and data checksum. If they don't match an error is returned.
### ROLE
Provide information on the role of an intance in the context of replication.
Role: master and slave
Master output:
```
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"
```
1. The string master.
2. The current master replication binlog last log id.
3. An array about the slaves, each sub array contains slave IP, port, and the last acknowledged replication binlog id.
Slave output:
```
1) "slave"
2) "127.0.0.1"
3) (integer) 9000
4) "connected"
5) (integer) 3167038
```
1. The string slave
2. The slave IP
3. The slave port
4. The slave replication state, includes connect, connecting, sync and connected.
5. The slave current replication binlog id.
## Transaction
### BEGIN