I am trying to index to a remote elastic host but RestHighLevelClient by default is picking up the "localhost:9200" . is there any where i can configure the RestHighLevelClient to use a remote host instead of localhost? I have researched enough on the internet but i could no find anything that could direct me regarding the remote host. I see "localhost" everywhere.
new RestHighLevelClient( RestClient.builder( new HttpHost("http://example.com")));
Any help would be appreciated.
Elastic Version : 6.2.3
You need to simply replace
http://example.comwith your Elasticsearch hostname, for example if Elasticsearch cluster is running on ip 10.10.10.10 and on port 9200, you can giveAbove value is just a show the example, you need to replace it with your IP which needs to be accessible from the host where you code is running.