15 C
Texas
Muhammad Nabeel
Network and System Administrator

Install OrientDB on RHEL 8 / CentOS 8

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”, there are plans to implement LSM-tree and Fractal tree index based indexes. Each record has Surrogate key which indicates position of record inside of Array list , links between records are stored either as single value of record’s position stored inside of referrer or as B-tree of record positions (so-called record IDs or RIDs) which allows fast traversal (with O(1) complexity) of one-to-many relationships and fast addition/removal of new links. OrientDB is the third most popular graph database according to the DB-Engines graph database ranking, as of September 2017.

Step 1: Install necessary packages

Install wget and unzip using below commands

dnf install -y wget unzip

Step 2: Install and Configure Open JDK

- Advertisement -
dnf install -y java-1.8.0-openjdk

Set Java’s Home Environment

Run below command to find java path

update-alternatives --config java

In my case it is /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el8_0.x86_64/jre/bin/java

Now Set Java’s Path in Your Environment using below command

vi .bash_profile

Add below line in .bash_profile file

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el8_0.x86_64/jre/bin/java

Save changes and Exit.

Refresh .bash_file to make changes

source .bash_profile

Run below commands to see the Java path you set and the java version.

echo $JAVA_HOME
java -version

Step 3: Install OrientDB

It is recommended to run OrientDB as its own user. Run the following command to create the user orientdb and set its home directory to /opt/orientdb.

adduser orientdb -d /opt/orientdb

Download the OrientDB binary archive by running the following commands

Note: You can get lestest version of OrientDb from OrientDB download page.

OrientDB Enterprise Edition

cd /opt/orientdb/

wget https://orientdb3.s3.us-east-2.amazonaws.com/releases/3.0.23/orientdb-3.0.23.tar.gz -O orientdb.tar.gz

Extract the archive and move files.

tar -xf orientdb.tar.gz
ls
mv orientdb-3.0.23/* .

Remove unnecessary data.

rm -rf orientdb-3.0.23 orientdb.tar.gz

Set appropriate permissions to the OrientDB user.

chown -R orientdb:orientdb /opt/orientdb

OrientDB has been installed on your RHEL / CentOS 8 server.

Start OrientDb Server

Switch to the OrientDB user and run script.

su - orientdb
bin/server.sh

You will be asked to set the password of the OrientDB root user like image below, set the password and press enter.

Now you should see image like below, It OrientDb server is started successfully.

press ctrl + C to stop the execution.

Now switch again to root user by running below command.

exit

Step 4: Configure OrientDB Systemd Service

To start OrientDb service automatically on system boot, create a new systemd service by running the following command

vi /etc/systemd/system/orientdb.service

Now add following lines in that file.

[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

Save change to file and exit.

Now you can start and enable OrientDB service on boot.

systemctl start orientdb

systemctl enable orientdb

systemctl status orientdb

Create a soft link for the OrientDB script which starts the console for OrientDB. so we can easily switch to the OrientDB console.

ln -s /opt/orientdb/bin/console.sh /usr/bin/orientdb

Now we can access the OrientDB console by running below command.

orientdb

To exit the OrientDB console using below command

exit

Step 5: Access OrientDB from GUI:

OrientDB Studio is a web based GUI tool to easily administrator OrientDB. It is also installed along with OrientDB package. Once you start OrientDB server, Studio is also started along with it.

We need to allow port 2480 in firewall in order to access OrientDb web interface. Run following commands to add port in firewalld.

firewall-cmd --zone=public --permanent --add-port=2480/tcp
firewall-cmd --reload

Now open the following web address in your browser.

http://your-server-IP:2480

You will see below page on you screen

To create a new database click on NEW DB button and enter name of desired database you want to create.

Now type name of the database and root as the Server User and enter the password of the root user which was set during the installation. Finally Click on CREATE DATABASE to create a new database and you will see the dashboard to manage the database.

 

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article