Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

0

How to programtically get info about number of members in a Cluster

asked 2017-05-10 03:36:45 -0800

sarraju gravatar image

Hi All,

Iam wondering how to get number of nodes running in the cluster from my Java Application running on one of those nodes.

Here is what i analysed so far : 1. Could not get any direct cluster API 2. I could see that i can use jolokia-client-java library and write a java program to do a GET on akka:type=Cluster but iam not still sure if that can give me the info iam looking for. Mainly i can send a GET request on localhost and not sure if akka Cluster MBean will be running all the nodes in the cluster. 3. Or do i need to make my application an Actor and then access Cluster context ?

Any pointers would be of great help. Atleast if using jolokia is the only way to programatically get access to Cluster info, mainly number of nodes running.

Regards Yugandhar

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-13 08:58:11 -0800

sarraju gravatar image

Ok, let me answer myself :-), I found one way of doing it, not sure if its the only way.

http://localhost:8080/jolokia/read/ak... -> Then read Members which lists all nodes in cluster. This way my application running on any node in cluster would know how many other nodes are running in the cluster.

8080 atleast with my Beryllium release.

Hope this helps.

Regards Yugandhar

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2017-05-10 03:36:45 -0800

Seen: 12 times

Last updated: May 13