I get the following error when trying to connect to Elasticsearch 2 using the Java API for ES 2. This is the code:
Settings settings = Settings.settingsBuild
@AndreiStefan gave the solution to my problem thanks to the post he linked. The solution was as straightforward as:
network.bind_host: 0
Thank you guys.