How to Install OrientDB on Ubuntu 18.04/16.04 LTS

In this article, We are going to perform How to Install OrientDB on Ubuntu 18.04/16.04 LTS or any other cloud platform like Amazon Ec2, Azure VM, Google Cloud Compute,etc. with preinstalled Ubuntu 18.04/16.04 LTS.

Introduction

OrientDB is Open Source No SQL database management system.

Prerequisite

  • Ubuntu 18.04/16.04 LTS with Minimal Installation
  • SSH Access with sudo privileges
  • Open Firewall Port: 2480

Step 1: Download and Install OrientDB on Ubuntu

Navigate to /tmp directory.

$ cd /tmp

Download the OrientDB setup. To download latest community version visit OrientDB official site.

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

Output:

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

Resolving s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)... 52.219.104.154

Connecting to s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)|52.219.104.154|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 39038249 (37M) [application/x-gzip]

Saving to: ‘orientdb-3.0.4.tar.gz’

orientdb-3.0.4.tar.gz                     100%[===================================================================================>]  37.23M  71.9MB/s    in 0.5s

Extract the Setup

tar xvf orientdb-3.0.4.tar.gz

Move Extracted setup to /opt/oriendb directory

$ sudo mv orientdb-3.0.4 /opt/orientdb

Create a user named “oriendb” with no shell access

$ sudo useradd -r orientdb -s /sbin/nologin

Give the ownership permission to oriendb user

$ sudo chown -R orientdb:orientdb /opt/orientdb/

Open the config script , replace user and DB config path as shown below

# sudo nano /opt/orientdb/bin/orientdb.sh

From

ORIENTDB_DIR=""

ORIENTDB_USER=""

Change to

ORIENTDB_DIR="/opt/orientdb"

ORIENTDB_USER="orientdb"

Navigate to /opt/orientdb/bin path

cd /opt/orientdb/bin

Run server.sh script

sudo ./server.sh

You should be prompted to create a root password and confirm password. Set a Password and continue.

Step 2: Create OrientDB Service

First, copy orientdb service file to /etc/systemd/system/ directory

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

orientdb service should look like below

#
# Copyright (c) OrientDB LTD (http://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

Reload the daemon

$ sudo systemctl daemon-reload

Start the OrienDB Service

$ sudo systemctl start orientdb.service

Check the status

$ sudo systemctl status orientdb.service

Output:

  . orientdb.service - OrientDB Server

Loaded: loaded (/etc/systemd/system/orientdb.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-06 07:26:38 UTC; 8s ago
  Main PID: 72198 (java)
    Tasks: 24
   Memory: 159.5M
      CPU: 4.046s
   CGroup: /system.slice/orientdb.service
          └─72198 java -server -Xms2G -Xmx2G -Djna.nosys=true -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF8 -Drhino.opt.level=9 -Djav

Step 4: Access OrientDB GUI Dashboard

Open your favorite browser and type localhost or IP with port number.

http://localhost:2480  OR http://IP:2480

orientdb gui dashboard

Step 5: Login OrientDB using Command Line

Navigate to OrintDB config path

$ cd  /opt/orientdb/bin

Run the console.sh

$ /opt/orientdb/bin$ ./console.sh

Output:

OrientDB console v.3.0.4 - Veloce (build 4578b51f72a55feaa0852bc8ddd52929011d956c, branch 3.0.x) https://www.orientdb.com

Type 'help' to display all the supported commands.

Step 6: Creating User in OrientDB using Command Line

Navigate to OrientDB Config path.

$ cd /opt/orientdb/bin

Open a console

/opt/orientdb/bin$ ./console.sh

Login to OrientDB with root username and password

orientdb> connect remote:127.0.0.1/demodb root [email protected]

Output:

Connecting to database [remote:127.0.0.1/demodb] with user 'root'...OK

Create a user named “dbadmin” and password “[email protected]

orientdb {db=demodb}> CREATE USER dbadmin IDENTIFIED BY [email protected] ROLE admin

Output:

User created successfully.

Conclusion

In this article, We have covered How to Install OrientDB on Ubuntu 18.04/16.04 LTS.

Related Articles

How to Download & Install MongoDB on Windows

How to Install MongoDB on Ubuntu 18.04/16.04 LTS

Shivdas Kanade

I am Shivdas Kanade working as DevOps Engineer. Passionate about Linux, Open Source and DevOps Tools. Believe in sharing knowledge.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Shares
Share via
Copy link