-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
Updating docker stack crashes cluster #1783
Comments
We don't cache the IP -- we resolve it periodically when we check for changes to the nodes file. You have to do rolling rotation of the nodes with enough time for the cluster to recover because a 3-node raft cluster requires atleast 2 nodes to be up for healthy functioning. Otherwise, you can add the |
Thanks, if |
We don't recommend using that flag if you have high volume of writes. The best way to do rotation is container by container. Some people have mostly static clusters whether they don't mind using this flag for fast recovery. |
Thank you very much! |
Description
We run a 3 node docker swarm cluster with typesense on each node. It's configured as discribed in this guide: https://typesense.org/docs/guide/docker-swarm-high-availability.html
After updating the typesense configurations e.g. adding new labels to the services, I run
docker stack deploy -c docker-stack.yaml my_stack
. Looking inside the typesense container I get the following errors:The nodes file looks like:
typesense-1:8107:8108,typesense-2:8107:8108,typesense-3:8107:8108
It seems that typesense resolves the hostnames and caches the resolved ip addresses. This leeds to a cluster crash after updating the stack as the container may get another IP. I did specify
10.0.2.0/24
as subnet and would expect that typesense will find the new ip addresses. Especially because i specified the hostnames and not an static ip.Steps to reproduce
services
config insidedocker-stack.yaml
e.g. adding labels or add andepends_on
to forcedocker stack deploy
to create a new containerdocker stack deploy -c docker-stack.yaml {stack_name}
docker logs -f {container_id}
Expected Behavior
Cluster will stay alive.
Actual Behavior
Cluster crashes.
Metadata
Typesense Version: 26
OS: Fedora 39 (Docker version 26.1.4, build 5650f9b)
The text was updated successfully, but these errors were encountered: