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 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 tee /etc/yum.repos.d/rethinkdb.repo<<EOF
[rethinkdb]
name=RethinkDB
enabled=1
baseurl=https://download.rethinkdb.com/repository/rocky/8/x86_64/
gpgkey=https://download.rethinkdb.com/repository/raw/pubkey.gpg
gpgcheck=1
EOF
CentOS 7:
sudo tee /etc/yum.repos.d/rethinkdb.repo<<EOF
[rethinkdb]
name=RethinkDB
enabled=1
baseurl=https://download.rethinkdb.com/repository/centos/7/x86_64/
gpgkey=https://download.rethinkdb.com/repository/raw/pubkey.gpg
gpgcheck=1
EOF
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 and listen on any address.
### Network options
bind=all
### 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 all
bind=all
# 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
sudo 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 rethinkdb
sudo systemctl start 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 (running) since Sat 2022-05-28 17:57:39 UTC; 20s ago
Docs: man:systemd-sysv-generator(8)
Process: 5701 ExecStart=/etc/rc.d/init.d/rethinkdb start (code=exited, status=0/SUCCESS)
Tasks: 71 (limit: 23654)
Memory: 54.7M
CGroup: /system.slice/rethinkdb.service
├─5817 /usr/bin/rethinkdb --daemon --config-file /etc/rethinkdb/instances.d/instance1.conf --runuser rethinkdb --rungroup rethinkdb --pid-file /var/run/rethinkdb/instance1/pid_file --dir>
└─5818 /usr/bin/rethinkdb --daemon --config-file /etc/rethinkdb/instances.d/instance1.conf --runuser rethinkdb --rungroup rethinkdb --pid-file /var/run/rethinkdb/instance1/pid_file --dir>
lines 1-10/10 (END)
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.
- JavaScript
- Python
- Ruby
- Java
- C#/.NET: RethinkDb.Driver, rethinkdb-net
- C++: librethinkdbxx
- Clojure: clj-rethinkdb
- Elixir: rethinkdb-elixir
- Go: GoRethink
- Haskell: haskell-rethinkdb
- PHP: php-rql
- Rust: reql
- Scala: rethink-scala
Also check our recommended books for learning MySQL:
- Murach’s MySQL (3rd Edition)
- MySQL (5th Edition) (Developer’s Library)
- MySQL Explained: Your Step By Step Guide to Database Design
- 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.