pstorage-discovery − Parallels Cloud Storage cluster discovery by a cluster name
Pstorage discovery is the process of (1) gathering all available unique Pstorage cluster names and (2) resolving one of the unique Pstorage cluster names into a network address of the master MDS instance. The master MDS is responsible for managing the entire cluster, so all Pstorage components must be able to discover its IP address. In fact, it is enough to discover any of MDS instances and they will redirect the client to the master instance.
There are 3 ways to make Pstorage cluster discovery work: zeroconf (multicasts), DNS (preferred), and bootstrap lists.
Zeroconf
auto discovery
Zeroconf is an auto−discovery method that does not
require any special configuration efforts. It is very
convenient for testing purposes but not recommended for use
in production. Zeroconf uses the same method as the one used
for printers or Samba/Bonjour services discovery. It
requires multicasts to be supported and enabled on the
network.
Note
zeroconf does not work if services are running in Containers
with IP based routing.
Discovery
via DNS records
A more reliable and recommended production way is to set up
some special DNS records that will help to discover
available clusters and resolve their MDS network
addresses.
Discover available Pstorage clusters via DNS TXT records
The most reliable way to discover available Pstorage clusters is to define them in a pstorage_clusters TXT record. There can be several TXT records, each containing several text entries with comma−separated cluster names.
An example of a zone file for BIND is given below:
pstorage_clusters
300 IN TXT "cluster1,cluster2"
"cluster3,cluster4"
pstorage_clusters 300 IN TXT "cluster5"
pstorage_clusters 300 IN TXT "cluster5"
"cluster6"
Discover available Pstorage clusters via DNS zone transfer
If the DNS server hosting the zone allows full zone transfers, you can use them to retrieve all SRV records (see the next chapter) and extract cluster names from them.
Resolve available Pstorage clusters via DNS SRV records
To enable MDS network addresses resolving by Pstorage cluster components, set up DNS SRV records pointing to MDS instance addresses (http://en.wikipedia.org/wiki/SRV_record).
The service field of an SRV record should be in the following format:
_pstorage._tcp.CLUSTER_NAME
An example of a zone file for BIND is given below:
$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
s4 A 192.168.100.4
; SERVICE SECTION
; MDS for cluster with name 'my−cluster' runs on
s3.pstorage.test and listen on port 2510
_pstorage._tcp.my−cluster SRV 0 1 2510 s3
; MDS for cluster with name 'my−cluster' runs on
s4.pstorage.test and listen on port 2510
_pstorage._tcp.my−cluster SRV 0 1 2510 s4
; MDS for cluster with name 'my−cluster' runs on
s1.pstorage.test and listen on port 2510
_pstorage._tcp.my−cluster SRV 0 1 2510 s1
; records for 'my−second−clusters MDSes
_pstorage._tcp.my−second−cluster SRV 0 1 2510 s4
_pstorage._tcp.my−second−cluster SRV 0 1 2510 s2
; eof
The following command shows records for the "my−cluster" MDSs:
# host
−t SRV _pstorage._tcp.my−cluster
_pstorage._tcp.my−cluster.pstorage.test has SRV record
0 1 2510 s3.pstorage.test.
_pstorage._tcp.my−cluster.pstorage.test has SRV record
0 1 2510 s4.pstorage.test.
_pstorage._tcp.my−cluster.pstorage.test has SRV record
0 1 2510 s1.pstorage.test.
This command shows records for the "my−second−cluster" MDSs:
# host
−t SRV
_pstorage._tcp.my−second−cluster.pstorage.test
_pstorage._tcp.my−second−cluster.pstorage.test
has SRV record 0 1 2510 s4.pstorage.test.
_pstorage._tcp.my−second−cluster.pstorage.test
has SRV record 0 1 2510 s2.pstorage.test.
Discovery
via bootstrap lists
If the above mentioned methods do not work for some reason,
you can specify network addresses of MDS servers manually
by:
• creating the /etc/pstorage/clusters/CLUSTER_NAME/bs.list file.
• using the −bIP[:PORT] option. Most pstorage commands, like make−mds and make−cs, support this option.
Bootstrap lists are not very flexible and are not recommended for use in production.
The format of a bs.list file is as follows:
• Each address must be specified as MDS_IP:MDS_PORT.
• Lines with a leading # are ignored.
• A line can hold several entries, and entries can be separated by commas, spaces, tabs, and semicolons.
An example bs.list file is given below:
# comment
192.168.1.1:2510, 192.168.1.2:2510
192.168.1.3:2510
Copyright © 2011−2013, Parallels, Inc. All rights reserved.
pstorage(1), pstorage−mount(1), pstorage−overview(7)