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:
- Set rebalance_interval parameter to a huge (e.g. 1000h) value to prevent rebalancing of the predicates.
- Move all the predicates to one node.
- Remove empty nodes using /removeNode endpoint.
- 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 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.
@MichelDiz thanks for your reply!
But I’m interested in reconfiguring the existing nodes without adding addition ones.
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
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.