Seamless Setup: Unleashing YugabyteDB on Ubuntu 20.04 for Single Zone Deployment Mastery

Mydbops
Aug 17, 2023
12
Mins to Read
All

In a data-driven world, the demand for robust and scalable databases is greater than ever before. Introducing YugabyteDB – an open-source, high-performance distributed SQL database meticulously designed to address the complex requirements of modern applications. If you've recently explored the core concepts of YugabyteDB through our enlightening webinar, it's time to take the next step by installing and configuring this cutting-edge database system on your Linux environment.

This blog post is your comprehensive guide to setting up the YugabyteDB cluster on Ubuntu 20.04 (equally applicable to CentOS). We'll navigate through the intricate process of installation and configuration, preparing you for a successful Single Zone Deployment. For a deeper dive into the architectural nuances and key components of YugabyteDB, don't forget to revisit our recent webinar.

Prerequisites

Before we delve into the installation process, let's make sure we have all the essentials in place, from the compatible operating systems to the necessary port configurations and system requirements.

Requirement

Details

Operating System

- CentOS

7 or later

- Ubuntu

16.04 or later

Firewall/Security Group Configuration

- Cluster Communication Ports

- YB-Master RPC Communication Port

7100

- YB-TServer RPC Communication Port

9100

- Application Access Ports

- YSQL Port

5433

- YCQL Port

9042

- YEDIS Port

6379

- Cluster Health Dashboard Port

7000

Additional Notes

- Default Ports

All ports listed above are default ports

- Custom Port Usage

Custom ports can be used, if required.

Minimum System Requirements

- CPU Cores

Minimum 2 cores

- RAM

Minimum 2 GB

Access and Prerequisites

- Internet Connection

Active Internet connection required

- Sudo Access

Access to sudo privileges required

- Python3 Availability

Python3 should be available on servers

Inventory Details

To set up a three-node YugabyteDB cluster within a single data center, the following server details are required:

Hostname

IP

Operating System

mydbops1

192.168.33.13

Ubuntu 20.04.3 LTS

mydbops2

192.168.33.14

Ubuntu 20.04.3 LTS

mydbops3

192.168.33.15

Ubuntu 20.04.3 LTS

Installation

1. Downloading the YugabyteDB Packages using wget

To begin the installation process, download the YugabyteDB packages using the wget command:

 
wget https://downloads.yugabyte.com/releases/2.18.1.0/yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz
	
 
root@mydbops1:~# wget https://downloads.yugabyte.com/releases/2.18.1.0/yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz
--2023-08-14 06:40:16--  https://downloads.yugabyte.com/releases/2.18.1.0/yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz
Resolving downloads.yugabyte.com (downloads.yugabyte.com)... 172.66.41.21, 172.66.42.235, 2606:4700:3108::ac42:2aeb, ...
Connecting to downloads.yugabyte.com (downloads.yugabyte.com)|172.66.41.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 369723708 (353M) [application/x-tar]
Saving to: ‘yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz’

yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz           70%[==============================================================================>                                  ] 248.10M  5.87MB/s    eta 19s
	

2. Extract the Downloaded Package

After the download is complete, extract the downloaded package using the following command:

 
tar xvfz yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz
	

3. Change Directory to the Extracted Folder

Navigate to the extracted directory using the command:

 
 cd yugabyte-2.18.1.0
	
 
root@mydbops1:~# ls -lrth
total 353M
drwxr-xr-x 10  113 1500 4.0K Jun 16 18:59 yugabyte-2.18.1.0
-rw-r--r--  1 root root 353M Jun 27 16:54 yugabyte-2.18.1.0-b84-linux-x86_64.tar.gz
root@mydbops1:~# cd yugabyte-2.18.1.0
	

4. Execute the Configuration Script

Run the configuration script using the command:

 
./bin/post_install.sh
	
 
root@mydbops1:~/yugabyte-2.18.1.0# ./bin/post_install.sh
+ /root/yugabyte-2.18.1.0/bin/patchelf --set-interpreter /root/yugabyte-2.18.1.0/lib/ld.so ldb
warning: working around a Linux kernel bug by creating a hole of 1224704 bytes in ‘ldb’
+ /root/yugabyte-2.18.1.0/bin/patchelf --set-rpath /root/yugabyte-2.18.1.0/lib/yb:/root/yugabyte-2.18.1.0/lib/postgres:/root/yugabyte-2.18.1.0/lib/yb-thirdparty:/root/yugabyte-2.18.1.0/linuxbrew/lib ldb
+ /root/yugabyte-2.18.1.0/bin/patchelf --set-interpreter /root/yugabyte-2.18.1.0/lib/ld.so log-d
	

5. Repeat Configuration on Other Nodes

Repeat the same configuration steps on node 2 and node 3 as well.

Starting YB-Master Servers

After completing the installation on all three nodes, the next step is to initiate the YB-Master server process on each of them. The YB-Master service plays a crucial role in maintaining essential system metadata and records. These records include information about tables, tablet locations, user profiles, roles, and their corresponding permissions, among other vital details.

To initiate the YB-Master server process on Node 1, execute the following command:

 
root@mydbops1:~/yugabyte-2.18.1.0# pwd
/root/yugabyte-2.18.1.0

