Setup Cockroach Cluster on Paas
Introduction
CockroachDB is a distributed database with standard SQL for cloud applications, This tutorial shows you how to deploy a secure multi-node CockroachDB cluster on Paas.
Prerequisites
- 2 or More Virtual Machine With this spesification :
- 4 vCPU
- 4 GB RAM
- Ubuntu 20.04 or Ubuntu 18.04
- Atleast 150 GB of Storage
- Each node's use private IP Address to connect each other make sure your VM be on the same subnet.
Step 1 Login to your Paas.id Account
Login to your
account via
https://dash.paas.id/auth/login
Step 2 Add VM machines to serve as Cockroach cluster node
After logging in you can start to add your Virtual Machine to create cokcroach cluster, First navigate to Services then click on New Cluster Database.
To deploy the cockroach cluster pick CockroachDB as Platform and you can fill database name and description as you want. Then click Next
After that you can add your VM by clicking on Add Node Database, fill all the information needed.
In this tutorial i use 2 virtual machine so i add one more, by default the first node you add is Master Node but you can change it by clicking on the three dots next to the node name. After that you can click next.
Click create.
Then click deploy
Wait until status of the cluster is installed.
Step 3 Accessing the cockroach Cluster
After the installation status change to installed, you can access the Cockroach Cluster. First open the Cluster services on the paas dashboard.
Then click on the Database Credential, you can see the credential of the cluster such as port, user and password.
You can access the clusters with one of the public IP address of your Virtual Machine, using Database Management Application such as Beekeper Studio or DBeaver.
Extra: Cockroach Console
You can also monitor the cockroach cluster through the the web, all you need is accessing one of your node IP address then add port 8080.
Example : https://116.192.168.144:8080. You can access the console using the user and password from the Database Credential.