You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

Welcome to our guide on installing RethinkDB on CentOS 8 / CentOS 7 Linux. RethinkDB is a highly scalable and open-source NoSQL database server for building realtime web applications with dramatically less engineering effort.

RethinkDB is designed with automatic failover and robust fault tolerance in mind. It exposes a new database access model instead of polling for changes, the developer can tell the database to continuously push updated query results to applications in realtime.

Below few steps will cover how you can install RethinkDB on CentOS 8 / CentOS 7 Linux. For Ubuntu / Debian Linux, we have a separate guide:

Install RethinkDB on Ubuntu & Debian

Install RethinkDB on CentOS 8 / CentOS 7

RethinkDB RPM packages are available in an RPM repository supported by RethinkDB development team. Let’s add RethinkDB repository to our system so we can easily install RethinkDB on CentOS 8 / CentOS 7 with yum|dnf package managers.

CentOS 8:

sudo dnf -y install wget
sudo wget https://download.rethinkdb.com/centos/8/`uname -m`/rethinkdb.repo -O /etc/yum.repos.d/rethinkdb.repo

CentOS 7:

sudo yum -y install wget
sudo wget https://download.rethinkdb.com/centos/7/`uname -m`/rethinkdb.repo -O /etc/yum.repos.d/rethinkdb.repo

Install RethinkDB on CentOS 8 / CentOS 7

After adding the repository, install RethinkDB on CentOS 8 / CentOS 7 with the command:

sudo yum -y install rethinkdb

Configuring RethinkDB on CentOS 8 / CentOS 7

Copy the sample configuration file and use the configuration file documentation as a guide to customize it. (If you don’t have the sample .conf file, you can download it here.)

sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
sudo vi /etc/rethinkdb/instances.d/instance1.conf

Examples:

Enable http admin console.

...............
### Web options

## Port for the http admin console
## Default: 8080 + port-offset
http-port=8080

Set the name for the server.

......
### Meta

## The name for this server (as will appear in the metadata).
## If not specified, it will be randomly chosen from a short list of names.
server-name=server1

The default Data directory is /var/lib/rethinkdb/ but you can change it.

.....................
### File path options

## Directory to store data and metadata
## Command line default: ./rethinkdb_data
## Init script default: /var/lib/rethinkdb/<name>/ (where <name> is the name of this file without the extension)
directory=/var/lib/rethinkdb/default

Set Log directory:

log-file=/var/log/rethinkdb

Set bind address – default is 127.0.0.1

bind=127.0.0.1
# bind=all           # Bind to all addresses
# bind=192.168.10.10 # Bind to specific ip address

Create data & log directory /file:

sudo mkdir /var/lib/rethinkdb
touch /var/log/rethinkdb

Set proper permissions

sudo chown -R rethinkdb:rethinkdb  /var/log/rethinkdb /var/lib/rethinkdb
sudo chmod -R 775 /var/log/rethinkdb /var/lib/rethinkdb

Start and enable rethinkdb service service.

sudo systemctl enable --now rethinkdb

Confirm service status:

$ systemctl status rethinkdb
● rethinkdb.service - LSB: This starts a set of rethinkdb server instances.
   Loaded: loaded (/etc/rc.d/init.d/rethinkdb; generated)
   Active: active (exited) since Thu 2020-01-16 13:57:33 CET; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2499 ExecStart=/etc/rc.d/init.d/rethinkdb start (code=exited, status=0/SUCCESS)

Jan 16 13:57:33 cent8 systemd[1]: Starting LSB: This starts a set of rethinkdb server instances....
Jan 16 13:57:33 cent8 rethinkdb[2499]: rethinkdb: instance1: The instance has already started
Jan 16 13:57:33 cent8 systemd[1]: Started LSB: This starts a set of rethinkdb server instances..

If you have an active firewall service, allow port 8080:

sudo firewall-cmd --add-port=8080/tcp --permanent
sudo firewall-cmd --reload

Access RethinkDB Web console on the Server IP and port 8080.

You can perform most database operations like add tables, check servers, view logs e.t.c from the web console.

List of servers added to the cluster can be viewed under the Servers section.

You’re on your way to database bliss!. Check out the RethinkDB docs and ReQL API. The ten-minute guide will also help you learn how to use the client drivers, get more in-depth information on basic commands, and start writing real applications with RethinkDB.

Here are the quick links to official and third party drivers.

Also check our recommended books for learning MySQL:

  • Getting Started With SQL – A Hands-On Approach for Beginners – a simple, to-the-point introductory read that’ll touch on the practical implications of SQL. Here, a reader gets introduced concisely to all the basics of the language;
  • Head First SQL – Your Brain on SQL – A Learner’s Guide;
  • SQL Cookbook: Query Solutions and Database Techniques for Database Developers – a book is full of hacks and tips that can be applied in day-to-day database management;
  • Teach Yourself MS SQL Server – a fairly old book, yet, it covers all the aspects of SQL Server on a high level;
  • Effective SQL – an easy-to-read guide book that explores SQL features. Keep in mind that you might need some SQL knowledge to apply the ideas that have been laid out.
You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

LEAVE A REPLY

Please enter your comment!
Please enter your name here