2.6. Setting Up Chunk Servers¶
A chunk server stores actual data of virtual machines and ontainers and services requests to it. All data is split into chunks and can be stored in a Virtuozzo Storage cluster in multiple copies called replicas.
Initially, any cluster is configured to have only one replica per each data chunk, which is sufficient to evaluate the Virtuozzo Storage functionality using one server only. In production, however, to provide high availability for your data, you need to configure the cluster for each data chunk to have at least three replicas. This requires at least three chunk servers to be set up in the cluster. You can modify the default replication parameter using the vstorage
utility. For details, see Configuring Replication Parameters.
Note the following:
Using shared JBOD arrays across multiple nodes running CS services may introduce a single point of failure and make the cluster unavailable if all data replicas happen to be allocated and stored on the failed JBOD. For more information, see Configuring Failure Domains.
Do not place chunk servers on disks already used in other I/O workloads, e.g., system or swap. Sharing disks between CS and other sources of I/O will result in severe performance loss and high I/O latencies.
The process of setting up a chunk server includes two stages:
Preparing to create a chunk server.
Creating the chunk server.
2.6.1. Stage 1: Preparing to Create a Chunk Server¶
To prepare for creating a chunk server, do the following:
Log in to the computer you want to act as a chunk server as root or as a user with root privileges.
Open the firewall for storage traffic. For a list of ports to open, consult Opened Ports on Servers in Virtuozzo Storage Clusters.
Download and install the following RPM packages:
vstorage-ctl
,vstorage-libs-shared
, andvstorage-chunk-server
. These packages are available in the Virtuozzo remote repository (this repository is automatically configured for your system when you install Virtuozzo) and can be installed with this command:# yum install vstorage-chunk-server
Make sure that cluster discovery is configured for the server. For details, see Configuring Cluster Discovery.
Authenticate the server in the cluster. This step is required only if the server where you are setting up the chunk server has never been authenticated in the cluster before. For example, you can skip this step if this is the same server where you set up the first MDS server. Otherwise, run the following command to authenticate the server in the cluster:
# vstorage -c stor1 auth-node Please enter password for cluster:
During its execution, the command asks you for the password to validate the server. Type the password you specified when setting up the first MDS server and press Enter.
vstorage
then compares the provided password with the one stored on the MDS server, and if the passwords match, successfully authenticates the server.If the disk the CS will be created on has not been prepared for Virtuozzo Storage, do so as described in Preparing Disks for Virtuozzo Storage.
Mount the prepared disk.
2.6.2. Stage 2: Creating a Chunk Server¶
Take note of the following:
For large clusters (according to Recommended Configuration), it is critically important to configure proper failure domains to improve data availability. For more information, see Configuring Failure Domains.
For details on creating chunk servers with journals on SSD, see Setting Up Chunk Servers with a Journal on SSD.
To create the chunk server, use the vstorage make-cs
command, for example:
# vstorage -c stor1 make-cs -r /vstorage/stor1-cs
This command:
Creates the
/vstorage/stor1-cs
directory if it does not exist and configures it for storing data chunks.Configures your disk as a chunk server and joins it to the
stor1
cluster.Assigns the chunk server to the default storage tier. Storage tiers allow you to keep different kinds of data on different chunk servers. To assign the CS to a specific tier, add
-t <tier>
parameter to the command, e.g.,-t 1
to assign the CS to tier 1. For details, see Configuring Storage Tiers.
After you have created the chunk server, start the chunk management service ( vstorage-csd
) and configure it to start automatically when the chunk server boots:
# systemctl start vstorage-csd.target
# systemctl enable vstorage-csd.target
Once you set up the first chunk server, proceed with creating other chunk servers.
2.6.2.1. Creating Host UUIDs for Chunk Servers¶
Virtuozzo Storage distinguishes hosts the CS services run on by unique host UUIDs generated during installation. If you plan to set up new hosts by deploying a golden image with an OS and preinstalled Virtuozzo Storage packages, you will need to generate new host UUIDs instead of the one inherited from the golden image.
To create a CS on a copy of the host, do the following:
Make sure the golden image does not contain any metadata servers, chunk servers, or clients.
Deploy the golden image on a clean host.
Generate a new UUID for the host to replace the one inherited from the golden image:
# /usr/bin/uuidgen -r | tr '-' ' ' | awk '{print $1$2$3}' > /etc/vstorage/host_id
Note
For more information on the
uuidgen
utility, see its man page.Create a CS on the host.