Dgraph in docker unable to reload data on restart

Hello, I’m using docker-compose for dgraph with persistent volume mounts. When data are inserted and the docker containers stopped and restarted, the data is still in the mounted volume, but dgraph doesn’t reload data nor schema. What may be the issue here? Will this happen when I restart running cluster on production too?

Pls, share your yml so I can take a look.

version: "3.2"
services:
  zero:
    image: dgraph/dgraph:latest
    volumes:
      - /dgraph/data:/dgraph
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --my=zero:5080
  alpha:
    image: dgraph/dgraph:latest
    volumes:
      - /tmp/data:/dgraph
    ports:
      - 8080:8080
      - 9080:9080
    restart: on-failure
    command: dgraph alpha --my=alpha:7080 --lru_mb=2048 --zero=zero:5080
  ratel:
    image: dgraph/dgraph:latest
    ports:
      - 8000:8000
    command: dgraph-ratel

Why this path? tmp isn’t a recommended path.

For some reason when both zero and alpha had mounted the same directory, dgraph wouldn’t work properly. So I left path for alpha from original compose file

I never saw that happening. Zero (zw) and Alpha (p,w) uses different folders. Only an error would happen if multiple instances were the same. Overwriting files.

Don’t use TMP paths, even if you see around our examples. Most of it are just examples that you should be aware that it is not to be used on production or something.

Continuing your case,

Fix the YML, try to restart. Make sure the paths are cleaned before restarting.

If it keeps happening, please share the logs.

Cheers.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.