I have setup a SSH tunnel on port 9300 to my remote elasticsearch server.
When running this basic example to get the example data from the elasticsearch instance I get a " org.elasticsearch.client.transport.NoNodeAvailableException: No node available "
Settings settings = ImmutableSettings.settingsBuilder()
.build();
Client client = new TransportClient(settings).addTransportAddress(
new InetSocketTransportAddress(InetAddress.getLocalHost().getHostName(), 9300));
GetResponse getResponse = client.prepareGet("bank", "account", "25").execute().actionGet();
my setup is that i connect from my localhost to a remote machine where elasticsearch is running in a docker-container and i got the same problem on port 9300 using transportclient with netty4. connecting to the tunneled port 9200 was no problem
transport.publish_host: localhost
has fixed it
so my es.yml has now:
http.host: 0.0.0.0
transport.host: 172.18.0.33
transport.publish_host: localhost
and i do the tunnel via:
ssh -N -L 9300:172.18.0.33:9300 user@server.com
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.