MasterNotDiscoveredException when using the Java Node Client API

Hi All:
I am running a long running java App that connects to ES Cluster (currently at 1.5.2) using the Node Client API. It connects and creates the requisite client nodes

these are my settings :

ImmutableSettings settings = Settings.settingsBuilder().putArray("discovery.zen.ping.unicast.hosts",hosts)
                                    .put("cluster.name", getESClusterName())
                                    .put("node.client", true)
                                    .put("node.data", false)
                                    .put("http.enabled",false).build();
        Node node = nodeBuilder().settings(settings).node();
        this.esClient = node.client();

We have to upgrade to a newer version of ES, So I had downloaded ES2.1.1 (thats what is supported within our organization). Updated the ES jars and tried. I got the error that the variable "path.home" was not set. So I updated my Settings to include the path.home setting. However at this point, the app seemingly connects ( no indication either in kopf or the logs that it was successful) only that the one of code returns a node and the client is set. When I try to use the client to see if an index exists in the ES cluster, it failed with :

Exception in thread "main" MasterNotDiscoveredException[waited for [30s]]
	at org.elasticsearch.action.support.master.TransportMasterNodeAction$4.onTimeout(TransportMasterNodeAction.java:154)
	at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:239)
	at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:574)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

From this post: Elasticsearch 2.1.1 on localhost Java client error MasterNotDiscoveredException waited for 30s

I assumed that because of the license plugin on my ES 2.1.1 instance I was unable to get it to work.
So, per https://github.com/elastic/elasticsearch/issues/13445, I tried adding the plugin dependency to my app and include the plugin settings as indicated. However, This continues to raise the same exception.

I have removed he offending license plugin ( and the marvel-agent plugin) to see if the app connects (as others have indicated success with that approach). But this failed as well with the same exception.

Any suggestions as to how this can be fixed.

The reason we are using the Node Client is that our process is a long running process and we went with the recommendation that perhaps a Node Client in these situations is better than using the Transport Client.

Thanks for all the responses

Current Test Configuration :

ES 2.1.1 running in a Single Node on linux
with Java 1.8

Did you set network.host?

No. I will try that out.. (would it be set to localhost/local hosts IP address ?)

Thanks

Ramdev

Hi david:
That was it... I set network.host and it worked.

Thanks much

Ramdev