Reputation: 3874
I am running an Elasticsearch node on my VM. I wrote a simulator on the host that tries to connect to my VM ES node.
The client code connects as follows:
Node node = nodeBuilder().clusterName("AnalyticsCluster")
.client(true).node();
mClient = node.client();
I made sure I configured the right cluster name on the VM node. I do not want to use the other method using a TransportClient to connect to the ES node because according to ES documentation this will cause 2 hops pass through on each search.
It fails as follows:
org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m]
at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:180)
at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:491)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
I suppose I understand the root cause(not 100% though) being that the client and the Node are using a different network for publishing the multicast. I am saying that based on the following:
ES Node Console
[2014-02-26 18:19:13,725][INFO ][transport ] [Baron Samedi] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.79.128:9300]}
Client Node Console
INFO: [Lacuna] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.1.105:9200]}
In other terms the Node publishes on 192.168.79.* network which is the VM network and the client publishes on 192.168.1.* network which is my wifi network.
It seems I could solve this by setting on the client side the network.publish_host. The thing is on the client i don't have an elasticsearch.yml . I also didn't find a way to set it programatically.
I have 2 questions in order of priority:
Can the network.publish_host be set programatically and of so, how?
How can i set an elasticsearch.yml on my client side that the API would use for its settings?
Thx in advance
P.S: the firewall on the VM is stopped.
Upvotes: 0
Views: 1614
Reputation: 3874
I solved the problem by doing 2 things.
A) I added an src/main/resources/elasticsearch.yml on the client side that looks as follows:
network.host: 10.231.150.165
That didn't solve the problem completely. The client was correctly sending the multicast on the server side that sits on the VM. But the VM was not able to connect back to the client
B) I configured the network between the host and the VM to be bridge and not NAT like the default on VMWare. The settings is as follows:
That completely solved the problem since now my host and my VM are on the same LAN.
Upvotes: 1