Change cluster monitor.py to not require that all
nodes have the same shards. This is useful for
monitoring large clusters that have small
replication factors.
Change-Id: I20d437b3b3bc21f65fdc0e496b6c1b38e23f95b5
Signed-off-by: Gary Wu <Gary.Wu1@huawei.com>
Updated: 2015-May-07
This tool provides real-time visualization of the cluster member roles for all
Updated: 2015-May-07
This tool provides real-time visualization of the cluster member roles for all
-shards in the config datastore. It is assumed that all cluster members have the
-same shards.
+shards in the config datastore.
A file named 'cluster.json' contaning a list of the IP addresses of the
controllers is required. This resides in the same directory as monitor.py.
A file named 'cluster.json' contaning a list of the IP addresses of the
controllers is required. This resides in the same directory as monitor.py.
exit(1)
controller_names = []
exit(1)
controller_names = []
# Retrieve controller names and shard names.
for controller in controllers:
url = "http://" + controller + ":8181/jolokia/read/org.opendaylight.controller:"
# Retrieve controller names and shard names.
for controller in controllers:
url = "http://" + controller + ":8181/jolokia/read/org.opendaylight.controller:"
print pos
print name[:8]
controller_names.append(name[:name.find('-shard-')])
print pos
print name[:8]
controller_names.append(name[:name.find('-shard-')])
+
+ # collect shards found in any controller; does not require all controllers to have the same shards
+ for localShard in data['value']['LocalShards']:
+ shardName = localShard[(localShard.find("-shard-")+7):localShard.find("-config")]
+ Shards.add(shardName)
-# Putting shard names in a list, assuming all controllers have the same shards.
-Shards = data['value']['LocalShards']
-for i, shard in enumerate(Shards):
- Shards[i] = Shards[i].replace('member-', '')
- Shards[i] = Shards[i].replace('-shard-', '')
- Shards[i] = Shards[i].replace('-config', '')
- Shards[i] = Shards[i].replace(Shards[i][0], '')
print Shards
stdscr = curses.initscr()
print Shards
stdscr = curses.initscr()
This tool provides real-time visualization of the cluster member roles for all
shards in the config datastore. It is useful for understanding cluster behavior
This tool provides real-time visualization of the cluster member roles for all
shards in the config datastore. It is useful for understanding cluster behavior
-in when controllers are isolated, downed, or rebooted. The tool assumes that all
-cluster members have the same shards.
+in when controllers are isolated, downed, or rebooted.
A file named 'cluster.json' containg a list of the IP addresses of the
controllers is required. This resides in the same directory as monitor.py.
A file named 'cluster.json' containg a list of the IP addresses of the
controllers is required. This resides in the same directory as monitor.py.
- Add operational shards.
\ No newline at end of file
+ Add operational shards.