libcluster strategy that discovers peers by polling the local
LOLIPOP Zero Trust Link (ZTL) daemon via
ztlctl status.
ZTL's controller has no public device-listing API, but every node's ztld
daemon already knows the full netmap, so peers are read from the daemon
itself. Without --all the CLI lists online peers only, which is exactly
the set worth connecting to.
Usage
Run ztld in TUN mode (userspace mode has no TUN device, so the BEAM
cannot bind its distribution listener to the mesh address). Start every
node with a longname built from its ZTL IPv4 (e.g. myapp@100.64.0.7),
then configure:
config :libcluster,
topologies: [
ztl: [
strategy: Cluster.Strategy.LolipopZTL,
config: [
node_basename: "myapp",
hostnames: ["myapp-"],
# socket: "/opt/data/ztl/run/ztld.sock",
# polling_interval: 5_000
]
]
]Options
node_basename(required) — node name part before@, shared by all nodeshostnames(required) — list of mesh hostname prefixes that identify cluster members; peers not matching any prefix are ignoredcli— path to theztlctlbinary (default"ztlctl")socket—ztldsocket path passed toztlctl --socket; when omitted,ztlctlselects the daemon socketpolling_interval— poll interval in milliseconds (default5_000)cmd_timeout— CLI timeout in milliseconds (default10_000; polls never overlap regardless, as the next poll is scheduled after the current one)runner—LibclusterMesh.Runnerimplementation (default runs the CLI)