dkron icon indicating copy to clipboard operation
dkron copied to clipboard

no leader after restart service in single node mode

Open eriklee1895 opened this issue 1 year ago • 0 comments

Describe the bug I deploy dkron as single node mode, using docker-compose. I used my local dir as data-dir After docker-compose up -d, and docker-compose down, and then docker-compose up -d, I met the no leader problem. How can I recover? And how to close cluster check absolutely? I thing the problem is that when the docker image restart, the IP is changed.

To Reproduce Steps to reproduce the behavior:

  1. my docker-compose.yml
services:
  dkron:
    image: dkron/dkron
    ports:
      - "9500:8080"
    command: agent --server --bootstrap-expect=1 --data-dir=/dkron.data
    volumes:
      - ./dkron.data:/dkron.data
  1. start and restart the docker img
docker-compose up -d
docker-compose down
docker-compose up -d
  1. The dkron is in no leade state image

I think the problem is I volumed data-dir to a local dir. So the last running Ip was saved to the raft snapshot. When I restart the docker image, the container IP is changed. So dkron start from raft snapshot was failed.

Expected behavior I hope to simply running in single mode, and using docker-compose to start the service, and save the job info to local storage to prevent data lost. But I don't want to be troubled by the cluster problem. So how can I config the args?

eriklee1895 avatar May 21 '24 07:05 eriklee1895