Search code examples
javadatabaseunixorientdbcentos7

Unable to configure OrientDB - Java integration on CENTOS7


I am trying to create deploy my java web application with orient-db onto a CENTOS7 machine. Currently I have set up Orient-db on a root privileged users ~/softwares/$ORIENTDB_HOME The server was successfully set up on the initial config with username and password and startup. I am now trying to create a remote db to be accessed by my java application using the create database command as follows after running console.sh

orientdb> CREATE DATABASE remote:localhost/test root root plocal

But I am getting the following error

Creating database [remote:localhost/test] using the storage type [plocal]... Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot create the remote storage: test

Error: com.orientechnologies.orient.core.exception.ODatabaseException: Cannot create database 'test' DB name="test" DB name="test"

Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot create folders in storage with path /softwares/orientdb-community-2.2.5/orientdb-community-2.2.5/databases/test DB name="test"

I tried CHMODing the .sh bin-directories as well as the $ORIENTDB_HOME/databases directory but the problem persists.

However it allows me to create a db with plocal

orientdb> CREATE DATABASE plocal:localhost/test root root plocal

But I then get the following error at the java end

$ java -jar dataloader-jar-with-dependencies.ja

2016-11-24 20:10:41 DEBUG ASMLoader:38 - connecting to:plocal:localhost/asm

2016-11-24 20:10:41 DEBUG ASMLoader:39 - uname:admin

2016-11-24 20:10:41 DEBUG ASMLoader:40 - password :admin

Exception in thread "main" com.orientechnologies.orient.core.exception.ODatabaseException: Error on opening database 'plocal:localhost/asm' at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.(ODatabaseDocumentTx.java:190) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool$DatabaseDocumentTxPooled.(OPartitionedDatabasePool.java:421) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool$DatabaseDocumentTxPooled.(OPartitionedDatabasePool.java:417) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.initQueue(OPartitionedDatabasePool.java:353) at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.(OPartitionedDatabasePool.java:114) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.(OrientGraphFactory.java:71) at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.(OrientGraphFactory.java:52) at com.virtusa.asm.repo.ASMLoader.main(ASMLoader.java:42) Caused by: com.orientechnologies.orient.core.exception.OConfigurationException: Error on opening database: the engine 'plocal' was not found. URL was: plocal:localhost/asm. Registered engines are: [remote] DB name="plocal:localhost/asm" at com.orientechnologies.orient.core.Orient.loadStorage(Orient.java:462) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.(ODatabaseDocumentTx.java:170) ... 7 more


Solution

  • IMHO you've made a mess with roles and permissions. Which system user did you use to unpack OrientDB? And which one did you use to run it as a standalone server? I"m asking because you're able to create a database with the console in plocal (plocal means embedded). I guess you extracted the tar using root and then started the server from a regular user login shell.

    In the last step you are pointing to a wrong db address: connecting to:plocal:localhost/asm

    If you are accessing a db in plocal (embedded), just use plocal:/path/to/db/folder.

    If you are accessing a db provided by a standalone server, use remote:SERVER_ADDRESS/db_NAME