Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you! Failed to connect to localhost/



I have a 3 node Nifi Cluster running with and external Zookeeper with


and<IP of the box>.

The cluster runs fine but suddenly goes down with the below error: Failed to connect to localhost/

On restarting it again starts running fine.

My /etc/hosts file contains: localhost localhost.localdomain localhost4 localhost4.localdomain4

Can someone help?

@Bryan Bende


Master Mentor

@siddharth pande

Your error seems to suggest that the nifi cluster is trying to connect to a local zookeeper. Can you add an entry in your /etc/hosts with the IP and FQDN of your remote zk server and the alias like below? I would suggest you comment out the localhost entry.

This entry should be applied to the all the 3 nifi nodes

#         localhost localhost.localdomain localhost4 localhost4.localdomain4   remote

And then restart your Nifi cluster


@Geoffrey Shelton Okot

In that case why would it work fine for sometime before going down?

Also if I comment out, the nifi server doesn't start at all.

New Contributor

Im facing the same issue on my setup as well. I wanted to point my processes to local hosted server and it throws connection exception all the time whereas, when I point to remote server it works absolutely fine. Error is exactly similar to what you have written above. Did you happen to get any solution? @siddharth pande. If yes, please share that would be of great help 🙂