Set up dgraph cluster manually

Hy Dgraph community,

We want to set up a cluster manually. We have 6 centOS machines and want 3 zero with 6 alpha.

We have following questions:

How can we add replicas?
How can we add peers?
How can we connect alpha and zero

For now we have following configurations according to this post

Configuration for zero:

cat <<EOF | sudo tee /etc/systemd/system/dgraph.service
[Unit] data server dgraph-zero.service

ExecStart=/usr/local/bin/dgraph alpha --lru_mb 2048 -p /var/run/dgraph/p -w /var/run/dgraph/w


Configuration for alpha

[Unit] zero server

ExecStart=/usr/local/bin/dgraph zero --wal /var/run/dgraph/zw


Unfortunately we got this error main process exited, code=exited, status=2/INVALIDARGUMENT

Thank you in advance :slight_smile:

Hey all,

Me again, we got the cluster running by using following configs:


ExecStart=/usr/local/bin/dgraph zero -o 2 --my=this-vm-ip:5080 --peer zero-leader-ip:5080  --idx 3  --wal /var/run/dgraph/zw


ExecStart=/usr/local/bin/dgraph alpha --my=this-vm-ip:7080 --lru_mb=2048 --zero=zero-leader-ip:5080 -o 2  -p /var/run/dgraph/p -w /var/run/dgraph/w

All Alpha are connecting fine to each other but unfortunately we are getting Read index context timed out in Zero.

Each Dgraph instance needs a configuration in accordance with parameters like -o flag. As you add -0 2 you need to put all ports +2 offset. eg:

dgraph zero -o 2 --my=this-vm-ip:5082 --peer zero-leader-ip:508?  --idx 3 
dgraph alpha --my=this-vm-ip:7082 --lru_mb=2048 --zero=zero-leader-ip:508? -o 2

BTW, you can’t choose who the leader is. This is decided via algorithm.

1 Like

Thank you very much for your answer, what do you mean with zero-leader-ip:508? , what should we put on the ?

508 “?” means the offset of any Zero instance. Or in the case of Zero peer, should be the first instance.

1 Like

One more question @MichelDiz … How should the graph.service look like if we want just to set up alpha on a node without the zero?

we have this error

May 02 04:48:02 vm-2 dgraph[7792]: W0502 04:48:02.210807    7792 pool.go:212] Connection lost with vm-2:7084. Error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp vm-2:7084: connect: connection refused"

Thanks in advance :slight_smile:

Do you mean a HA config? in fact you need zero, zero is like a “balancer” for data and also a uid provider. It manages the cluster itself. There’s no way to Dgraph work without them.

1 Like

I keep on getting the error when setting up alpha nodes
Error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure,…ection refused
And ratel doesnt work with schema alteration
Refer - Problem is setting up multinode cluster

Can you help me in knowing what i am doing wrong here.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.