dgraph-io / dgraph

The high-performance database for modern applications
https://dgraph.io
Other
20.46k stars 1.5k forks source link

[QUESTION]: How to delete a group #9211

Closed kuberxy closed 4 days ago

kuberxy commented 2 weeks ago

1)My cluster looked like this at the beginning image 2)I removed the node in Group3 via curl "http://zero1:6080/removeNode?group=3&id=2". image 3)After that, my cluster can't write data image

rarvikar commented 4 days ago

Hi @kuberxy, are you trying to remove an entire "Group" completely or just specific nodes from an existing group ?

Once you remove an existing Alpha node from a Group, the cluster WILL BE defunct, unless you re-add a new Alpha node to that same group. Unfortunately, as of today, there's no way to remove just a specific group and its nodes from a sharded cluster and continue using the cluster with the rest of the groups working. Also, once sharded, we cannot go back to an "unsharded" setup either, by just removing specific groups and their nodes. The only option available, in both the cases above, is to rebuild the cluster from scratch, by importing using the bulk/live loaders or using Binary Backups if a license is available.

To address the issue you're facing now with a defunct cluster, after running /removeNode last:

  1. Re-add a new node to the same group. The cluster should be able to come back up at this point.
  2. Take a full export of your cluster as RDF to JSON.
  3. Use the bulk-loader to import again by specifying --map_shards 2 and --reduce_shards 2. This would result in 2 separate p dirs created from the bulk-loader after a successful run.
  4. Start a new cluster with 2 Groups as intended, using each of the 2 p dirs obtained above in step (3).
  5. This should result in a new cluster created with only 2 groups instead of the original 3.

Btw, just so you know, we're aware of the limitations involving shards and subsequent reconfiguration and do have plans to address them asap. I'll close this issue out for now but feel free to re-open if you have any other queries.

Best, Rahul

kuberxy commented 3 days ago

@rarvikar Thank you for your Q&A, thank you very much