Somehow the default multicast discovery is not working for me and I am
exploring the unicast discovery mechanism to set up a ES cluster on two
physical machines. I am am able to set up it using the default ES
installation on two machines with configuring the both YML files to point
to each other using UNICAST discovery. Now, I want to achieve the same
thing using the ES Client API and I am using the below code for it. Could
you let me know if below code is correct to point to two nodes in UNICAST
or kindly point me to the right direction to refer the sample client code
for it. I am facing issue in the below code and unicast discovery is also
not working in below code.
(I have around one week experience on ES and want to migrate one of the
product from lucene to ES).
Settings settings1 = ImmutableSettings.settingsBuilder()
// .put("network.publish_host", "18.104.22.168")
// .put("discovery.zen.ping.unicast.hosts", "["22.214.171.124",
node1 = nodeBuilder().settings(settings1).node();
Node clientNode =
Client client = clientNode.client();
BulkRequestBuilder bulkRequest = client.prepareBulk();
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALZAj3L0B-h%2BbE%3D5p2MeMigf7jwSDC1FZhOC%3DnDfqtWsG-9Y0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.