本文介绍了GridGain-通过Grid.startNodes API使用SSH以编程方式打开节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Grid.startNodes(java.util.Collection,java.util.Map,boolean,int,int)
,如下所示:,java.util.Map,布尔值,int,int)

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)

我正在使用的代码:

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();




  • 我在运行10.0.0.7的vm上运行以上代码

  • 我将远程桌面连接到VM,其主机IP为10.0.0.4,并且没有看到状态更改。代码完成并退出。如果我使用bin / ggstart.bat

  • ,我都可以在本地运行gridgain并发现彼此的节点。我可以在10.0.0.4上手动启动一个节点(我在这台机器上尝试通过此API SSH进入)。我可以通过运行$ GG_HOME / bin / ggstart.bat $ GG_HOME / config / partitioned.xml来启动所述节点,以便配置文件中没有问题

  • 我不太确定如何调试它,因为没有错误

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

    推荐答案

    成功完成了将来的返回from startNodes(..)方法意味着您的本地节点已建立SSH会话,并为要启动的每个节点执行了一条命令。但是,成功执行命令并不意味着实际上会启动一个节点,因为它可能由于多种原因而失败(例如,错误的 GRIDGAIN_HOME )。

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

    您应检查以下内容:


    • 是否已创建GridGain日志 GRIDGAIN_HOME / work / log 目录?如果是,则检查它们-启动过程中可能会发生异常。

    • 如果没有新日志,则执行的命令有问题。该命令可以在本地节点日志中找到-搜索使用SSH命令启动远程节点:...行。您可以尝试在终端中创建SSH连接,运行此命令并查看会发生什么情况。

    • 此外,您可能还需要检查SSH日志以查看是否存在任何错误。
    • >
    • 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.

    这篇关于GridGain-通过Grid.startNodes API使用SSH以编程方式打开节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:44
查看更多