./bin/yb-master --master_addresses 192.168.33.13:7100,192.168.33.14:7100,192.168.33.15:7100 --rpc_bind_addresses 192.168.33.13:7100 --fs_data_dirs "/root/disk1,/root/disk2" --placement_cloud aws --placement_region ap-south-1 --placement_zone ap-south-1a  >& /root/yb-master.out &
	

This command will initiate the YB-Master server process with the specified data directories, namely disk1 and disk2. The master_addresses option requires the IP addresses of all servers in the cluster. For rpc_bind_addresses, we need to provide the ip of the local server where the command is being executed. In this instance, I've used the IP of Node 1, as this command is executed on that node. Ensure that the data directories are created before executing this command.

After the YB-Master server process is launched, you can verify its status by examining the log file located inside the data directory:

 
less ~/disk1/yb-data/master/logs/yb-master.INFO
	

This command will initiate the YB-Master server process with the specified data directories, namely disk1 and disk2. The master_addresses option requires the IP addresses of all servers in the cluster. For rpc_bind_addresses, we need to provide the ip of the local server where the command is being executed. In this instance, I've used the IP of Node 1, as this command is executed on that node. Ensure that the data directories are created before executing this command.

After the YB-Master server process is launched, you can verify its status by examining the log file located inside the data directory:

 
less ~/disk1/yb-data/master/logs/yb-master.INFO
	

Upon accessing this log, you might observe lines such as:

 
I0814 07:26:09.160346 16979 sys_catalog.cc:427] T 00000000000000000000000000000000 P e14c151a8b44464fae0b22aa0f6e2d27 [sys.catalog]: This master's current role is: FOLLOWER
I0814 07:26:09.160374 16979 sys_catalog.cc:427] T 00000000000000000000000000000000 P e14c151a8b44464fae0b22aa0f6e2d27 [sys.catalog]: This master's current role is: FOLLOWER
I0814 07:26:14.716692 16993 sys_catalog.cc:427] T 00000000000000000000000000000000 P e14c151a8b44464fae0b22aa0f6e2d27 [sys.catalog]: This master's current role is: LEADER
	

Likewise, perform the identical steps on nodes 2 and 3. It's important to ensure that you only modify the rpc_bind_addresses.

Additionally, you have the option to examine the cluster's status via the admin portal, accessible through port 7000. You can access this portal from any node within the cluster:

Please remember to replace the IPs with the corresponding IP addresses of your cluster nodes.

Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment
Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment

Cluster health also can be checked here.

Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment
Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment

Once the YB-Master servers are up and running, it's time to proceed to the YB-T servers.

Starting the YB-T Servers

The YB-TServer service plays a crucial role in handling the input-output (I/O) of end-user requests within a YugabyteDB cluster.

To initiate the YB-T servers on Node 1, execute the following command:

 
./bin/yb-tserver  --tserver_master_addrs 192.168.33.13:7100,192.168.33.14:7100,192.168.33.15:7100 --rpc_bind_addresses 192.168.33.13:9100 --enable_ysql --pgsql_proxy_bind_address 192.168.33.13:5433 --cql_proxy_bind_address 192.168.33.13:9042 --fs_data_dirs "/root/disk1,/root/disk2" --placement_cloud aws   --placement_region ap-south-1 --placement_zone ap-south-1a  >& /root/yb-tserver.out &
	

The binding address options, such as rpc_bind_addresses, pgsql_proxy_bind_address, and cql_proxy_bind_address must be specified with the IP address of the server where the command is being executed. In the preceding command, the IP address of Node 1 was used since the command was executed on Node 1. Be sure to modify these addresses accordingly when executing the command on Node 2 and Node 3.

Be sure to follow the same process on both Node 2 and Node 3 as well.

After successfully starting the YB-T servers on all nodes, you can confirm their status by accessing the Cluster's admin portal, which runs on port 7000, and navigate to the Tablet Servers section.

Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment
Install and Configure YugabyteDB on Ubuntu 20.04 for a Single Zone Deployment

With the 3-node YugabyteDB cluster successfully initiated in a single data center, you can establish connections to the cluster using ports such as 5433 for YSQL and 9042 for YCQL.

YSQL

To connect to YSQL, run the following command:

 
root@mydbops1:~/yugabyte-2.18.1.0# ./bin/ysqlsh -h192.168.33.13
ysqlsh (11.2-YB-2.18.1.0-b0)
Type "help" for help.

yugabyte=#

	

YCQL

To connect to YCQL, use the following commands:

 
root@mydbops1:~/yugabyte-2.18.1.0# export CQLSH_HOST='192.168.33.13'
root@mydbops1:~/yugabyte-2.18.1.0# ./bin/ycqlsh
Connected to local cluster at 192.168.33.13:9042.
[ycqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
ycqlsh>
	

With your cluster up and running, you're now equipped to explore the world of distributed databases like never before.

We hope this blog has provided you with a comprehensive understanding of the installation and configuration process. Stay tuned for our next blog post, where we'll delve into the exciting topic of scaling out the cluster.

No items found.

About the Author

Mydbops

Subscribe Now!

Subscribe here to get exclusive updates on upcoming webinars, meetups, and to receive instant updates on new database technologies.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.