Question

Port 8500 Is refused

I am trying to install consul using the idealista/consul_role via ansible and I am running into an error:

Timeout when waiting for 127.0.0.1:8500

When I ssh into the server and run:curl localhost:8500 I get: curl: (7) Failed to connect to localhost port 8500: Connection refused

Somehow port 8500 is not allowed. Is it possible that Digital Ocean is blocking this? I looked at my firewall rules and my droplet allows all TCP ports for inbound and outbound (FYI I have other droplets using the same firewall rules and they don’t have the issue)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thanks @baraboom for your help.

I think your original suggestion was correct to start the service and see the errors.I was able to figure out the issue. It was failing because of the invalid config key log_file. I ended up removing “log_file”: “{{ consul_logfile }}”, from consul.json.j2 and it all reinstalled perfectly.

Not sure if it is because I am using 1.2.1.

Yes, in order to connect to port 8500 something has to be listening. This happens after install AND starting the service (maybe ansible doesn’t start it?)

You could try checking syslog or other logs for errors. Maybe try starting the service manually, as it might display the problem right there on the screen.

If ansible experiences an issue it should report an error too as well so double-check that - might be something straightforward.

Hi, firewalls would not normally block localhost connections as it is the node connecting to itself.

Are you sure the service is running and listening on port 8500? To find out, try this command on the console / SSH terminal:

netstat -tnlp

That should list all active TCP listeners as well as the process id (pid) and process name.

If you do not see 8500 in that output then your problem probably lies elsewhere.

Hope this helps and let us know how it is going.