Java Client: failing to connect remotely


(Mark Kuryan) #1

I have a working Python script using Python ES plugin which connects to ES index located on the remote server, connection part of it looks like this:

es = Elasticsearch([{
  'host':'api.exiletools.com',
  'port':80,
  'http_auth':'apikey:DEVELOPMENT-Indexer'
}])

Connection specifications are listed [here][1]

However, I am failing to implement this in Java.

So far I tried:

client = new TransportClient()
                    .addTransportAddress(new InetSocketTransportAddress("apikey:DEVELOPMENT-Indexer@api.exiletools.com/index", 9300));

other URLs I tried:
api.exiletools.com
api.exiletools.com/index/_search

and with port 80

all result in java.nio.channels.UnresolvedAddressException
[1]: http://api.exiletools.com/info/indexer.html


(eliasah) #2

The error you have received is raised when an attempt is made to invoke a network operation upon an unresolved socket address. Which means that the address you are giving is not correct.

Is the following address your cluster address?


(Mark Kuryan) #3

Well the question can be closed - I just learned that the owner of the service only allows connections through http, which he secured, because otherwise he can't control who is connected, and Java client doesn't have an option connecting through http and uses a different protocol, so it cannot be used...


(eliasah) #4

Well, if you don't have access, no matter what the options the Java provides, you'll not be able to access.


(system) #5