This section describes how to deploy YugabyteDB in a single region or data center in a multi-zone/multi-rack configuration.
Use the yugabyted configuration utility to deploy and manage clusters.
The yugabyted executable file is packaged with YugabyteDB and located in the YugabyteDB home bin directory.
Optional settings
Depending on your specific deployment, consider setting the following additional flags.
YCQL only deployment
If you are only using the YCQL API, you must turn off YSQL memory optimization by adding the following to --tserver_flags
:
--tserver_flags "use_memory_defaults_optimized_for_ysql=false"
YSQL Connection Manager
If you want to use YSQL Connection Manager for connection pooling, add the following to --tserver_flags
:
--tserver_flags "enable_ysql_conn_mgr=true"
YB Controller service
After installing YugabyteDB, if you want to use backup and restore, you also need to install the YB Controller service, which manages backup and restore operations. YB Controller is included in the share
directory of your YugabyteDB installation.
For example, if you installed v2024.2.3.1, extract the ybc-2.0.0.0-b19-linux-x86_64.tar.gz
file into the ybc
folder as follows:
cd yugabyte-2024.2.3.1
mkdir ybc | tar -xvf share/ybc-2.0.0.0-b19-linux-x86_64.tar.gz -C ybc --strip-components=1
Deploy a multi-zone cluster
Note that single zone configuration is a special case of multi-zone where all placement-related flags are set to the same value across every node.
For instructions on running a single cluster across multiple data centers or 2 clusters in 2 data centers, refer to Multi-DC deployments.
To create a secure multi-zone cluster:
-
Start the first node by running the
yugabyted start
command, using the--secure
flag and passing in the--cloud_location
and--fault_tolerance
flags to set the node location details.Set the
--backup_daemon
flag to true if you want to perform backup and restore operations.Add flags to
--tserver_flags
as required../bin/yugabyted start --secure --advertise_address=<IP_of_VM_1> \ --backup_daemon=true \ --cloud_location=aws.us-east-1.us-east-1a \ --fault_tolerance=zone \ --tserver_flags="enable_ysql_conn_mgr=true"
-
Create certificates for the second and third virtual machine (VM) for SSL and TLS connection, as follows:
./bin/yugabyted cert generate_server_certs --hostnames=<IP_of_VM_2>,<IP_of_VM_3>
-
Manually copy the generated certificates in the first VM to the second and third VM, as follows:
-
Copy the certificates for the second VM from
$HOME/var/generated_certs/<IP_of_VM_2>
in the first VM to$HOME/var/certs
in the second VM. -
Copy the certificates for the third VM from
$HOME/var/generated_certs/<IP_of_VM_3>
in first VM to$HOME/var/certs
in the third VM.
-
-
Start the second and the third node on two separate VMs using the
--join
flag.Set the
--backup_daemon
flag to true if you want to perform backup and restore operations.Add flags to
--tserver_flags
as required../bin/yugabyted start --secure --advertise_address=<IP_of_VM_2> \ --join=<ip-address-first-yugabyted-node> \ --backup_daemon=true \ --cloud_location=aws.us-east-1.us-east-1b \ --fault_tolerance=zone \ --tserver_flags="enable_ysql_conn_mgr=true"
./bin/yugabyted start --secure --advertise_address=<IP_of_VM_3> \ --join=<ip-address-first-yugabyted-node> \ --backup_daemon=true \ --cloud_location=aws.us-east-1.us-east-1c \ --fault_tolerance=zone \ --tserver_flags="enable_ysql_conn_mgr=true"
For more information on the yugabyted start command, refer to start.
Grow the cluster
To grow the cluster, add additional nodes just as you do when creating the cluster.