OrientGraph 无法创建到远程服务器的连接本地主机:2424

问题描述 投票:0回答:0

问题

OrientGraph

Cannot create a connection to remote server localhost:2424
但 OrientDB 可以。 运行 Apache-TinkerPop-3 Gremlin 命令 通过 OrientDB API,
Java 或 Groovy.

Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot create a connection to remote server address(es): [locahost:2424]

复制步骤

  1. 已安装Docker
  2. 下载了一个OrientDB Docker Image
  3. 启动OrientDB容器
  4. 创建了一个OrientDB数据库“demodb”
  5. 已验证设置/运行
  6. 创建了一个OrientGraph
    OrientGraph graph = OrientGraph.open("remote:locahost:2424/demodb","root","rootpwd");
    
  7. 运行程序
import com.orientechnologies.orient.core.db.ODatabaseSession;
import com.orientechnologies.orient.core.db.OrientDB;
import com.orientechnologies.orient.core.db.OrientDBConfig;
import org.apache.tinkerpop.gremlin.orientdb.OrientGraph;

public class Main {

    public static void main(String[] args) {

        OrientDB orient = new OrientDB("remote:localhost:2424", OrientDBConfig.defaultConfig());
        ODatabaseSession db = orient.open("demodb", "root", "rootpwd");
        db.close();
        orient.close();

        OrientGraph graph = OrientGraph.open("remote:locahost:2424/demodb","root","rootpwd");
        graph.close();
    }
}

试过

  1. 使用默认用户名/密码切换:admin/admin
  2. 更改端口:
    2424
    改为
    2480
  3. 删除数据库
    localhost:2424/demodb
    localhost:2424
  4. 检查OrientDB Gremlin Maven包
  5. 检查 OrientDB 的 OrientGraph 格式

结果

INFO: - shutdown storage: demodb...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Cannot open database 'demodb'
    at com.orientechnologies.orient.core.db.OrientDBRemote.open(OrientDBRemote.java:134)
    at com.orientechnologies.orient.core.db.OrientDB.open(OrientDB.java:226)
    at com.orientechnologies.orient.core.db.OrientDB.open(OrientDB.java:212)
    at org.apache.tinkerpop.gremlin.orientdb.OrientGraphFactory.getDatabase(OrientGraphFactory.java:187)
    at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.<init>(OrientGraph.java:167)
    at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.open(OrientGraph.java:133)
    at org.apache.tinkerpop.gremlin.orientdb.OrientGraph.open(OrientGraph.java:124)
    at Main.main(Main.java:15)
Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot create a connection to remote server address(es): [locahost:2424]
    DB name="demodb"
    at com.orientechnologies.orient.client.remote.OStorageRemote.openRemoteDatabase(OStorageRemote.java:1911)
    at com.orientechnologies.orient.client.remote.OStorageRemote.openRemoteDatabase(OStorageRemote.java:1755)
    at com.orientechnologies.orient.client.remote.OStorageRemote.open(OStorageRemote.java:618)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.internalOpen(ODatabaseDocumentRemote.java:247)
    at com.orientechnologies.orient.core.db.OrientDBRemote.open(OrientDBRemote.java:131)
    ... 7 more

Process finished with exit code 1

期待

其中一个是我在设置和文档中遗漏或误解的内容。

实际

这些都没有改变输出异常错误。

gremlin graph-databases orientdb orientdb3.0 gremlin-java
© www.soinside.com 2019 - 2024. All rights reserved.