YugaByte DB
Cluster Management
Database Tutorial
Node Addition
Tech Tips

How does one add a node or nodes to an existing YugaByte DB CE cluster?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

YugaByte DB is a high-performance, open-source distributed SQL database designed to support both scale-out and geographically distributed architectures. A common task when working with distributed databases like YugaByte DB is expanding the cluster size to increase capacity or improve fault tolerance. This can be achieved by adding one or more nodes to the existing cluster. Below, the process specific to YugaByte DB Community Edition (CE) is elaborated, including preparation, actual steps, verification, and considerations.

Preparation

Before adding a node to a YugaByte DB cluster, ensure that the new machine meets the same system requirements as the existing nodes (such as OS, memory, CPU). Also, make sure that the new node can communicate with all current nodes over the necessary ports. Typically, these include:

  • 7100 (for YB-Master RPCs)
  • 9100 (for YB-TServer RPCs)
  • 9300 (for Redis APIs)
  • 9042 (for CQL APIs)
  • 5433 (for YSQL APIs)

Also, configure the new node by installing YugaByte DB and setting up the appropriate configurations needed by the cluster.

Adding a Node

Step-by-Step Guide

  1. Install YugaByte DB: If not already installed, download and install YugaByte on the new node using the same version as that of the existing cluster nodes. Detailed instructions for the installation are available on the official YugaByte documentation site.
  2. Start the YB-Master process: On the new node, start the master process. This can be done using the yb-master binary with a command similar to:
bash
   $ ./bin/yb-master --master_addresses=existing_node_1:7100,existing_node_2:7100,new_node:7100 --rpc_bind_addresses=new_node:7100 --fs_data_dirs=/path/to/data-dir

Replace existing_node_1, existing_node_2 with the IP addresses or hostnames of current master nodes, and new_node with the IP address/hostname of the new master node.

  1. Start the YB-TServer process: After the master, initiate the TServer process on the new node:
bash
   $ ./bin/yb-tserver --tserver_master_addrs=existing_node_1:7100,existing_node_2:7100,new_node:7100 --rpc_bind_addresses=new_node:9100 --fs_data_dirs=/path/to/data-dir

It's crucial that the tserver_master_addrs argument includes all master nodes, not just the new one.

  1. Restart other nodes: Restart the master and tserver processes on each existing node to recognize the new configuration. Be sure to point their --master_addresses towards the updated master list.

Verification

After setting up the nodes, verify the status:

  • Use the yb-admin CLI tool to check cluster configuration and confirm the addition of the new node.
  • Access the YugaByte DB Admin UI (typically accessible on port 7000 of any of the nodes) and verify that the new node appears with status ALIVE.

Considerations

When expanding a YugaByte DB cluster, consider the following:

  • Load Balancing: The load (both read and write) might rebalance across the cluster after adding a new node. Monitor the load and performance.
  • Data Migration: Existing data will automatically start sharding across the additional node(s). This process takes time and might temporarily impact performance.
  • Consistency and Replication: Ensure that the cluster’s replication factor stays aligned with requirements to maintain data consistency and durability.

Summary Table

AspectDetail
PreparationCheck requirements, install YugaByte, configure
Steps to Add a NodeInstall DB, start YB-Master and YB-TServer, restart nodes
VerificationUse yb-admin and Admin UI
Key ConsiderationsLoad balancing, data migration, consistency

By methodically following these steps and considerations, one can successfully scale out a YugaByte DB CE cluster by adding new nodes, thus enhancing its capacity and resilience.


Course illustration
Course illustration

All Rights Reserved.