Skip to content

Commit d36d83e

Browse files
authored
Update documentation for node discovery process
Clarify node joining conditions and requirements.
1 parent f6c0f58 commit d36d83e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/dns_cluster.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ defmodule DNSCluster do
22
@moduledoc """
33
Simple DNS based cluster discovery.
44
5-
A DNS query is made every `:interval` milliseconds to discover new ips.
6-
75
## Default node discovery
8-
Nodes will only be joined if their node basename matches the basename of the current node.
6+
7+
By default, nodes will only be joined if their node basename matches the basename of the current node.
98
For example, if `node()` is `myapp-123@fdaa:1:36c9:a7b:198:c4b1:73c6:1`, it will try to connect
109
to every IP from the DNS query with `Node.connect/1`. But this will only work if the remote node
1110
has the same basename, like `myapp-123@fdaa:1:36c9:a7b:198:c4b1:73c6:2`. If the remote node's
1211
basename is different, the nodes will not connect.
1312
14-
## Specifying remote basenames
1513
If you want to connect to nodes with different basenames, use a tuple with the basename and query.
1614
For example, to connect to a node named `remote`, use `{"remote", "remote-app.internal"}`.
1715
1816
## Multiple queries
17+
1918
Sometimes you might want to cluster apps with different domain names. Just pass a list of queries
2019
for this. For instance: `["app-one.internal", "app-two.internal", {"other-basename", "other.internal"}]`.
21-
Remember, all nodes need to share the same secret cookie to connect successfully.
20+
Remember, all nodes need to share the same secret cookie to connect successfully, and their FQDN
21+
must be their IP address (either IPv4 or IPv6).
2222
2323
## Examples
2424

0 commit comments

Comments
 (0)