[Using ElasticSearch version 2.0]
In etc/hosts file \"esnode\" is mapped to IP address(some other machine where ES is running) as shown
192.168.2.219 esnode
Check if your elasticsearch server have also version 2.0, if no, upgrade. Client and server must have the same version to work, I don't know why but this solved my problem.
Cheers,