Hello, I have a centos machine where I can run elasticsearch as a service (via systemctl). My elasticsearch.yml states that network.host, transport.host, http.host all be 0.0.0.0. However, when I try to run basic code using the Java JDK connecting to 9300 (via transport client), it fails with the error message below. However, if I run elasticsearch-6.4.2/bin/elasticsearch with the same elasticsearch.yml file, my code can connect just fine. I can also telnet localhost 9300 in both instances. sudo netstat -lp -n gives the following output:
tcp 0 0 0.0.0.0:9200 0.0.0.0:* LISTEN 396429/java
tcp 0 0 0.0.0.0:9300 0.0.0.0:* LISTEN 396429/java
I am connecting from Scala code using the java jdk as in:
private val esclient:TransportClient = new PreBuiltTransportClient(Settings.EMPTY).
addTransportAddress(new TransportAddress(InetAddress.getByName(host),port)) where host="localhost" and port=9300
What gives? This is driving me crazy!
[error] (run-main-0) NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{ZcfR_a69ROSL2mkumjJUAQ}{10.250.124.183}{127.0.0.1:9300}]]
[error] NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{ZcfR_a69ROSL2mkumjJUAQ}{10.250.124.183}{127.0.0.1:9300}]]