Enabling replica on an existing dgraph cluster

Hi,

What I want to do

I have a dgraph cluster of 3 nodes. Replica factor is set to 1 (no replica). I want to enable replication in the cluster without deleting the data.

What I did

I made a following plan:

  1. Set rebalance_interval parameter to a huge (e.g. 1000h) value to prevent rebalancing of the predicates.
  2. Move all the predicates to one node.
  3. Remove empty nodes using /removeNode endpoint.
  4. Set replicas value to 3 for the zero node and restart empty alphas.

Is this approach correct?

I stuck on the 2. I tried to move predicates one by one using /moveTablet. It worked for small predicates however took a long time. When I tried to move a predicate with the size more than 10gb I received an empty response and the predicate wasn’t moved.
Is there another way of moving all predicates from a node?

Dgraph metadata

dgraph version

Dgraph version : v21.03.0
Dgraph codename : rocket
Dgraph SHA-256 : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1 : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
Branch : HEAD
Go version : go1.16.2
jemalloc enabled : true

I think you don’t need to do all this. You have 3 groups. So, you should add 2 Alphas for each group (9 Alphas in total) and set the replica 3 in the zero group. Dgraph will handle the rest.

nope.

@MichelDiz thanks for your reply!
But I’m interested in reconfiguring the existing nodes without adding addition ones.

  1. Is it possible change count alphas in group when group already have been exist with data on it?

  2. How to configure alphas count in one group when we only creating new cluster? For example i want 6 alphas in group one, 6 alphas in group two, 6 alphas in group three: total 18 alphas in 3 groups

  3. I’m using Kubernetes and hostpath, but before have been tried use Ceph in K8S. Official docs says it’s not recommend. But on every public cloud (Google, AWS) we have the same volumes that is virtual for Kubernetes (Yes it is not Ceph or maybe advanced Ceph but it’s still Virtual)
    So my question why you do not recommend use Distributed storage like Ceph, Longhorn for Dgraph in Kubernetes Cluster? And what Distributed storage Dgraph team are using in Dgraph Cloud?
    It’s impossible that for every client cloud will buy exclusive disc and new server every time when new clients come

You can add more Alphas, but it has to be to all groups and it cannot be an even number. For example, you have replica 3 with 18 Alphas and you want to add more Alphas to the groups. Change replica to 5 and add 12 more Alphas to the cluster. So it will keep 6 groups. Altogether it will be 30/5.

If you just add Alphas without changing the replica value. It will just create more new groups.

You can’t control per group.

To have a cluster 18/3 just set in the Zero --replicas 3.

Me or Dgraph? I don’t know Ceph, I know Longhorn a bit but never used. I don’t have any recommendations for those. If it works for you, fine. But I recommend that you use a storage for each Alpha and unleash those resources for them.

Dunno, but I think they use normal storage. And the distributed logic behind Dgraph does that job.