Skip to main content

Install RethinkDB on CentOS 7

Installing RethinkDB

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

Create Service File

Create the service file, /usr/lib/systemd/system/rethinkdb@.service with the following content:

[Unit]
Description=RethinkDB database server for instance '%i'

[Service]
User=rethinkdb
Group=rethinkdb
ExecStart=/usr/bin/rethinkdb serve --config-file /etc/rethinkdb/instances.d/%i.conf
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Make sure that it has a permission of 644: chmod 644 /usr/lib/systemd/system/rethinkdb@.service

Creating a Rethink DB Instance

  1. Create the RethinkDB data directory: rethinkdb create -d /path/to/your/rethinkdb/directory
  2. Set the ownership to RethinkDB user: sudo chown -R rethinkdb.rethinkdb /path/to/your/rethinkdb/directory
  3. Copy RethinkDB sample config file: sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
  4. Edit /etc/rethinkdb/instances.d/instance1.conf, the line with directory= must be changed to point to your Rethink DB data directory.

Start RethinkDB Instance

 in this case would be instance1:

sudo systemctl enable rethinkdb@<name_instance>
sudo systemctl start rethinkdb@<name_instance>

References

RethinkDB Startup Doc