Restarting Dgraph server installed as systemctl service gives error

What I want to do

I have installed Dgraph as a systemctl service for which i have used the following setup :

What I did

I have enabled chkconfig ON for this service as well so that if server restarts, this service should also restart . The service is not restarting and giving the following error :

Error Logs :

> *worker.Config: {PostingDir:/$$/dgraph/p BadgerTables:mmap BadgerVlog:mmap BadgerKeyFile: WALDIR:/$$/dgraph/w  MutationMode:0}*
> *mkdir /**/dgraph: permission denied*
> *Error while creating WAL dir*

My Queries :

  1. Is this simply permission issue which i can handle ?
  2. On restart, why does dgraph need to create the directories again if they are already there , this comes at the risk of losing the current data ?

Dgraph metadata

dgraph version : 20.03.0

I believe this is a user issue. You’re running Dgraph as a different user from your current logged in user right?

sudo groupadd --system dgraph
sudo useradd --system -d /var/run/dgraph -s /bin/false -g dgraph dgraph

^ you ran this?


Yes it worked . Apparantly people who were restarting the server were doing it with a different user . I have given permission 777 for now . The only thing is my data is gone and I need to restore from backup .

How did you backup your data?