How To Install OrientDB on CentOS 7

OrientDB on CentOS 7

OrientDB has a multi-model NoSQL database which supports document database with a graph which is a java based application and can be run on any operating system which supports multi-master replication and easy horizontal scaling.

Table of Contents

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing OrientDB.

Step 3. Starting the OrientDB Server.

Step 4. Configure OrientDB Daemon.

 

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation OrientDB open source NoSQL database management system on a CentOS 7 server.
Install OrientDB on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing OrientDB.

First of all, create a new user to run OrientDB:

adduser orientdb -d /opt/orientdb

Now you can download the OrientDB binary archive by running the following command:

cd /opt/orientdb/
wget https://orientdb.com/download.php?file=orientdb-community-importers-2.2.29.tar.gz -O /opt/orientdb/orientdb.tar.gz

Once the package is downloaded we will untar and move the extracted folder to the /opt/orientdb:

tar -xf orientdb.tar.gz
mv orientdb-community*/* .

Make the orientdb user the owner of the extracted files:

chown -R orientdb:orientdb /opt/orientdb

Step 3. Starting the OrientDB Server.

OrientDB provides an installer script for you to start the server. Switch to the OrientDB user:

su - orientdb
sudo bin/server.sh

OrientDB should now prompt for the root password with a message like the one below:

+---------------------------------------------------------------+
|                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.   |
+---------------------------------------------------------------+

Step 4. Configure OrientDB Daemon.

Create a new ststemd service to easily manage OrientDB start and stop:

nano /etc/systemd/system/orientdb.service

Paste the following content:

[Unit]
Description=OrientDB service
After=network.target

[Service]
Type=simple
ExecStart=/opt/orientdb/bin/server.sh
User=orientdb
Group=orientdb
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=orientdb

[Install]
WantedBy=multi-user.target

Reload systemd daemon service:

systemctl daemon-reload

Start OrientDB and enable for starting at boot time:

systemctl start orientdb
systemctl enable orientdb

Congratulation’s! You have successfully installed OrientDB. Thanks for using this tutorial for installing OrientDB open source NoSQL database management on your CentOS 7 system. For additional help or useful information, we recommend you to check the official OrientDB web site.

How To Install OrientDB on Ubuntu 16.04

Install OrientDB on Ubuntu 16

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.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation OrientDB on a Ubuntu 16.04 (xenial xerus) server.

Install OrientDB on Ubuntu 16.04 LTS

Step 1. First, make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Dependencies.

First of all, let’s install dependencies for OrientDB:

apt-get install oracle-java8-set-default git ant

Step 3. Installing OrientDB.

Download the latest version of OrientDB by executing the following command, At the moment of writing this article it is version 2.2.22:

wget -O orientdb-community-2.2.22.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.22.tar.gz&os=linux

Once the package is downloaded we will untar and move the extracted folder to the /opt/orientdb:

tar -zxf orientdb-community-2.2.22.tar.gz
mv orientdb-community-2.2.22 /opt/orientdb

Step 4. Starting the OrientDB Server.

Change to the /opt/orientdb folder and start the OrientDB database server:

cd /opt/orientdb
sudo bin/server.sh

OrientDB should now prompt for the root password with a message like the one below:

+---------------------------------------------------------------+
|                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.   |
+---------------------------------------------------------------+

Step 5. Configure OrientDB Daemon.

Create a system user which we want to run OrientDB here we assume orientdb user:

useradd –r 0riendb –s  /sbin/nologin
chown –R orientdb:orientdb /opt/orientdb
nano /opt/orientdb/bin/orientdb.sh

Find the below line in the configuration and change them to:

# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="/opt/orientdb"
ORIENTDB_USER="orientdb"

Once the configuration is done, change the configuration server file’s permission:

chmod 640 /opt/orientdb/config/orientdb-server-config.xml

Step 6. Install the Systemd service OrientDB.

First, we needed to copy the file to /etc/system/services folder:

cp /opt/orientdb/bin/orientdb.service /etc/systemd/system

Edit the OrientDB service file:

### nano /etc/systemd/system/orientdb.service

[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

Reload systemd daemon service:

systemctl daemon-reload

Start OrientDB and enable for starting at boot time:

systemctl start orientdb
systemctl enable orientdb

Congratulation’s! You have successfully installed OrientDB. Thanks for using this tutorial for installing OrientDB on Ubuntu 16.04 (xenial xerus) server. For additional help or useful information, we recommend you to check the official OrientDB web site.