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

Ask Your Question
0

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 -0600

Harvey gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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 -0600

Dixson Huie gravatar image
edit flag offensive delete link more

Comments

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 -0600 )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

Stats

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

Seen: 170 times

Last updated: Nov 13