High availbility example with docker-compose


(James) #1

hi,

following up from:

are there examples of setting this up with docker-compose ?
what is the recommended number of alpha nodes, and could we setup more than 1 zero nodes to connect to each other?


(Michel Conrado (Support Engineer)) #2

Please read https://docs.dgraph.io/faq#dgraph-is-not-highly-available

I don’t think so.

An odd number. But the size it depends in the demand. To know this one would have to evaluate its use.

To achieve consensus, its important that the size of quorum be an odd number.

https://docs.dgraph.io/deploy#understanding-dgraph-cluster

Zero is about the cluster. It’s not about themselves. But they will connect to each other. You can have as many you want.
https://docs.dgraph.io/deploy#more-about-dgraph-zero

u007James: is there a way to setup in a way that it only requires 1 / X number of node online?

Well Alphas depends on Zero be up, I think you could try this for Docker https://docs.docker.com/compose/compose-file/#depends_on


(James) #3

how do i setup zero to connect to each other?


(Michel Conrado (Support Engineer)) #4

There’s no need to. All of your Alphas can run with just one Zero instance.
But what differentiate Zeros is “–idx” port index. And you connect all the others
Zeros to the “Main Zero” with “–peer”. But this is in cases like doing a HA Cluster
for example. Not your case I guess.

Check https://docs.dgraph.io/deploy/#understanding-dgraph-cluster

All you need to know about Zero is in https://docs.dgraph.io/deploy#more-about-dgraph-zero

Cheers.