[erlang-questions] leader election ?
Fri Oct 19 09:25:01 CEST 2018
Fasters and easiest way to run a 3rd party service that would handle election/arbitration. However, that option does not give you any engineering challenge =).
Unfortunately, you said nothing about your environment. I suspect that separate datacenter does not mean AWS availability zones. The biggest challenge to solve is splits. It is not recommended to run Erlang cluster accross data centres therefore majority or Erlang build-in solutions would not help you. Most of Erlang libraries relies on Erlang distribution.
It is a challenge to build a consensus if you have only 2 nodes, it is impossible to make a quorum. Therefore, you need arbiter anyway. Once, I was “lazy” to setup zookeeper for arbitration purposes then my simplest path was in-memory mnesia + simple REST API but it was way long ago before consul.
If you can tolerate last-write-wins that you might do nothing =)
> On 19 Oct 2018, at 7.38, Thomas Elsgaard <thomas.elsgaard@REDACTED> wrote:
> Hi list!
> I am running 2 instances of an application ( seperate datacenters), both receives indentical data on TCP sockets, but only one of the applications should process it further downstream.
> Any suggestions to what is the "simplest" way to have a kind of leader election ? Both applications must be running, but must have knowledge about their own role (active or passive) in order to decide if the data should be processed downstream.
> Should I use an external application like consul or etcd to implement leader election, or is there an better way via OTP or libraries ?
> It just seems a little "heavy" to use consul or etcd to elect an leader between two application instances.
> erlang-questions mailing list
More information about the erlang-questions