OrientDB is an open source NoSQL database management system written in Java. It is a multi-model database, supporting graph, document, key/value and object models but the relationships are managed as in graph databases with direct connections between records. It supports schema-less, schema-full and schema-mixed modes. It has a strong security profiling system based on users and roles and supports querying with Gremlin along with SQL extended for graph traversal.
OrientDB uses several indexing mechanisms based on B-tree and Extendible hashing, the last one is known as “hash index”.
Prerequisite
Install java 8 as pre requisite for OrientDB. Download Oracle Java. Extract the archive and install Oracle Java8 using alternative method.
# cd /opt/ # wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz" # tar xzf jdk-8u151-linux-x64.tar.gz cd /opt/jdk1.8.0_151/ alternatives --install /usr/bin/java java /opt/jdk1.8.0_151/bin/java 2 alternatives --config java [root@datasrv jdk1.8.0_151]# alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /opt/jdk1.8.0_151/bin/java Enter to keep the current selection[+], or type selection number: 1 [root@datasrv jdk1.8.0_151]# [root@datasrv jdk1.8.0_151]# java -version java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode) [root@datasrv jdk1.8.0_151]# # alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_151/bin/jar 2 # alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_151/bin/javac 2 # alternatives --set jar /opt/jdk1.8.0_151/bin/jar # alternatives --set javac /opt/jdk1.8.0_151/bin/javac
It is also recommend to setup javac and jar commands path using alternatives. Also, setup the Java environment variables.
export JAVA_HOME=/opt/jdk1.8.0_151 export JRE_HOME=/opt/jdk1.8.0_151/jre export PATH=$PATH:/opt/jdk1.8.0_151/bin:/opt/jdk1.8.0_151/jre/bin
Also, put all the above environments variables to /etc/environment for auto loading during boot up.
Install
Download OrientDB tar file from the site OrientDB (wget https://orientdb.com/download.php?file=orientdb-community-importers-2.2.30.tar.gz&os=linux) site and extract to /opt location on unix. Installation is pretty simple download, extract and run.
By default 2G of memory is allocated to Java Virtual Machine for smooth running of OrientDB. We can still deploy with lesser memory, edit the file bin/server.sh and make the necessary changes.
# tar -zxvf orientdb-community-importers-2.2.30.tar.gz # ln -s orientdb-community-importers-2.2.30 orientdb # cd orientdb Replace the below line in bin/server.sh ORIENTDB_OPTS_MEMORY="-Xms2G -Xmx2G" with ORIENTDB_OPTS_MEMORY="-Xms256m -Xmx512m"
# tar -zxvf orientdb-community-importers-2.2.30.tar.gz # ln -s orientdb-community-importers-2.2.30 orientdb # cd orientdb Replace the below line in bin/server.sh ORIENTDB_OPTS_MEMORY="-Xms2G -Xmx2G" with ORIENTDB_OPTS_MEMORY="-Xms256m -Xmx512m" krishna@Ubuntu16:~$ wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add - [stream] Sav The following additional packages will be installed: cypher-shell dae krishna@Ubuntu16:~$ [root@datasrv bin]# ./server.sh . .` ` , `:. `,` ,:` .,. :,, .,, ,,, . .,.::::: ```` ::::::::: ::::::::: ,` .::,,,,::.,,,,,,`;; .: :::::::::: ::: ::: `,. ::,,,,,,,:.,,.` ` .: ::: ::: ::: ::: ,,:,:,,,,,,,,::. ` ` `` .: ::: ::: ::: ::: ,,:.,,,,,,,,,: `::, ,, ::,::` : :,::` :::: ::: ::: ::: ::: ,:,,,,,,,,,,::,: ,, :. : :: : .: ::: ::: ::::::: :,,,,,,,,,,:,:: ,, : : : : .: ::: ::: ::::::::: ` :,,,,,,,,,,:,::, ,, .:::::::: : : .: ::: ::: ::: ::: `,...,,:,,,,,,,,,: .:,. ,, ,, : : .: ::: ::: ::: ::: .,,,,::,,,,,,,: `: , ,, : ` : : .: ::: ::: ::: ::: ...,::,,,,::.. `: .,, :, : : : .: ::::::::::: ::: ::: ,::::,,,. `: ,, ::::: : : .: ::::::::: :::::::::: ,,:` `,,. ,,, .,` ,,. `, GRAPH DATABASE `` `. `` orientdb.com ` 2017-12-07 01:02:15:704 INFO Loading configuration from: /opt/orientdb/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml] 2017-12-07 01:02:16:007 INFO OrientDB Server v2.2.30 (build 43d850df23c0fd1edca7279761c2238fdc6cc576, branch 2.2.x) is starting up... [OServer] 2017-12-07 01:02:16:013 INFO Databases directory: /opt/orientdb-community-importers-2.2.30/databases [OServer] 2017-12-07 01:02:16:071 INFO Auto configuration of disk cache size. [OMemoryAndLocalPaginatedEnginesInitializer] 2017-12-07 01:02:16:176 INFO 2097451008 B/2000 MB/1 GB of physical memory were detected on machine [ONative] 2017-12-07 01:02:16:183 INFO Soft memory limit for this process is set to -1 B/-1 MB/-1 GB [ONative] 2017-12-07 01:02:16:184 INFO Hard memory limit for this process is set to -1 B/-1 MB/-1 GB [ONative] 2017-12-07 01:02:16:185 INFO Path to 'memory' cgroup is '/' [ONative] 2017-12-07 01:02:16:187 INFO Mounting path for memory cgroup controller is '/sys/fs/cgroup/memory' [ONative] 2017-12-07 01:02:16:188 INFO cgroup soft memory limit is 9223372036854771712 B/8796093022207 MB/8589934591 GB [ONative] 2017-12-07 01:02:16:194 INFO cgroup hard memory limit is 9223372036854771712 B/8796093022207 MB/8589934591 GB [ONative] 2017-12-07 01:02:16:194 INFO Detected memory limit for current process is 2097451008 B/2000 MB/1 GB [ONative] 2017-12-07 01:02:16:196 WARNI Not enough physical memory available for DISKCACHE: 2,000MB (heap=455MB direct=524,288MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now running with DISKCACHE=256MB [OMemoryAndLocalPaginatedEnginesInitializer] 2017-12-07 01:02:16:197 INFO OrientDB config DISKCACHE=256MB (heap=455MB direct=524,288MB os=2,000MB) [OMemoryAndLocalPaginatedEnginesInitializer] 2017-12-07 01:02:16:266 INFO {db=OSystem} Creating the system database 'OSystem' for current server [OSystemDatabase] 2017-12-07 01:02:16:520 INFO {db=OSystem} Storage 'plocal:/opt/orientdb-community-importers-2.2.30/databases/OSystem' is created under OrientDB distribution : 2.2.30 (build 43d850df23c0fd1edca7279761c2238fdc6cc576, branch 2.2.x) [OLocalPaginatedStorage] 2017-12-07 01:02:18:873 INFO Listening binary connections on 0.0.0.0:2424 (protocol v.36, socket=default) [OServerNetworkListener] 2017-12-07 01:02:18:881 INFO Listening http connections on 0.0.0.0:2480 (protocol v.10, socket=default) [OServerNetworkListener] +---------------------------------------------------------------+ | WARNING: FIRST RUN CONFIGURATION | +---------------------------------------------------------------+ | This is the first time the server is running. Please type a | | password of your choice for the 'root' user or leave it blank | | to auto-generate it. | | | | To avoid this message set the environment variable or JVM | | setting ORIENTDB_ROOT_PASSWORD to the root password to use. | +---------------------------------------------------------------+ Root password [BLANK=auto generate it]: ****** Please confirm the root password: ****** * 2017-12-07 01:02:35:444 INFO Installing dynamic plugin 'orientdb-studio-2.2.30.zip'... [OServerPluginManager] 2017-12-07 01:02:35:447 INFO Installing dynamic plugin 'orientdb-etl-2.2.30.jar'... [OServerPluginManager] 2017-12-07 01:02:35:452 INFO Installing dynamic plugin 'orientdb-teleporter-2.2.30.jar'... [OServerPluginManager] 2017-12-07 01:02:35:472 INFO Installing dynamic plugin 'orientdb-neo4j-importer-plugin-2.2.30-dist.jar'... [OServerPluginManager] 2017-12-07 01:02:35:480 INFO ODefaultPasswordAuthenticator is active [ODefaultPasswordAuthenticator] 2017-12-07 01:02:35:483 INFO OServerConfigAuthenticator is active [OServerConfigAuthenticator] 2017-12-07 01:02:35:485 INFO OSystemUserAuthenticator is active [OSystemUserAuthenticator] 2017-12-07 01:02:35:491 INFO Installed GREMLIN language v.2.6.0 - graph.pool.max=50 [OGraphServerHandler] 2017-12-07 01:02:35:491 INFO [OVariableParser.resolveVariables] Error on resolving property: distributed [orientechnologies] 2017-12-07 01:02:35:498 WARNI Authenticated clients can execute any kind of code into the server by using the following allowed languages: [sql] [OServerSideScriptInterpreter] 2017-12-07 01:02:35:500 INFO OrientDB Studio available at http://10.0.2.15:2480/studio/index.html [OServer] 2017-12-07 01:02:35:500 INFO OrientDB Server is active v2.2.30 (build 43d850df23c0fd1edca7279761c2238fdc6cc576, branch 2.2.x). [OServer]
Now, access the OrientDB using the below URL.
http://localhost:2480 or http://<IP Address>:2480
Conclusion:
We have successfully setup OrientDB.
Enjoy !!!