Skip to content

Commit

Permalink
MB-4043 List all server nodes within a cluster
Browse files Browse the repository at this point in the history
Extend membase cli command to print out all server ip addresses.
membase host-list -c 127.0.0.1 -u admin -p password

Change-Id: I07d5a6b8c28c7064d45f348b70c77cb6ad49169c
Reviewed-on: http://review.couchbase.org/7824
Tested-by: Bin Cui <bin.cui@gmail.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information
bcui6611 authored and steveyen committed Jul 8, 2011
1 parent cc82e3d commit 45a4232
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion listservers.py
Expand Up @@ -18,6 +18,7 @@ def __init__(self):

def runCmd(self, cmd, server, port,
user, password, opts,):
self.cmd = cmd
self.server = server
self.port = port
self.user = user
Expand Down Expand Up @@ -71,7 +72,10 @@ def getNodes(self, data):

def printNodes(self, nodes):
for node in nodes:
print '%s %s %s %s' % (node['otpNode'],
if self.cmd == "host-list":
print node['hostname']
else:
print '%s %s %s %s' % (node['otpNode'],
node['hostname'],
node['status'],
node['clusterMembership'])
1 change: 1 addition & 0 deletions membase
Expand Up @@ -65,6 +65,7 @@ def main():
usage(err)

commands = {
'host-list' : listservers.ListServers,
'server-list' : listservers.ListServers,
'server-info' : info.Info,
'server-eshell' : info.Info,
Expand Down

0 comments on commit 45a4232

Please sign in to comment.