A better way to supervise your clusters and services.
The project is recently hatched and in the stage of active development.
Clusterduck is a robust solution for real-time distributed monitoring and self-healing clustering.
Health checks, real-time and voting-based.
Self-healing clusters. When the number of active nodes in a cluster falls below a given threshold, new nodes will be started automatically on the least loaded server(s) in a split second. Spare pools are supported.
Events and triggers Just about everything is an event that you can hook up your trigger to.
KISS. Hacking up your own plugin is definitely not a rocket science.
clusterduck-redis — Redis health checks and envoy-based balancing
Table Of Contents
Node 15.x is recommended.
npm i -g clusterduck
Alternatively, you can clone the repo and link the dependencies which is useful for development purposes:
git clone email@example.com:kakserpom/clusterduck.git cd clusterduck node link
If you want to enable TLS for Raft, run this to generate certificates:
clusterduck command to see if it all works for you.
If you want to daemonize it, run
If you want to stop a running daemon, run
For debugging purposes use
DEBUG environmental variable:
The default config file path is
Let's define a Redis cluster named
clusters: my_redis_cluster: type: clusterduck-redis
Then let's define some nodes:
# List of nodes nodes: - addr: 127.0.0.1:6379 - addr: 127.0.0.1:6380
Note that you can omit this altogether if you want to only add nodes dynamically.
Now let's set up a simple health check.
health_checks: - type: basic timeout: 1s interval: 10s interval_after_fail: 1s commands: - [ 'SET', 'x', 'y' ]
Now every 10 secs each node in the cluster will get checked on. If the check fails, a retry happens after 1 sec.
Now let's live export the list of active nodes:
triggers: - on: [ active ] do: - type: shell cwd: /tmp commands: - "echo $nodes_active_addrs > active_nodes.json"
This will make sure that
/tmp/nodes_list always contains a current list of alive nodes.
||Set of nodes has changed|
||Node state has changed|
- type: raft address: tls://127.0.0.1:9911 bootstrap: [ tls://127.0.0.1:9910 ]
||Address to listen|
||Path pattern to key/cert files. Default is
||List of node addresses to connect with.|
Clusterduck instances will exchange peers and update
bootstrapaccordingly, but initial address is necessary.
- type: http listen: 8880
||Port to listen|
- Live config updates (i.e. more Commands)
- REST API