See Options Object.
Bootstrap swim instance and join cluster.
- hosts - address:port list to connect to when joining the cluster
- callback(err) - callback function
Join cluster.
- hosts - address:port list to connect to when joining the cluster
- callback(err) - callback function
Leave cluster.
Get host for local node.
Alias to localhost().
Get members in the cluster.
- hasLocal - include local node
- hasFaulty - include nodes marked as faulty
Get membership checksum.
Update metadata of local node and disseminate within cluster.
This object contains configuration settings.
Local Option.
- local.host (required) - address:port for this instance, e.g. 127.0.0.1:11000
- local.meta (optional) - metadata about this node, which will be disseminated within cluster
Codec of message payload. Default: msgpack.
- json - https://www.json.org/
- msgpack - https://msgpack.org/
Dissemination factor can be used to fine tune the responsiveness of the cluster. Greater dissemination factor results to:
- more hosts being notified in every round of dissemination
- lower convergence time of cluster membership
- more/bigger network packets being sent
and vice versa.
Number of milliseconds between failure detections, also known as the protocol interval. Every X milliseconds, nodes will ping a member of the SWIM network to check its liveness with Time-Bounded Strong Completeness as described in the paper.
Number of milliseconds before emitting a JoinTimeout error. The node will still run as a base node separate from the network.
Number of milliseconds before sending ping-req messages to the unresponsive node.
Number of milliseconds elapsed from sending ping-req message before marking the unresponsive node suspicious.
Number of hosts to send ping-req messages to for pinging unresponsive nodes indirectly to reduce false positives.
Number of milliseconds before considering a suspect node faulty.
UDP Option.
- udp.maxDgramSize - Max size of UDP datagram. If bigger than what the network supports, messages might be chunked into multiple packets and discarded at receiver end.
If set to true, current metadata of local node, instead of the copy of metadata of local node in cluster membership, will be used during conflict resolution. Defaut: false.