From adbfd4b945d6a169b2ed48e59c4d5c74edc564b9 Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 3 Feb 2015 14:22:12 +0800 Subject: [PATCH] add role command doc --- cmd/ledis-cli/const.go | 3 ++- doc/commands.json | 6 ++++++ doc/commands.md | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/cmd/ledis-cli/const.go b/cmd/ledis-cli/const.go index b5265d6..54554c7 100644 --- a/cmd/ledis-cli/const.go +++ b/cmd/ledis-cli/const.go @@ -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"}, diff --git a/doc/commands.json b/doc/commands.json index 7d7e84a..abbd4f1 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -788,5 +788,11 @@ "arguments" : "key ttl value", "group" : "Server", "readonly" : false + }, + + "ROLE": { + "arguments" : "-", + "group" : "Server", + "readonly" : true } } diff --git a/doc/commands.md b/doc/commands.md index 1471b0a..1cde082 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -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