Setting Up Clients
The process of setting up a client includes three stages:
- Preparing to mount the Storage cluster to the client.
- Mounting the cluster.
- Configuring virtual machines and containers to be stored in the cluster.
Stage 1: Preparing to Mount the Cluster
To prepare for mounting the Storage cluster to the client:
Log in to the server you want to act as a client as root or as a user with root privileges.
Download and install the
vstorage-libs-sharedandvstorage-clientRPM packages. 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:1# yum install vstorage-clientCreate the directory to mount the Storage cluster to, for example:
1# mkdir -p /vstorage/stor1Make sure that cluster discovery is configured in your network. 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 client 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 or some of the chunk servers. Otherwise, run the following command to authenticate the server in the cluster:
1 2# 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.
vstoragethen compares the provided password with the one stored on the MDS server, and if the passwords match, successfully authenticates the server.
Stage 2: Mounting the Cluster
Next, you need to mount the cluster to make it accessible to the client. You can do this with the the vstorage-mount command. For example, if your Storage cluster has the name of stor1, you can run this command to mount it to the /vstorage/stor1 directory on the client:
| |
You can also configure the client to automatically mount the cluster to the /vstorage/stor1 directory when the client boots. To do this, add a line like the following to the /etc/fstab file:
| |
--fail-on-nospace option. In this case an ERR_NO_SPACE error will be returned if the cluster runs out of free space.Stage 3: Configuring Virtual Machines and Containers
To configure a server with Virtuozzo to store its virtual machines and containers in the cluster, do the following:
Log in to the server as
root.Configure containers for use in the cluster:
Check the path to the container private area in the
/etc/vz/vz.conffile. By default, the path is set to the following:1VE_PRIVATE=/vz/private/$VEIDMake a symbolic link from the container private area to the directory in the Storage cluster that will store containers. Assuming that this directory is
/vstorage/stor1/private, create this directory and run the following command:1# ln -s /vstorage/stor1/private/ /vz/private
If the/vz/privatedirectory already exists on your server, remove it before running theln -scommand.Configure virtual machines for use in the cluster:
Check the default location of virtual machine files:
1 2# prlsrvctl info | grep "VM home" VM home: /vz/vmprivateMake a symbolic link from the default location to the directory in the Storage cluster that will store virtual machines. For example, to make a link to the
/vstorage/stor1/vmprivatedirectory, create this directory and execute the following command:1# ln -s /vstorage/stor1/vmprivate/ /vz/vmprivateIf the/vz/vmprivatedirectory already exists on your server, remove it before running theln -scommand.