OrientDB - How to create a database on clustering servers?
I install two nodes with default configuration, cluster status:
"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"
}
but when I use Java API to connect to one server and try to create a database an exception is thrown,
admin = new OServerAdmin(PATH);
admin.connect("root", "password");
if (!admin.existsDatabase()) {
admin.createDatabase("document", "local");
}
stack:
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
Why is this happening? How can I rip the database on the clustering servers?
thank.
+3
source to share