]> git.proxmox.com Git - ceph.git/blame - ceph/doc/rados/configuration/mon-lookup-dns.rst
import quincy beta 17.1.0
[ceph.git] / ceph / doc / rados / configuration / mon-lookup-dns.rst
CommitLineData
7c673cae 1===============================
9f95a23c 2Looking up Monitors through DNS
7c673cae
FG
3===============================
4
5Since version 11.0.0 RADOS supports looking up Monitors through DNS.
6
7This way daemons and clients do not require a *mon host* configuration directive in their ceph.conf configuration file.
8
9Using DNS SRV TCP records clients are able to look up the monitors.
10
11This allows for less configuration on clients and monitors. Using a DNS update clients and daemons can be made aware of changes in the monitor topology.
12
13By default clients and daemons will look for the TCP service called *ceph-mon* which is configured by the *mon_dns_srv_name* configuration directive.
14
31f18b77 15
20effc67 16.. confval:: mon_dns_srv_name
31f18b77 17
7c673cae
FG
18Example
19-------
20When the DNS search domain is set to *example.com* a DNS zone file might contain the following elements.
21
22First, create records for the Monitors, either IPv4 (A) or IPv6 (AAAA).
23
24::
25
26 mon1.example.com. AAAA 2001:db8::100
27 mon2.example.com. AAAA 2001:db8::200
28 mon3.example.com. AAAA 2001:db8::300
29
30::
31
32 mon1.example.com. A 192.168.0.1
33 mon2.example.com. A 192.168.0.2
34 mon3.example.com. A 192.168.0.3
35
36
37With those records now existing we can create the SRV TCP records with the name *ceph-mon* pointing to the three Monitors.
38
39::
40
9f95a23c
TL
41 _ceph-mon._tcp.example.com. 60 IN SRV 10 20 6789 mon1.example.com.
42 _ceph-mon._tcp.example.com. 60 IN SRV 10 30 6789 mon2.example.com.
43 _ceph-mon._tcp.example.com. 60 IN SRV 20 50 6789 mon3.example.com.
7c673cae 44
9f95a23c 45Now all Monitors are running on port *6789*, with priorities 10, 10, 20 and weights 20, 30, 50 respectively.
7c673cae 46
9f95a23c
TL
47Monitor clients choose monitor by referencing the SRV records. If a cluster has multiple Monitor SRV records
48with the same priority value, clients and daemons will load balance the connections to Monitors in proportion
49to the values of the SRV weight fields.
50
51For the above example, this will result in approximate 40% of the clients and daemons connecting to mon1,
5260% of them connecting to mon2. However, if neither of them is reachable, then mon3 will be reconsidered as a fallback.