in a json file's ordered list of controllers. This is the controller to
be isolated.
-A file named 'cluster.json' containing a list of the IP addresses and
+A file named 'cluster.json' containing a list of the IP addresses, ports and
credentials of the controllers is required. It resides in the same
directory as monitor.py.
{
"cluster": {
"controllers": [
- "172.17.10.93",
- "172.17.10.94",
- "172.17.10.95"
+ {"ip": "172.17.10.93", "port": "8181"},
+ {"ip": "172.17.10.93", "port": "8181"},
+ {"ip": "172.17.10.93", "port": "8181"}
],
"user": "username",
- "pass": "password"
+ "pass": "password",
}
}
exit(1)
try:
cluster_list = data["cluster"]["controllers"]
+ cluster_ips = []
+ for controller in cluster_list:
+ cluster_ips.append(controller["ip"])
user_name = data["cluster"]["user"]
user_pass = data["cluster"]["pass"]
except:
print "isolating controller " + str(isolate)
-print UtilLibrary.isolate_controller(cluster_list, user_name, user_pass, isolate)
+print UtilLibrary.isolate_controller(cluster_ips, user_name, user_pass, isolate)