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. Add Oracle Java PPA to your system before proceeding with the installation of Java.
$ sudo add-apt-repository -y ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get -y install oracle-java8-installer root@orientdb:~# java -version java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode) root@orientdb:~#
Install
Download OrientDB tar file from the site OrientDB (https://github.com/orientechnologies/orientdb/releases) 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-tp3-3.0.11.tar.gz # ln -s orientdb-tp3-3.0.11 orientdb # cd orientdb Replace the below line in bin/server.sh ORIENTDB_OPTS_MEMORY="-Xms2G -Xmx2G" with ORIENTDB_OPTS_MEMORY="-Xms256m -Xmx512m" root@orientdb:/opt/orientdb/bin# ./server.sh . .` ` , `:. `,` ,:` .,. :,, .,, ,,, . .,.::::: ```` ::::::::: ::::::::: ,` .::,,,,::.,,,,,,`;; .: :::::::::: ::: ::: `,. ::,,,,,,,:.,,.` ` .: ::: ::: ::: ::: ,,:,:,,,,,,,,::. ` ` `` .: ::: ::: ::: ::: ,,:.,,,,,,,,,: `::, ,, ::,::` : :,::` :::: ::: ::: ::: ::: ,:,,,,,,,,,,::,: ,, :. : :: : .: ::: ::: ::::::: :,,,,,,,,,,:,:: ,, : : : : .: ::: ::: ::::::::: ` :,,,,,,,,,,:,::, ,, .:::::::: : : .: ::: ::: ::: ::: `,...,,:,,,,,,,,,: .:,. ,, ,, : : .: ::: ::: ::: ::: .,,,,::,,,,,,,: `: , ,, : ` : : .: ::: ::: ::: ::: ...,::,,,,::.. `: .,, :, : : : .: ::::::::::: ::: ::: ,::::,,,. `: ,, ::::: : : .: ::::::::: :::::::::: ,,:` `,,. ,,, .,` ,,. `, VELOCE `` `. `` www.orientdb.com ` 2018-11-30 14:42:16:662 INFO Detected limit of amount of simultaneously open files is 1048576, limit of open files for disk cache will be set to 523776 [ONative] 2018-11-30 14:42:16:691 INFO Loading configuration from: /opt/orientdb/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml] 2018-11-30 14:42:17:163 INFO OrientDB Server v3.0.11 - Veloce (build 4a3b7acf5bdffc997f786197a6f896f8d3f16604, branch 3.0.x) is starting up... [OServer] 2018-11-30 14:42:17:317 INFO 4136488960 B/3944 MB/3 GB of physical memory were detected on machine [ONative] 2018-11-30 14:42:17:318 INFO Soft memory limit for this process is set to -1 B/-1 MB/-1 GB [ONative] 2018-11-30 14:42:17:319 INFO Hard memory limit for this process is set to -1 B/-1 MB/-1 GB [ONative] 2018-11-30 14:42:17:321 INFO Path to 'memory' cgroup is '/user.slice' [ONative] 2018-11-30 14:42:17:341 INFO Mounting path for memory cgroup controller is '/sys/fs/cgroup/memory' [ONative] 2018-11-30 14:42:17:343 INFO cgroup soft memory limit is 9223372036854771712 B/8796093022207 MB/8589934591 GB [ONative] 2018-11-30 14:42:17:346 INFO cgroup hard memory limit is 9223372036854771712 B/8796093022207 MB/8589934591 GB [ONative] 2018-11-30 14:42:17:351 INFO Detected memory limit for current process is 4136488960 B/3944 MB/3 GB [ONative] 2018-11-30 14:42:17:355 INFO JVM can use maximum 1963MB of heap memory [OMemoryAndLocalPaginatedEnginesInitializer] 2018-11-30 14:42:17:361 INFO Because OrientDB is running outside a container 12% of memory will be left unallocated according to the setting 'memory.leftToOS' not taking into account heap memory [OMemoryAndLocalPaginatedEnginesInitializer] 2018-11-30 14:42:17:367 INFO OrientDB auto-config DISKCACHE=1,508MB (heap=1,963MB os=3,944MB) [orientechnologies] 2018-11-30 14:42:17:390 INFO System is started under an effective user : `root` [OEngineLocalPaginated] 2018-11-30 14:42:17:489 INFO WAL maximum segment size is set to 6,144 MB [OrientDBDistributed] 2018-11-30 14:42:17:491 INFO Databases directory: /opt/orientdb-tp3-3.0.11/databases [OServer] 2018-11-30 14:42:17:584 INFO Creating the system database 'OSystem' for current server [OSystemDatabase] 2018-11-30 14:42:17:787 INFO Direct IO for WAL located in /opt/orientdb-tp3-3.0.11/databases/OSystem is allowed with block size 4096 bytes. [OCASDiskWriteAheadLog] 2018-11-30 14:42:17:793 INFO Page size for WAL located in /opt/orientdb-tp3-3.0.11/databases/OSystem is set to 4096 bytes. [OCASDiskWriteAheadLog] 2018-11-30 14:42:18:899 INFO Storage 'plocal:/opt/orientdb-tp3-3.0.11/databases/OSystem' is created under OrientDB distribution : 3.0.11 - Veloce (build 4a3b7acf5bdffc997f786197a6f896f8d3f16604, branch 3.0.x) [OLocalPaginatedStorage] 2018-11-30 14:42:23:830 INFO Listening binary connections on 0.0.0.0:2424 (protocol v.37, socket=default) [OServerNetworkListener] 2018-11-30 14:42:23:842 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: ****** 2018-11-30 14:42:35:461 INFO Installing dynamic plugin 'orientdb-etl-3.0.11.jar'... [OServerPluginManager] 2018-11-30 14:42:35:485 INFO Installing dynamic plugin 'orientdb-studio-3.0.11.zip'... [OServerPluginManager] 2018-11-30 14:42:35:492 INFO ODefaultPasswordAuthenticator is active [ODefaultPasswordAuthenticator] 2018-11-30 14:42:35:498 INFO OServerConfigAuthenticator is active [OServerConfigAuthenticator] 2018-11-30 14:42:35:501 INFO OSystemUserAuthenticator is active [OSystemUserAuthenticator] 2018-11-30 14:42:35:980 INFO 70 attributes loaded from 94 stream(s) in 433ms, 70 saved, 1606 ignored: ["Ant-Version", "Archiver-Version", "BUILD", "Bnd-LastModified", "Build-Id", "Build-Jdk", "Build-Version", "Built-By", "Built-Date", "Bundle-ActivationPolicy", "Bundle-Activator", "Bundle-Category", "Bundle-ClassPath", "Bundle-Description", "Bundle-DocURL", "Bundle-License", "Bundle-ManifestVersion", "Bundle-Name", "Bundle-NativeCode", "Bundle-RequiredExecutionEnvironment", "Bundle-SymbolicName", "Bundle-Vendor", "Bundle-Version", "Class-Path", "Created-By", "DSTAMP", "DynamicImport-Package", "Eclipse-BuddyPolicy", "Export-Package", "Extension-Name", "Extension-name", "Fragment-Host", "Git-Revision", "Git-Url", "Ignore-Package", "Implementation-Build", "Implementation-Build-Date", "Implementation-Build-Id", "Implementation-Title", "Implementation-URL", "Implementation-Vendor", "Implementation-Vendor-Id", "Implementation-Version", "Import-Package", "Include-Resource", "JCabi-Build", "JCabi-Date", "JCabi-Version", "Main-Class", "Main-class", "Major-Version", "Manifest-Version", "Multi-Release", "Originally-Created-By", "Private-Package", "Probe-Provider-XML-File-Names", "Require-Bundle", "Require-Capability", "Specification-Title", "Specification-Vendor", "Specification-Version", "TODAY", "TSTAMP", "Tool", "VERSION", "X-Compile-Source-JDK", "X-Compile-Target-JDK", "hash", "url", "version"] [Manifests] 2018-11-30 14:42:35:992 INFO Installed GREMLIN language v.3.3.0 - graph.pool.max=50 [OGraphServerHandler] 2018-11-30 14:42:35:999 INFO [OVariableParser.resolveVariables] Property not found: distributed [orientechnologies] 2018-11-30 14:42:36:025 WARNI Authenticated clients can execute any kind of code into the server by using the following allowed languages: [sql] [OServerSideScriptInterpreter] 2018-11-30 14:42:36:030 INFO Gremlin Server is starting up... [OGremlinServerPlugin] 2018-11-30 14:42:36:298 INFO Configured Metrics ConsoleReporter configured with report interval=180000ms [MetricManager] 2018-11-30 14:42:36:312 INFO Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv [MetricManager] 2018-11-30 14:42:36:322 INFO Configured Metrics JmxReporter configured with domain= and agentId= [MetricManager] 2018-11-30 14:42:36:327 INFO Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics [MetricManager] 2018-11-30 14:42:36:692 INFO Graph [graph] was successfully configured via [../config/demodb.properties]. [GremlinServer] 2018-11-30 14:42:36:693 INFO Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-* [ServerGremlinExecutor] 2018-11-30 14:42:37:101 INFO Initialized GremlinExecutor and preparing GremlinScriptEngines instances. [ServerGremlinExecutor] 2018-11-30 14:42:37:158 INFO Direct IO for WAL located in /opt/orientdb-tp3-3.0.11/databases/demodb is allowed with block size 4096 bytes. [OCASDiskWriteAheadLog] 2018-11-30 14:42:37:160 INFO Page size for WAL located in /opt/orientdb-tp3-3.0.11/databases/demodb is set to 4096 bytes. [OCASDiskWriteAheadLog] 2018-11-30 14:42:37:734 INFO Storage 'plocal:/opt/orientdb-tp3-3.0.11/databases/demodb' is opened under OrientDB distribution : 3.0.11 - Veloce (build 4a3b7acf5bdffc997f786197a6f896f8d3f16604, branch 3.0.x) [OLocalPaginatedStorage] 2018-11-30 14:42:40:906 INFO Initialized gremlin-groovy GremlinScriptEngine and registered metrics [ServerGremlinExecutor] 2018-11-30 14:42:40:929 INFO A GraphTraversalSource is now bound to [g] with graphtraversalsource[orientgraph[plocal:/opt/orientdb-tp3-3.0.11/databases/demodb], standard] [ServerGremlinExecutor] 2018-11-30 14:42:40:958 INFO Adding the standard OpProcessor. [OpLoader] 2018-11-30 14:42:40:964 INFO Adding the session OpProcessor. [OpLoader] 2018-11-30 14:42:41:485 INFO Adding the traversal OpProcessor. [OpLoader] 2018-11-30 14:42:41:500 INFO Initialized cache for TraversalOpProcessor with size 1000 and expiration time of 600000 ms [TraversalOpProcessor] 2018-11-30 14:42:41:557 INFO Executing start up LifeCycleHook [GremlinServer] 2018-11-30 14:42:41:613 INFO Executed once at startup of Gremlin Server. [GremlinServer] 2018-11-30 14:42:41:801 INFO Configured application/vnd.gremlin-v3.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 [AbstractChannelizer] 2018-11-30 14:42:41:804 INFO Configured application/vnd.gremlin-v3.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0 [AbstractChannelizer] 2018-11-30 14:42:41:875 INFO Configured application/vnd.gremlin-v3.0+json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 [AbstractChannelizer] 2018-11-30 14:42:41:876 INFO Configured application/json with org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0 [AbstractChannelizer] 2018-11-30 14:42:41:996 INFO Gremlin Server configured with worker thread pool of 1, gremlin pool of 2 and boss thread pool of 1. [GremlinServer] 2018-11-30 14:42:41:997 INFO Channel started at port 8182. [GremlinServer] 2018-11-30 14:42:41:998 INFO {db=demodb} Gremlin started correctly [OGremlinServerPlugin] 2018-11-30 14:42:42:004 INFO {db=demodb} OrientDB Studio available at http://10.0.2.15:2480/studio/index.html [OServer] 2018-11-30 14:42:42:013 INFO {db=demodb} OrientDB Server is active v3.0.11 - Veloce (build 4a3b7acf5bdffc997f786197a6f896f8d3f16604, branch 3.0.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 !!!