3.1. Configuring MDS Servers¶
For a Virtuozzo Storage cluster to function, the majority of MDS servers must be up and running in the cluster. So to ensure high availability of a cluster, you need to set up at least three MDS servers for it. This will allow you to survive the loss of one MDS server. By configuring five MDS servers for a cluster, you can ensure that your cluster will continue operating even if two MDS servers go offline.
Note the following:
When adding and removing MDS servers, make sure that the running MDS servers in the cluster always have a majority.
Remove non-functioning MDS servers from the cluster as soon as possible (e.g., right after you replace a broken server with a new one) to ensure that all MDS servers are up and running and the majority is not lost if one more MDS server fails. Let us assume that 3 MDS servers are running in your cluster. 1 MDS server fails so you add a new MDS server to the cluster. Now the total number of MDS servers in the cluster is 4, with one server offline. If one more MDS server fails, the cluster will have only 2 running MDS servers and become unavailable because the majority (3 running MDS servers) cannot be achieved any more.
This section explains how to:
Add new MDS servers to a cluster.
Remove existing MDS servers from a cluster.
3.1.1. Adding MDS Servers¶
The procedure of setting up the first MDS server is described in Setting Up the First Metadata Server. To configure a second and all subsequent MDS servers for a cluster, follow the steps below:
Make sure that you remember the exact name of the Virtuozzo Storage cluster where you want to add an MDS server. The example below uses
stor1
as the cluster name.Log in to the computer you want to configure as an MDS server and add to the cluster as root or as a user with root privileges.
Download and install the following RPM packages on the computer:
vstorage-ctl
,vstorage-libs-shared
, andvstorage-metadata-server
. These packages can be installed with this command:# yum install vstorage-metadata-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 physical server where you are setting up the MDS server has never been authenticated in the cluster before. For example, you can skip this step if you have already configured the server as a chunk server or a client. 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. Enter 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.Create the MDS server and add it to the cluster:
# vstorage -c stor1 make-mds -a 10.30.100.102 -r /vstorage/stor1-mds
In the command above:
stor1
is the name of the cluster you are adding the MDS server to.10.30.100.102
is the IP address of the new MDS server. Replace 10.30.100.102 in the example above with the IP address of your own MDS server. The specified IP address must be (1) static (or in the case of using DHCP, mapped to the MAC address of the MDS server) and (2) chosen from the range of IP addresses on the BackNet network dedicated to your Virtuozzo Storage cluster./vstorage/stor1-mds
is the path to a journal that will store the information about thestor1
cluster. When choosing a directory for storing the journal, make sure that the partition where the directory is located has at least 10 GB of free disk space.
If the DNS records or Zeroconf discovery is not configured in your network, you need to additionally use the
-b
option and specify the IP addresses of the first MDS server (and all other MDS servers, if you have more than one in your cluster) when running the command:# vstorage -c stor1 make-mds -a 10.30.100.102:2510 -r /vstorage/stor1-mds -b 10.30.100.101
Start the MDS management service (
vstorage-mdsd
) and configure it to start automatically on the MDS server boot:# systemctl start vstorage-mdsd.target
For instructions on how to check that the MDS server has been successfully configured for your cluster, see Monitoring Virtuozzo Storage Clusters.
3.1.2. Removing MDS Servers¶
Sometimes, you may need to remove an MDS server from a Virtuozzo Storage cluster, for example, to upgrade the server or to perform some maintenance tasks on it. To do this:
Configure a new MDS server to replace the one you plan to remove from the cluster. For instructions, see Adding MDS Servers.
Find out the index number of the MDS server to remove by running the following command on some of your MDS servers or clients:
# vstorage -c stor1 top
This will display detailed information about the cluster. Locate the section with the information about MDS servers, for example:
... MDSID STATUS %CTIME COMMITS %CPU MEM UPTIME HOST M 1 avail 0.0% 0/s 0.0% 64m 17d 6h 10.30.17.38 2 avail 0.0% 0/s 0.0% 50m 12d 3h 10.30.45.12 3 avail 0.0% 0/s 0.0% 57m 7d 1h 10.30.10.15 ...
The index number is displayed in the MDSID column. In the output above, three MDS servers are configured for the
stor1
cluster. They have index numbers of 1, 2, and 3.Remove the MDS server from the cluster. For example, to remove the MDS server with index number 3, run this command:
# vstorage -c stor1 rm-mds 3