Scale up/down alpha nodes in a kubernetes environment

Dgraph version: v20.11.3

I have a 3 alphas / 3 zeros cluster in a kubernetes environment. I want to repeatedly scale up/down the number of alpha nodes to test different load. All alpha nodes should be in the same group.

I have done the following to scale up:

  • set “–replicas 5” in zero
  • set “replicas: 5” in alpha
    This created id 4 & 5 in Group 1. Everything worked perfectly.

Then I scaled down alpha back to 3, and removed the id 4 & 5 using http://zero-ip:6080/removeNode?id=4&group=1 http://zero-ip:6080/removeNode?id=5&group=1

When I tried to scale up again by setting “replicas: 5” in alpha, I got the following error.
rpc error: code = Unknown desc = REUSE_RAFTID: Duplicate Raft ID 4 to removed member: id:4 group_id:1 addr:“dgraph-alpha-3.dgraph-alpha.dgraph.svc.cluster.local:7080”

Can someone help me how this can be done?

1 Like

Hey @jso,

Have you seen this: https://dgraph.io/docs/v21.03/deploy/kubernetes/#removing-a-dgraph-pod ? Specifically the section that reads: “When a Zero pod restarts, it must join the existing group with an unused index ID”.