Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

How to find if GSA is deployed on a particular host

Hi Team,

I have to deploy grid on 5 hosts

I understand that we can use admin api to find GSAs using the below method

admin.getGridServiceAgents.waitFor(numberOfAgent, 5, TimeUnit.SECONDS)

However this does not allows me to find if GSA is hosted on a particular host or not. I want a clean way to find if GSA is hosted on a particular host irrespective of whether on other hosts GSA is deployed or not ?

Is there any way to achieve that ?

asked 2017-11-13 07:56:14 -0500

Harvey gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Does this code snippet help?

admin.getGridServiceAgents().waitFor(numberOfAgents, 5, TimeUnit.SECONDS);
GridServiceAgents gsas = admin.getGridServiceAgents();

Map<String, GridServiceAgent> map = gsas.getHostNames();
Iterator<Map.Entry<String,GridServiceAgent>> iter = map.entrySet().iterator();
while( iter.hasNext() ) {
    Map.Entry<String, GridServiceAgent> entry = iter.next();
    System.out.println("hostName: " + entry.getKey() + ", gridServiceAgent: " + entry.getValue());

answered 2017-11-13 09:49:37 -0500

Dixson Huie gravatar image
edit flag offensive delete link more


i did the exactly same thing, however ot means waiting for all hosts until timeout... while i need to know abt only 1 host

Harvey gravatar imageHarvey ( 2017-11-13 10:44:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-11-13 07:56:14 -0500

Seen: 284 times

Last updated: Nov 13 '17