Using docker swarm to create a cardano stake pool

Do you recommend using docker swarm to balance the load of the stake pool nodes?


What type of load you mean?

Hi! The network load. Docker swarm in general as orchrestation tool.

Actually there is not much dynamic traffic load on the nodes… around 15 incoming connections you will get on each relay… and around 20 at most…

I don’t think you want to balance the load.

The identity of a block producer is given by its certificate. Running two instances that share the same certificate is illegal for a number of reasons. You could have some failover setup, which in case of one BP going down delegates all trafic to a failover node. This would need to be bullet proof such that the BPs are guaranteed to run mutually exclusive.

You may want to have a number of relays, that create redundancy in your setup (i.e. not failover). They all would connect to the BP and would work independent of each other. You don’t want to balance the load on them either. Each relay will only need to handle a configurable number of incoming connections (i.e. < 20). With the upcoming P2P manager in Alonzo, there will be a three sage selection for the available connections. If a connection in stage 1 dies, it will be replaced by one from stage 2 and so on. A load balancer would make things worse AFAIU.

What you might want to have (in practice) is reliable alerting and the leader log for each epoch. You want your phone to go pling if either of your Replay or BP does not respond to your liveness probe (that runs every 20sec from various geo locations). The leader log will tell you when it is a good time to do maintenance and when it is especially important that you nodes are running smoothly.

Here is a picture of basic health monitoring (using M/Monit) for two RaspberryPi4 running Docker nodes

For alerting I use GCE

1 Like

Balance the load is not the only motivation to use docker swarm. My principal motivation, is how to handle all these docker containers in different hosts(ip’s) , and also in the same network, in a smooth change from my local environment (where I work with a docker-compose that creates all the services), to this one that I mention from production. I thought of docker-compose because it can solve me some detail that I overlook in the local environment.

I’m reading the link that you share about cardano docker. Thanks a lot! Very helpful!

Why is this? Because my node could be near of been an elected leader?