Introduction
OrientDB is a multi-model NoSQL database with support for graph and document databases. It is a Java application and can run on any operating system. It’s also fully ACID-complaint with support for multi-master replication, allowing easy horizontal scaling. below are some of the main benefits that OrientDB includes:
- OrientDB is “fast” ( storing 220,000 records per second on common hardware ).
- supports schema-less, schema-full and schema-mixed modes.
- OrientDB includes SQL among its query languages, along with a custom SQL based language which reduces the learning curve for those new to OrientDB.
Install Java
OrientDB is written in Java language so you have to install it on your OS with the following command:
apt-get update
apt-get install default-jre
Download OrientDB package
In this section, we are going to download the latest version of OrientDB which is 2.2.29 at the time of writing.
Download the tar file in your “opt” directory which is the traditional Linux directory for storing third-party softwares:
cd /opt/
wget -O orientdb-community-2.2.29.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.29.tar.gz&os=linux
Now issue the following command to extract the files:
tar xvzf orientdb-community-2.2.29.tar.gz
Change the name of the extracted directory to “orientdb”, it’s just for being neat:
mv orientdb-community-2.2.29/ orientdb
Create OrientDB Service
For making OrientDB run as a daemon service you may follow the instruction below:
Step 1. Create OrientDB user
You can create a system user for OrientDB with the following command:
useradd -r orientdb -s /sbin/nologin
Step 2. Set the correct owner for OrientDB files
After you have created a user for OrientDB you have to set is the owner of the OrientDB files:
chown -R orientdb:orientdb /opt/orientdb/
Step 3. Edit OrientDB configuration file
In this step, you have to modify the OrientDB main configuration file:
nano /opt/orientdb/bin/orientdb.sh
At the first lines of the file you can see 2 lines like below:
ORIENTDB_DIR=""
ORIENTDB_USER=""
Change their value to below:
ORIENTDB_DIR="/opt/orientdb"
ORIENTDB_USER="orientdb"
Save and exit the file.
Step 4. Modify and Place the Service file
Now you have to open the service file:
nano /opt/orientdb/bin/orientdb.service
And make it look like below:
#
# Copyright (c) OrientDB LTD (http://orientdb.com/)
#
[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=orientdb
Group=orientdb
ExecStart=/opt/orientdb/bin/server.sh
Save and exit, Then move it to proper location with the following command:
mv /opt/orientdb/bin/orientdb.service /etc/systemd/system/
Restart “systemd” with the following command:
systemctl daemon-reload
Now you can start your OrientDB service and make it run at startup:
systemctl start orientdb
systemctl enable orientdb
Test
If you have done everything right your database is now listening on port “2480” you can verify that with the following command:
netstat -ln | grep 2480
Also, you can open your browser and see the following address through it:
http://YOUR_IP_ADDRESS:2480
You have to see a page like below:
You can visit OrientDB official website for more information and news!