Cluster setup confusing issues


(Chengxinpeng) #1

Hi, I was trying to set a cluster among five virtual machines. However, I’m little confused on the difference between zero node and alpha node. According to my understanding of the document: https://docs.dgraph.io/deploy/#cluster-setup. Shall I reference the following section:


(Chengxinpeng) #2

Should I also have a zero server on each node(machine) or shall I only have an alpha server on each machine?


(Michel Conrado) #3

if they are separated, yes.
If they are in the same machine with the same context (let’s say containers), no you don’t need.

However, you can put every instances to use only a single Zero.

Quotes from https://docs.dgraph.io/deploy/#multi-host-setup

copy the following file on your host machine and name it as docker-compose.yml

This should run three Dgraph Alpha services (one on each VM because of the constraint we have), one Dgraph Zero service on aws01 and one Dgraph Ratel.


(Linhan Li) #4

Thanks Michel!
I’m building a cluster with three nodes, and trying to make them work together as a whole while rebalancing the data between those three nodes automatically. Also, we hope that the cluster will be fine in dynamic horizontal scaling(adding other machines as new nodes) in the future. Therefore, shall we have a single zero with many alpha instances(machines) (the figure’s left part), or shall we have a zero on each node(the figures right part), to realize the cluster mentioned above? Thanks a lot!


(Linhan Li) #5

Also, for now, can a Dgraph cluster (one zero works with many alphas) support the dynamic rebalancing after horizontal scaling? For example, after I build a cluster with three alphas(not used for HA purpose, but used for parallel processing purpose), I import the 21million rdf into the cluster, so each alpha will store a group of predicates. Then, I add the fourth machine(alpha) for another parallel node (again, not for replication). After that, for rebalancing purpose, will the partial data stored on the original three alphas be transferred to the fourth alpha automatically?


(Michel Conrado) #6

Yes, it will. But it depends on disk usage I guess. I’m not sure about all the rules in rebalancing. But I know that Dgraph checks disks and others params to take action. And it does every 5 minutes.