com.orientechnologies.orient.core.exception.OConfigurationException: 服务器上未配置数据库 'TEST'

com.orientechnologies.orient.core.exception.OConfigurationException: Database 'TEST' is not configured on server

我设置了 Orient DB 的分布式版本。问题是我无法使用 Scala API:

创建数据库
    <dependency>
        <groupId>com.orientechnologies</groupId>
        <artifactId>orientdb-graphdb</artifactId>
        <version>2.2.2</version>
    </dependency>

val uri: String = "remote:XXX.XX.XX.XX/database/TEST"
val username: String = "root"
val password: String = "123"
val factory: OrientGraphFactory = new OrientGraphFactory(uri,username,password)
val graph: OrientGraph = factory.getTx()

当我 运行 这段代码时,我得到错误:

INFO: Registered the new available server 'XXX.XX.XX.XX:2424'
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigurationException: Database 'TEST' is not configured on server (home=/root/orientdb/databases/)

如果我去DB的其中一个节点运行./bin/console.sh,然后:

create database remote:XXX.XX.XX.XX/database/TEST root 123 memory

然后重新执行Scala代码,就可以正常运行了:

Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server 'XXX.XX.XX.XX:2424'
Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server '192.168.0.14:2424'
Apr 19, 2018 6:37:14 PM com.orientechnologies.common.log.OLogManager log
INFO: Registered the new available server '192.168.0.17:2424'

我在 Scala 中做错了什么?是否可以使用 Scala 创建数据库 API?

如您在此页面中所见:https://orientdb.com/docs/last/Programming-Language-Bindings.html OrientDB 支持 Scala。 内存存储是本地的,并且只在 JVM 运行ning 期间存在。您能否尝试创建一个类型为 plocal 的数据库,然后再次 运行 您的代码? 如果您想了解更多有关存储的信息:https://orientdb.com/docs/last/Storages.html

希望对您有所帮助。

此致