How to Install and Configure ArangoDB on CentOS 7
##Introduction ArangoDB is an open source NoSQL database with a flexible data model for documents, graphs, and key-values. It is a powerful database with a wide range of features that are needed for a modern web application. The database itself can be managed easily with the bundled web or command line interface.
In this tutorial, I will explain how to install and use ArangoDB on CentOS 7.
##Prerequisites
- A newly deployed Vultr CentOS 7 server instance with a static IP address. I will use
192.168.1.104
in this guide. - A non-root user with sudo privileges setup on your server.
##Step 1: System update
Before starting, update the system to the latest stable version with the following commands:
yum update -y
##Step 2: Install ArangoDB Before installing ArangoDB, you will need to create yum repo file for it.
To do this, change the directory to /etc/yum.repos.d
and create arangodb.repo
with the following command:
cd /etc/yum.repos.d
sudo nano /etc/yum.repos.d/arangodb.repo
Add the following content:
[arangodb]
name=ArangoDB Project
type=rpm-md
baseurl=https://strato1.arangodb.com/repositories/arangodb3/CentOS_7/
gpgcheck=1
gpgkey=https://strato1.arangodb.com/repositories/arangodb3/CentOS_7/repodata/repomd.xml.key
enabled=1
Save the file and update the system with the following command:
sudo yum update -y
Next, install ArangoDB by running the following command:
sudo yum install arangodb3 -y
Once installation is complete, start the Arangodb service with the following command:
sudo systemctl start arangodb3
You can also check the status of Arangodb with the following command:
sudo systemctl status arangodb3
You should see the following output:
● arangodb3.service - SYSV: ArangoDB Server
Loaded: loaded (/etc/rc.d/init.d/arangodb3)
Active: active (running) since Tue 2016-11-01 21:40:43 IST; 2min 30s ago
Docs: man:systemd-sysv-generator(8)
Process: 2766 ExecStart=/etc/rc.d/init.d/arangodb3 start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/arangodb3.service
├─2810 /usr/sbin/arangod --uid arangodb --gid arangodb --log.foreground-tty false --pid-file /var/run/arangodb/arangod.pid --temp.path ...
└─2811 /usr/sbin/arangod --uid arangodb --gid arangodb --log.foreground-tty false --pid-file /var/run/arangodb/arangod.pid --temp.path ...
Nov 01 21:40:31 centOS-7 systemd[1]: Starting SYSV: ArangoDB Server...
Nov 01 21:40:43 centOS-7 arangodb3[2766]: Starting /usr/sbin/arangod: starting up in daemon mode
Nov 01 21:40:43 centOS-7 systemd[1]: Started SYSV: ArangoDB Server.
Nov 01 21:40:43 centOS-7 arangodb3[2766]: changed working directory for child process to '/var/tmp'
##Step 3: Access ArangoDB CLI
ArangoDB comes with an arangosh
command line utility to access the database. You can run this utility with the following command:
arangosh
When asked for a password, enter the root password. You will see the following output:
_
__ _ _ __ __ _ _ __ __ _ ___ ___| |__
/ _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \
| (_| | | | (_| | | | | (_| | (_) \__ \ | | |
\__,_|_| \__,_|_| |_|\__, |\___/|___/_| |_|
|___/
arangosh (ArangoDB 3.0.10 [linux] 64bit, using VPack 0.1.30, ICU 54.1, V8 5.0.71.39, OpenSSL 1.0.1e-fips 11 Feb 2013)
Copyright (c) ArangoDB GmbH
Pretty printing values.
Could not connect to endpoint 'http+tcp://127.0.0.1:8529', database: '_system', username: 'root'
Error message: '401: Unauthorized'
Type 'tutorial' for a tutorial or 'help' to see common examples
127.0.0.1:8529@_system>
You can create databases, users, and perform all administrative tasks using this utility.
##Step 4: ArangoDB web interface
ArangoDB comes with a built-in web interface for performing various administrative tasks. Before starting, you will need to edit ArangoDB configuration files arangod.conf
and arangosh.conf
:
sudo nano /etc/arangodb3/arangod.conf
Add your server's IP address as follows:
endpoint = tcp://192.168.1.104:8529
Once you are finished, open the other configuration file:
sudo nano /etc/arangodb3/arangosh.conf
Add your server's IP address as follows:
endpoint = tcp://192.168.1.104:8529
Save the file and restart the ArangoDB service:
systemctl restart arangodb3
##Step 5: Allow ArangoDB through firewall
By default, ArangoDB runs on port 8529
, so you will need to allow this port through your firewall. You can do this by running the following command:
sudo firewall-cmd --permanent --add-port=8529/tcp
Now, reload the firewall service for the changes to take effect.
sudo firewall-cmd --reload
Once you are finished, it's time to access ArangoDB web interface.
Open your favorite web browser and type the URL http://192.168.1.104:8529
. This will open up the login screen for the _system
db. After entering your login credentials, you will see the ArangoDB splash screen. This concludes my tutorial.