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
- Create the RethinkDB data directory:
rethinkdb create -d /path/to/your/rethinkdb/directory
- Set the ownership to RethinkDB user:
sudo chown -R rethinkdb.rethinkdb /path/to/your/rethinkdb/directory
- Copy RethinkDB sample config file:
sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
- Edit
/etc/rethinkdb/instances.d/instance1.conf
, the line withdirectory=
must be changed to point to your Rethink DB data directory.
Start RethinkDB Instance
instance1
:
sudo systemctl enable rethinkdb@<name_instance>
sudo systemctl start rethinkdb@<name_instance>