s'-wh
s'-wh

Reputation: 29

GridGain - programmatically opening nodes using SSH through Grid.startNodes API

I am using Grid.startNodes(java.util.Collection, java.util.Map, boolean, int, int) as defined here: http://gridgain.com/api/javadoc/org/gridgain/grid/Grid.html#startNodes(java.util.Collection, java.util.Map, boolean, int, int)

Code I am using:

GridConfiguration cfg = GridCfgGenerator.GetConfigurations(true);
Grid grid = GridGain.start(cfg);

Collection<Map<String,Object>> coll = new ArrayList<>();

Map<String, Object> host = new HashMap<String, Object>();
//host.put("host", "23.101.201.136");
host.put("host", "10.0.0.4");
host.put("port", 22);
host.put("uname", "username");
host.put("passwd", "password");
host.put("nodes", 7);
//host.put("ggHome", null); /* don't state so that it will use GRIDGAIN_HOME enviroment var */
host.put("cfg", "/config/partitioned.xml");

coll.add(host);

GridFuture f = grid.startNodes(coll, null, false, 3600 * 3600, 4);
System.out.println("before f.get()");
f.get();

I am not quite sure how to debug this as I get no errors

Upvotes: 2

Views: 157

Answers (1)

Valentin Kulichenko
Valentin Kulichenko

Reputation: 8390

Successful completion of the future returned from startNodes(..) method means that your local node has established SSH session and executed a command for each node it was going to start. But successful execution of a command doesn't mean that a node will be actually started, because it can fail for several reasons (e.g., wrong GRIDGAIN_HOME).

You should check the following:

  • Are there GridGain logs created GRIDGAIN_HOME/work/log directory? If yes, then check them - there could be an exception during startup process.
  • If there are no new logs, there is something wrong with the executed command. The command can be found in the local node logs - search for "Starting remote node with SSH command: ..." lines. You can try to create an SSH connection in terminal, run this command and see what happens.
  • Also you may want to check your SSH logs to see whether there are any errors.

Upvotes: 1

Related Questions