Virtuozzo Storage

From OpenVZ Virtuozzo Containers Wiki
Revision as of 12:53, 9 January 2014 by Lyudmila Ivanichkina (talk | contribs) (Created page with "This article explains how to setup Parallels Cloud Storage cluster and deploy ploop-based OpenVZ container inside the cluster. ==Setting up Parallels Cloud Storage cluster== ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article explains how to setup Parallels Cloud Storage cluster and deploy ploop-based OpenVZ container inside the cluster.

Setting up Parallels Cloud Storage cluster

Choose a name for the cluster that will uniquely identify it among other clusters in your network. A name may contain the characters a-z, A-Z, 0-9, dash (-), and underscore (_). Here we will use 'test_cluster' as a cluster name.

Create metadata server (MDS)

Log in to the computer you want to configure as a metadata server as root or as a user with root privileges.

Download and install the following RPM packages: pstorage-ctl, pstorage-libs-shared and pstorage-metadata-server. The packages are available in the Parallels Cloud Server remote repository (this repository is automatically configured for your system when you install Parallels Cloud Server) and can be installed with this command:

# yum install pstorage-ctl pstorage-libs-shared pstorage-metadata-server

Create MDS:

# pstorage -c test_cluster make-mds -I -a 10.30.100.101 -r /pstorage/test_cluster-mds -p

This command creates new Parallels Cloud Storage cluster and metadata server and configures the IP address of 10.30.100.101 for communication with this server (replace 10.30.100.101 with IP address of your own MDS server). The command will ask you to enter the password for authentication in your cluster. The password you specify is encrypted and saved into the /etc/pstorage/clusters/pcs1/auth_digest.key file.

After you have created the MDS server, start the MDS management service (pstorage-mdsd) and configure it to start automatically when the server boots:

# service pstorage-mdsd start

# chkconfig pstorage-mdsd on

Every time you add new server or client to the cluster, you need to create the bs.list file in the /etc/pstorage/clusters/Cluster_Name directory (make this directory if it does not exist) on the server you are configuring for the cluster and specify IP addresses and ports of the MDS servers in the cluster.

For example:

# echo "10.30.100.101:2510" >> /etc/pstorage/clusters/test_cluster/bs.list

Create chunk server (CS)

Log in to the computer you want to configure as a chunk server as root or as a user with root privileges.

Download and install the following RPM packages: pstorage-ctl, pstorage-libs-shared and pstorage-chunk-server. The packages are available in the Parallels Cloud Server remote repository (this repository is automatically configured for your system when you install Parallels Cloud Server) and can be installed with this command:

# yum install pstorage-ctl pstorage-libs-shared pstorage-chunk-server

Authenticate the server in the cluster:

# pstorage -c test_cluster auth-node

The command will ask you the password that you specified when setting up the first MDS server.

Create CS:

# pstorage -c test_cluster make-cs -r /pstorage/test_cluster-cs -t 1

After you have created the chunk server, start the chunk management service (pstorage-csd) and configure it to start automatically when the chunk server boots:

# service pstorage-csd start

# chkconfig pstorage-csd on

Setting up client

Log in to the computer you want to act as a client as root or as a user with root privileges.

Download and install the following RPM packages: pstorage-libs-shared and pstorage-client. The packages are available in the Parallels Cloud Server remote repository (this repository is automatically configured for your system when you install Parallels Cloud Server) and can be installed with this command:

# yum install pstorage-libs-shared pstorage-client

Create the directory to mount the Parallels Cloud Storage cluster to:

# mkdir -p /mnt/pcs

Mount cluster:

# pstorage-mount -c test_cluster /mnt/pcs/

For more information on setting up pstorage cluster please refer to the Parallels Cloud Storage documentation http://download.parallels.com/doc/pcs/pdf/Parallels_Cloud_Storage.pdf.

Create ploop-based container inside cluster

Log in to the computer that you have configured to act as a client for the Parallels Cloud Storage cluster. Further we assume that you have already installed and configured OpenVZ on this computer.

Load kernel modules if they aren't loaded:

# modprobe ploop pfmt_ploop1 pio_kaio

Create folder for container data:

# mkdir -p /mnt/pcs/container

Create ploop-based container with CTID=101 (replace template name with your own template):

vzctl create 101 --layout ploop --ostemplate centos-6-x86_64 --private /mnt/pcs/container/

Now container with CTID=101 is ready for use.