Previous page

Next page

Locate page in Contents

Print this page

Using DNS Records

The recommended way of configuring cluster discovery is to use special DNS records. The process of setting up this type of cluster discovery includes two steps:

  1. Announcing the information about running MDS servers in the cluster so that chunk servers, clients, and new MDS servers can automatically obtain this information when necessary. You do this using DNS SRV records.
  2. Defining DNS TXT records or enabling DNS zone transfers so that you can discover the unique names of available clusters when necessary.

Announcing the Information About MDS Servers

You can use SRV records to announce the information about running MDS servers in the cluster. The service field of an SRV record pointing to an MDS server must have the following format:

_pstorage._tcp.CLUSTER_NAME

where

  • _sstorage is the symbolic name reserved for Virtuozzo Storage.
  • _tcp denotes that Virtuozzo Storage uses the TCP protocol for communication in the cluster.
  • CLUSTER_NAME is the name of the Virtuozzo Storage cluster described by the record.

The following example shows a DNS zone file that contains records for three MDS servers listening on the default port 2510 and configured for the stor1 cluster:

$ORIGIN stor.test.

$TTL 1H

@ IN SOA ns rname.invalid. (1995032001 5H 10M 1D 3H)

NS @

A 192.168.100.1

s1 A 192.168.100.1

s2 A 192.168.100.2

s3 A 192.168.100.3

; SERVICE SECTION

; MDS for the 'stor1' cluster runs on s1.stor.test and listens on port 2510

_pstorage._tcp.stor1 SRV 0 1 2510 s1

; MDS for the 'stor1' cluster runs on s2.stor.test and listens on port 2510

_pstorage._tcp.stor1 SRV 0 1 2510 s2

; MDS for the 'stor1' cluster runs on s3.stor.test and listens on port 2510

_pstorage._tcp.stor1 SRV 0 1 2510 s3

; eof

Once you configure DNS SRV records for the stor1 cluster, you can list them by issuing the following SRV query:

# host -t SRV _pstorage._tcp.stor1

_pstorage._tcp.stor1.stor.test has SRV record 0 1 2510 s1.stor.test.

_pstorage._tcp.stor1.stor.test has SRV record 0 1 2510 s2.stor.test.

_pstorage._tcp.stor1.stor.test has SRV record 0 1 2510 s3.stor.test.

Discovering Cluster Names

The easiest and most efficient way of discovering the names of clusters in your network is to specify all cluster names in pstorage_clusters TXT records of DNS zone files. The following example provides a sample of valid TXT record formats for Virtuozzo Storage clusters:

pstorage_clusters 300 IN TXT "cluster1,cluster2" "cluster3,cluster4"

pstorage_clusters 300 IN TXT "cluster5"

pstorage_clusters 300 IN TXT "cluster6" "cluster7"

Another way of discovering cluster names in your network is to use DNS zone transfers. Once DNS zone transfers are enabled, cluster tools will be able to retrieve all DNS SRV records from DNS zone files and extract cluster names from these records.

After you set up cluster discovery via DNS TXT records or DNS zone transfers, you can run the pstorage discover command on any of the cluster servers to discover the names of all clusters in your network:

# pstorage discover

02-10-12 13:16:46.233 Discovering using DNS TXT records: OK

02-10-12 13:16:46.308 Discovering using DNS zone transfer: FAIL

stor1

stor2

stor3

The example pstorage output shows that:

  • Clusters names are discovered via the DNS TXT records.
  • Three clusters with the names of stor1, stor2, and stor3 are currently set up on the network.