Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no leader after restart service in single node mode #1529

Closed
eriklee1895 opened this issue May 21, 2024 · 1 comment
Closed

no leader after restart service in single node mode #1529

eriklee1895 opened this issue May 21, 2024 · 1 comment

Comments

@eriklee1895
Copy link

eriklee1895 commented May 21, 2024

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?

@OutboundSpade
Copy link

I was able to fix this by setting the --node-name parameter for the agent to the name of the container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants