• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Setup RethinkDB Cluster On Ubuntu 14

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
60
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Installation
  3. Connect To Your New VM Instance
  4. Accessing Database
    1. Web Access
    2. Command-Line Access
  5. Remove Test Database
  6. Playing Around in Database
  7. Setting Up Cluster
  8. Conclusion
    1. Other Versions
  9. Want to contribute?


Introduction

RethinkDB is a NoSQL database that stores data as JSON documents. It has a super intuitive query language and has features commonly available in traditional RDBMS like “table joins” and “group by”. This tutorial will explain how to setup a RethinkDB cluster using 3 Vultr VPS servers running Ubuntu 14.04.

Installation

Create a new Vultr startup script using the following content as a template.

#!/usr/bin/env bash

echo ">>> Installing RethinkDB<<<"

# Add RethinkDB Repo to list of Repos
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 -

# Update Apt Repo & Install RethinkDB
sudo apt-get update
sudo apt-get install -qq rethinkdb

Spin up a Vultr VM instance by picking any Server Type, Location, and Server Size of your choice. For the choice of Operating System, make sure to select Ubuntu 14.04 x64 and check the Enable Private Network option. Also MAKE SURE to select the startup script created above before placing your order.

Connect To Your New VM Instance

Once your new VM instance is ready, connect to it from a terminal/command-prompt via SSH.

ssh root@[vultr-ip-address]

When prompted for your password, use the initial password under “server info” tab from Vultr admin.

You can update your password by typing passwd and hitting the ENTER key. Ubuntu will prompt you for a new password (this way you can choose something that you easily remember).

Accessing Database

Start RethinkDB by running command below. Note that we’re “binding to all” so that we don’t run into issues when trying to access RethinkDB’s web admin interface.

rethinkdb --bind all

Once RethinkDB is started, you access it either by command-line or a web interface.

Web Access

To access via web, use port 8080 by typing http://[vultr-ip-address]:8080 in the address bar of your web browser. You should see RethinkDB’s awesome web administration tool.

Command-Line Access

To access via command-line, start a new terminal/command-prompt session and connect to the server via SSH as explained previously. Then, issue the command rethinkdb admin join 127.0.0.1:29015. Make sure to use port 29015.

Remove Test Database

We will be using the web interface going forward to manipulate the database. Access it by browsing to http://[vultr-ip-address]:8080 and click on the “Tables” link. You will see that RethinkDB already installed a “test” database. Click on the “Data Explorer” link and run below command to delete the “test” database.

r.dbDrop('test')

Playing Around in Database

While still on the “Data Explorer” section of RethinkDB’s admin, create a new database named “tweetDB” by running the code below.

r.dbCreate('tweetDB')

Next, create a “tweets” table.

r.db('tweetDB').tableCreate('tweets')

Insert some records into the “tweets” table.

r.db('tweetDB').table('tweets').insert([
    {
        name: 'Lami',
        twitterHandle: 'mrLami',
        message: 'Best cloud hosting on the planet - vultr'
    },
    {
        name: 'Vultr Hosting',
        twitterHandle: '@TheVultr',
        message: '50% off on new instances - coupon - tgif'
    }
])

Query “tweets” table to see results.

r.db('tweetDB').table('tweets')

You should see the following under tree view (with different id’s).

[
    {
        "id":  "6afe436c-7db4-4c86-b4db-3279acb3265d" ,
        "message":  "50% off on new instances - coupon - tgif" ,
        "name":  "Vultr Hosting" ,
        "twitterHandle":  "@TheVultr"
    } ,
    {
        "id":  "fd328cd5-d9f4-40ee-8a32-880cd8cda15d" ,
        "message":  "Best cloud hosting on the planet - vultr" ,
        "name":  "Lami" ,
        "twitterHandle":  "mrLami"
    }
]

Setting Up Cluster

Spin up a second and third machine using instructions from the “Installation”, “Connect To Your New VM Instance” and “Accessing Database” sections of this guide. Make sure to delete the “test” database on each of the new instances, and DO NOT add any new databases to them.

After deleting the “test” database from second and third instances, go back to their command prompts and stop RethinkDB by issuing Ctrl + C (or Cmd + C on Mac). Now start RethinkDB again on these instances by using the below command (we’re basically telling new second and third instances to join the first).

$ rethinkdb --join [ip-of-first-vultr-vm]:29015 --bind all

On the second and third instances, access web admin interfaces, and go to the “Data Explorer” section. Run the following query to get a list of tweets.

 r.db('tweetDB').table('tweets')

You will see that they have already replicated from the master (first VM setup) instance.

Conclusion

Although RethinkDB is still in its infancy at the time of this writing, it holds a lot of promise and has a powerful web-based administration interface that makes arduous tasks usually involved with scaling a database (sharding, replication) easily accomplished with just a few clicks.

For further reading, visit the RethinkDB Docs. Also check out #rethinkdb IRC channel to learn more from the community.

Other Versions

CentOS 7

Ubuntu 14

Written by Lami Adabonyan

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Load Balance with Docker

Next Post

Installing Gentoo Linux on a Vultr Server

Next Post

Installing Gentoo Linux on a Vultr Server

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet