I’m trying to restore a data following the bulk loader instructions on the kubernetes config dgraph-ha
But nothing i’ve done works. It manages to recreate the schema but there aren’t any nodes to be found. When i created the rdf export my database had about 80k nodes.
The steps i took to restore the database:
Generate bulk loader output:
a. Copy the *.gz files to the zero leader pod:
kubectl cp g01.schema.gz dgraph-zero-2:/dgraph
kubectl cp g01.rdf.gz dgraph-zero-2:/dgraph
b. Ssh into the zero leader pod:
kubectl exec -it dgraph-zero-2 -- /bin/bash
c. I run the command below
dgraph bulk -f g01.rdf.gz -s g01.schema.gz --map_shards=2 --reduce_shards=1 --http localhost:8000 --zero=localhost:5080
After running the above command a folder “out” would be created
I then copy the out directory to my local computer
To restore the database i create a fresh new kubernetes cluster with initcontainers sections uncommented
kubectl apply -f config.yaml
On running
kubectl get pods
i find all the alpha pods are in status Init:0/1
then i copy the ./0/p directory from the bulk loader output
to each of the pods:
kubectl cp ./0/p dgraph-alpha-0:/dgraph/ -c init-alpha
kubectl cp ./0/p dgraph-alpha-1:/dgraph/ -c init-alpha
kubectl cp ./0/p dgraph-alpha-2:/dgraph/ -c init-alpha
and i finalize by creating a doneinit file in each of the pods:
kubectl exec dgraph-alpha-0 -c init-alpha touch /dgraph/doneinit
kubectl exec dgraph-alpha-1 -c init-alpha touch /dgraph/doneinit
kubectl exec dgraph-alpha-2 -c init-alpha touch /dgraph/doneinit