gpt4 book ai didi

distributed - OrientDB - 如何在集群服务器上创建数据库?

转载 作者:行者123 更新时间:2023-12-02 05:02:54 25 4
gpt4 key购买 nike

我使用默认配置设置了两个节点,集群状态:

"members": [{
"id": "192.168.1.101:2434",
"listeners": [{"protocol": "ONetworkProtocolBinary", "listen": "192.168.1.101:2424"}, {"protocol": "ONetworkProtocolHttpDb", "li
80"}],
"alias": "192.168.1.101:2434",
"status": "aligning"
}, {
"id": "192.168.1.102:2435",
"listeners": [{"protocol": "ONetworkProtocolBinary", "listen": "192.168.1.101:2425"}, {"protocol": "ONetworkProtocolHttpDb", "li
80"}],
"alias": "192.168.1.101:2435",
"status": "aligning"
}],
"name": "_hzInstance_1_orientdb",
"local": "192.168.1.101:2435"
}

但是当我使用 Java API 连接到一台服务器,并尝试创建一个数据库时,发生了异常,

admin = new OServerAdmin(PATH);
admin.connect("root", "password");

if (!admin.existsDatabase()) {
admin.createDatabase("document", "local");
}

堆栈:

Cannot create the remote storage: demo1
com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:515)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:470)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1832)
at com.orientechnologies.orient.client.remote.OStorageRemote.getResponse(OStorageRemote.java:1863)
at com.orientechnologies.orient.client.remote.OServerAdmin.createDatabase(OServerAdmin.java:184)
at com.test.db.Client.main(Client.java:19)
Caused by: java.lang.NullPointerException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:517)
... 7 more
com.orientechnologies.orient.core.exception.OStorageException: Cannot create the remote storage: demo1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.orientechnologies.common.log.OLogManager.error(OLogManager.java:119)
at com.orientechnologies.orient.client.remote.OServerAdmin.createDatabase(OServerAdmin.java:189)
at com.test.db.Client.main(Client.java:19)
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:515)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:470)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1832)
at com.orientechnologies.orient.client.remote.OStorageRemote.getResponse(OStorageRemote.java:1863)
at com.orientechnologies.orient.client.remote.OServerAdmin.createDatabase(OServerAdmin.java:184)
... 1 more
Caused by: java.lang.NullPointerException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:517)
... 7 more

为什么会这样?如何在集群服务器上创建数据库?

谢谢。

最佳答案

数据库的初始创建必须在集群外完成。然后将数据库复制到所有服务器并启动集群。

关于distributed - OrientDB - 如何在集群服务器上创建数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14645726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com