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
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 🙂