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

fabio route not removed after consul deregister #22

Closed
strarsis opened this issue Dec 7, 2015 · 9 comments
Closed

fabio route not removed after consul deregister #22

strarsis opened this issue Dec 7, 2015 · 9 comments
Milestone

Comments

@strarsis
Copy link

strarsis commented Dec 7, 2015

When running the demo server, it registers itself in consul, being listed by consul as healthy.

$ curl http://localhost:8500/v1/catalog/services

{"consul":[],"consul-server-8500":[],"fabio":[],"fabio-9998":[],"fabio-9999":[],"svc-a":["urlprefix-domain.com/foo"]}

$ curl http://localhost:8500/v1/catalog/service/svc-a

[{"Node":"74bd1b630c8d","Address":"172.17.0.2","ServiceID":"svc-a-172.17.0.1:5000","ServiceName":"svc-a","ServiceTags":["urlprefix-domain.com/foo"],"ServiceAddress":"172.17.0.1","ServicePort":5000}]

Fabio also correctly adds the route to routing table, also listed in fabio web gui.

1   svc-a   domain.com  /foo    http://172.17.0.1:5000/ 100%

When the demo server is shut down (Ctrl+c), it reports that it deregistered itself in consul:

2015/12/07 18:35:16 Deregistered service "svc-a" in consul

And indeed, consul doesn't list the demo server anymore:

$ curl http://localhost:8500/v1/catalog/services

{"consul":[],"consul-server-8500":[],"fabio":[],"fabio-9998":[],"fabio-9999":[]}

$ curl http://localhost:8500/v1/catalog/service/svc-a

[]

However, in fabio web gui, the route is still listed:

1   svc-a   domain.com  /foo    http://172.17.0.1:5000/ 100%
@strarsis strarsis changed the title fabio route not removed after consul unregister fabio route not removed after consul deregister Dec 7, 2015
@magiconair
Copy link
Contributor

Can you please post the fabio log? It should note the change in the health and service status and print the generated routing table.

@magiconair
Copy link
Contributor

Also, since you're using docker could you describe how you are running the individual applications right now? What is running where and can they all talk to each other on the addresses and ports you've configured ...

@strarsis
Copy link
Author

strarsis commented Dec 7, 2015

@magiconair
Copy link
Contributor

@strarsis The logs are more helpful at this point

@strarsis
Copy link
Author

strarsis commented Dec 7, 2015

Log file attached: log.txt

@magiconair
Copy link
Contributor

I think the confusion comes from the registrator. You don't need the registrator for registering either fabio or the demo service. They are both capable of registering themself. Try removing the registrator from your setup and just run the binaries. That should work.

@strarsis
Copy link
Author

strarsis commented Dec 7, 2015

Thank you for your answer.
I removed the registrator service (and also ensured that it has been really stopped + removed),
but the route still persists in the fabio routing table.

consulfabioexample_consulx1_1   /bin/consul agent -server  ...   Up      8300/tcp, 8301/tcp, 8301/udp, 8302/tcp, 8302/udp, 8400/tcp, 0.0.0.0:8500->8500/tcp, 8600/tcp, 8600/udp
consulfabioexample_fabio_1      /fabio -cfg /etc/fabio/fab ...   Up      0.0.0.0:9998->9998/tcp, 0.0.0.0:9999->9999/tcp

I updated the example repo so it can be directly tested.
https://github.com/strarsis/consul-fabio-example/blob/master/docker-compose.yml

@magiconair
Copy link
Contributor

I think this a duplicate of issue #23. fabio does not flush the last route. I'll release a 1.0.7 to fix this properly.

@magiconair magiconair modified the milestones: 1.0.7, 1.0.8 Dec 11, 2015
@magiconair magiconair added the bug label Dec 13, 2015
@strarsis
Copy link
Author

I updated the docker-compose and can confirm that it works now.

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

No branches or pull requests

2 participants