Elasticsearch 2.1.1 on localhost Java client error MasterNotDiscoveredException waited for 30s

So on my localmachine, with latest version of elasticsearch, java client node doesn't receive any information regarding masternode. And disconnects.

I have tried the following code even with default configuration. And still it doesn't work.

If I use TransportClient everything works fine.

Anyone knows what's going on?

Here is the link to stackoverflow question, will all the code, logs and version.

You've run into a difficult set of issues, and I'm sorry that you had to experience this pain. There are two problems. The first problem is that your node client can't deserialize the cluster state. The reason for this is because the license plugin that you installed on your master node causes some metadata to be stored in the cluster state; if the node client isn't configured to also load the license plugin then it won't know how to deserialize the cluster state. Unfortunately, this failure is silent and that's bad. See #13445 and the fix is in #15401 but that's not in a released version of Elasticsearch yet.

Okay, so now you're thinking all that you have to do is load the license plugin. Alas, that would have worked with the node builder in the 2.0.x line of Elasticsearch. However, in the 2.1.x line of Elasticsearch, this ability has been removed (see #13055). See #15927 and the links therein for a better understanding of this issue, and ways to work around it.

Thanks for the kind and prompt response. I presume this will be fixed soon.

Meanwhile, I shall use the workaround of removing the license plugin.

Hi Jason:
One of the workarounds was to include the license plugin maven dependency in the dependencies of the java app which uses Java Node Client. However
I am unable to satisfy this dependency. and I am unable to find the maven repo that would contains this :

(for ES 2.1.1)

<dependency>
         <groupId>org.elasticsearch.plugin</groupId>
         <artifactId>license</artifactId>
         <version>2.1.1</version>
</dependency> 

any points whereI can find this ?

Thanks

Ramdev

You should open your own thread.