Elector - leader node election

Hello, I decided to split my larger project into smaller libraries. As a result, I have released the first library written in Erlang called Elector.

Elector is a library that automatically selects the leader node from an Erlang cluster. It reacts automatically when a node joins or leaves the cluster and initiates election. It is possible to configure the code to be executed before and after automatic election using hooks.

By default, Elector uses a voting strategy that selects the node with the highest runtime, but it is possible to override this with a custom strategy.
Elector supports different configuration options.

I am hoping to receive any feedback on what could be improved or any other thoughts.

Github link

Hex documentation

Thanks! :slight_smile:


Does this do any split-brain detection? Didn’t find the keyword “quorum” that I was looking for in the documentation for my use case.

1 Like

Yes it supports configuration option quorum_size which basically defines the minimum amount of nodes in the cluster needed for starting the election process. By default it’s 1 which means no checks. Please keep in mind that the configuration must be same across all nodes.

And thanks for pointing it out I have to update the readme file.
The documentation can be found here The elector application