]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | =============================== |
2 | Looking op Monitors through DNS | |
3 | =============================== | |
4 | ||
5 | Since version 11.0.0 RADOS supports looking up Monitors through DNS. | |
6 | ||
7 | This way daemons and clients do not require a *mon host* configuration directive in their ceph.conf configuration file. | |
8 | ||
9 | Using DNS SRV TCP records clients are able to look up the monitors. | |
10 | ||
11 | This 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 | ||
13 | By 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 FG |
15 | |
16 | ``mon dns srv name`` | |
17 | ||
18 | :Description: the service name used querying the DNS for the monitor hosts/addresses | |
19 | :Type: String | |
20 | :Default: ``ceph-mon`` | |
21 | ||
7c673cae FG |
22 | Example |
23 | ------- | |
24 | When the DNS search domain is set to *example.com* a DNS zone file might contain the following elements. | |
25 | ||
26 | First, create records for the Monitors, either IPv4 (A) or IPv6 (AAAA). | |
27 | ||
28 | :: | |
29 | ||
30 | mon1.example.com. AAAA 2001:db8::100 | |
31 | mon2.example.com. AAAA 2001:db8::200 | |
32 | mon3.example.com. AAAA 2001:db8::300 | |
33 | ||
34 | :: | |
35 | ||
36 | mon1.example.com. A 192.168.0.1 | |
37 | mon2.example.com. A 192.168.0.2 | |
38 | mon3.example.com. A 192.168.0.3 | |
39 | ||
40 | ||
41 | With those records now existing we can create the SRV TCP records with the name *ceph-mon* pointing to the three Monitors. | |
42 | ||
43 | :: | |
44 | ||
45 | _ceph-mon._tcp.example.com. 60 IN SRV 10 60 6789 mon1.example.com. | |
46 | _ceph-mon._tcp.example.com. 60 IN SRV 10 60 6789 mon2.example.com. | |
47 | _ceph-mon._tcp.example.com. 60 IN SRV 10 60 6789 mon3.example.com. | |
48 | ||
224ce89b | 49 | In this case the Monitors are running on port *6789*, and their priority and weight are all *10* and *60* respectively. |
7c673cae | 50 | |
224ce89b | 51 | The current implementation in clients and daemons will *only* respect the priority set in SRV records, and they will only connect to the monitors with lowest-numbered priority. The targets with the same priority will be selected at random. |