Zaher Ghaibeh
PHP Backend developer
I've experience in a few PHP Frameworks, such as Laravel, Lumen and Slim (The last two are used for building Microservices/API services).
How to create rethinkdb cluster
Published at Monday, October 12, 2015 , Categorized under: Linux, Other, Rethinkdb

To be honest, its really simple and does not need that much work.

1- Create 3 ubuntu 14.04 servers on DigitalOcean affiliated link or your favorite VPS provider.

2- Install rethinkdb on all of them using the following commands:

source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install rethinkdb

3- Prepare all of your instance to run on startup.

cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance.conf
service rethinkdb restart

4- Edit the second and the third server and point tell them to Join the first server

nano /etc/rethinkdb/instances.d/instance.conf

Search for the join line and edit it to be like

## The host:port of a node that rethinkdb will connect to
## This option can be specified multiple times.
## Default: none
join=xxx.xxx.xxx.xxx:29015

remember to replace xxx.xxx.xxx.xxx with the IP address for your first server.

If the 3 servers on the same datacenter, you can use the internal ip not the external one.

5- Also while you are editing that file remember to disable the http admin for both the second and the third server

## Disable web administration console
no-http-admin

6- Edit the first server so that it will listen to the outside connections, so just change the bind value to all

## Address of local interfaces to listen on when accepting connections
## May be 'all' or an IP address, loopback addresses are enabled by default
## Default: all local addresses
bind=all

7- Now restart the 3 servers, and point your browser to http://server-one-ip-address:8080 to access the admin interface