# Failed to start the client

**URL:** <https://discuss.elastic.co/t/failed-to-start-the-client/11803>\
**Category:** Elasticsearch\
**Created:** [May 3, 2013, 6:26pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803 "2013-05-03T18:26:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod\_eligeti](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vinod\_eligeti](https://discuss.elastic.co/u/vinod_eligeti)\
**Post date:** [May 3, 2013, 6:26pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/1 "2013-05-03T18:26:57Z")

</div>

Let me explain the configuration.

I have setup cluster, name is elasticSearch, of 2 nodes in our data center  
where i forward the logs into these 2 nodes.

I have written a small java client program to access this cluster and is as  
follows:

```
    TransportClient transportClient = new 

```

TransportClient(ImmutableSettings  
.settingsBuilder().put("cluster.name",  
"elasticsearch").build());  
Client client = transportClient.addTransportAddress(  
new InetSocketTransportAddress(InetAddress.getByAddress(new  
byte[] { ), 9300))  
.addTransportAddress(  
new  
InetSocketTransportAddress(InetAddress.getByAddress(new byte[]  
{}), 9300));  
ClusterState clusterState =  
client.admin().cluster().prepareState().execute().actionGet().getState();

node-1-ip,node-2-ip are the nodes address.

To access these machines i have to be VPN. Once I VPN and ran my program  
from my laptop it works. However, when i change the code to

```
    NodeBuilder nb = new NodeBuilder().clusterName("elasticsearch");
    nb.settings().put("node.data", false);
    Node node = nb.client(true).node();
    node.start();

    Client client = node.client();
    ClusterState clusterState = 

```

client.admin().cluster().prepareState().execute().actionGet().getState();

I get the following exception:

Exception in thread "main"  
org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
at  
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)  
at  
org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:356)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)

What am I doing wrong? Why TransportClient is working fine however, when i  
create in memory node client it does not ?

thanks

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 3, 2013, 7:18pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/2 "2013-05-03T19:18:54Z")

</div>

Probably your cluster does not accept multicast. Firewall???  
You can also use unicast with nodes.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 mai 2013 à 20:26, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :

Let me explain the configuration.

I have setup cluster, name is elasticSearch, of 2 nodes in our data center where i forward the logs into these 2 nodes.

I have written a small java client program to access this cluster and is as follows:

```
    TransportClient transportClient = new TransportClient(ImmutableSettings
            .settingsBuilder().put("cluster.name", "elasticsearch").build());
    Client client = transportClient.addTransportAddress(
            new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] { <node-1-ip>), 9300))
            .addTransportAddress(
                    new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] {<node-2-ip>}), 9300));
    ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();

```

node-1-ip,node-2-ip are the nodes address.

To access these machines i have to be VPN. Once I VPN and ran my program from my laptop it works. However, when i change the code to

```
    NodeBuilder nb = new NodeBuilder().clusterName("elasticsearch");
    nb.settings().put("node.data", false);
    Node node = nb.client(true).node();
    node.start();

    Client client = node.client();
    ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();

```

I get the following exception:

Exception in thread "main" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)  
at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:356)  
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:680)

What am I doing wrong? Why TransportClient is working fine however, when i create in memory node client it does not ?

## thanks

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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![vinod\_eligeti](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vinod\_eligeti](https://discuss.elastic.co/u/vinod_eligeti)\
**Post date:** [May 3, 2013, 8:34pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/3 "2013-05-03T20:34:33Z")

</div>

If it is a firewall issue how come TransportClient able to talk to cluster?

Also David, You mentioned about unicast with nodes, how do I do that?

On Fri, May 3, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Probably your cluster does not accept multicast. Firewall???  
> You can also use unicast with nodes.
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 3 mai 2013 à 20:26, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :
> 
> Let me explain the configuration.
> 
> I have setup cluster, name is elasticSearch, of 2 nodes in our data center  
> where i forward the logs into these 2 nodes.
> 
> I have written a small java client program to access this cluster and is  
> as follows:
> 
> ```
> TransportClient transportClient = new
> 
> ```
> 
> TransportClient(ImmutableSettings  
> .settingsBuilder().put("cluster.name",  
> "elasticsearch").build());  
> Client client = transportClient.addTransportAddress(  
> new  
> InetSocketTransportAddress(InetAddress.getByAddress(new byte {  
> ), 9300))  
> .addTransportAddress(  
> new  
> InetSocketTransportAddress(InetAddress.getByAddress(new byte  
> {}), 9300));  
> ClusterState clusterState =  
> client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> node-1-ip,node-2-ip are the nodes address.
> 
> To access these machines i have to be VPN. Once I VPN and ran my program  
> from my laptop it works. However, when i change the code to
> 
> ```
> NodeBuilder nb = new NodeBuilder().clusterName("elasticsearch");
> nb.settings().put("node.data", false);
> Node node = nb.client(true).node();
> node.start();
> 
> Client client = node.client();
> ClusterState clusterState =
> 
> ```
> 
> client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> I get the following exception:
> 
> Exception in thread "main"  
> org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
> at  
> org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)  
> at  
> org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:356)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)
> 
> What am I doing wrong? Why TransportClient is working fine however, when i  
> create in memory node client it does not ?
> 
> thanks
> 
> --  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/xiz\_QrSc8no/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xiz_QrSc8no/unsubscribe?hl=en-US)  
> .  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 3, 2013, 11:50pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/4 "2013-05-03T23:50:11Z")

</div>

I meant firewall issue for multicast: [Multicast - Wikipedia](http://en.wikipedia.org/wiki/Multicast)  
It's using UDP with:  
group The group address to use. Defaults to 224.2.2.4.  
port The port to use. Defaults to 54328.  
See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/discovery/zen/)

So even if Unicast is working, discovery could not work.

My 2 cents.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 mai 2013 à 22:34, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :

If it is a firewall issue how come TransportClient able to talk to cluster?

Also David, You mentioned about unicast with nodes, how do I do that?

On Fri, May 3, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Probably your cluster does not accept multicast. Firewall???  
> You can also use unicast with nodes.
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 3 mai 2013 à 20:26, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :
> 
> Let me explain the configuration.
> 
> I have setup cluster, name is elasticSearch, of 2 nodes in our data center where i forward the logs into these 2 nodes.
> 
> I have written a small java client program to access this cluster and is as follows:
> 
> ```
> TransportClient transportClient = new TransportClient(ImmutableSettings
> .settingsBuilder().put("cluster.name", "elasticsearch").build());
> Client client = transportClient.addTransportAddress(
> new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] { <node-1-ip>), 9300))
> .addTransportAddress(
> new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] {<node-2-ip>}), 9300));
> ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> ```
> 
> node-1-ip,node-2-ip are the nodes address.
> 
> To access these machines i have to be VPN. Once I VPN and ran my program from my laptop it works. However, when i change the code to
> 
> ```
> NodeBuilder nb = new NodeBuilder().clusterName("elasticsearch");
> nb.settings().put("node.data", false);
> Node node = nb.client(true).node();
> node.start();
> 
> Client client = node.client();
> ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> ```
> 
> I get the following exception:
> 
> Exception in thread "main" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
> at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)  
> at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:356)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)
> 
> What am I doing wrong? Why TransportClient is working fine however, when i create in memory node client it does not ?
> 
> ## thanks
> 
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/xiz\_QrSc8no/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xiz_QrSc8no/unsubscribe?hl=en-US).  
> To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 3, 2013, 11:54pm UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/5 "2013-05-03T23:54:23Z")

</div>

Forget to answer to last question.  
See elasticsearch.yml file:  
[https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L319](https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L319)  
[https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L324](https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml#L324)

So set:  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["node-1-ip:9300", "node-2-ip:9300"]

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 mai 2013 à 01:50, David Pilato [david@pilato.fr](mailto:david@pilato.fr) a écrit :

I meant firewall issue for multicast: [Multicast - Wikipedia](http://en.wikipedia.org/wiki/Multicast)  
It's using UDP with:  
group The group address to use. Defaults to 224.2.2.4.  
port The port to use. Defaults to 54328.  
See [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/discovery/zen/)

So even if Unicast is working, discovery could not work.

My 2 cents.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 mai 2013 à 22:34, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :

If it is a firewall issue how come TransportClient able to talk to cluster?

Also David, You mentioned about unicast with nodes, how do I do that?

On Fri, May 3, 2013 at 12:18 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Probably your cluster does not accept multicast. Firewall???  
> You can also use unicast with nodes.
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 3 mai 2013 à 20:26, vinod eligeti [veligeti999@gmail.com](mailto:veligeti999@gmail.com) a écrit :
> 
> Let me explain the configuration.
> 
> I have setup cluster, name is elasticSearch, of 2 nodes in our data center where i forward the logs into these 2 nodes.
> 
> I have written a small java client program to access this cluster and is as follows:
> 
> ```
> TransportClient transportClient = new TransportClient(ImmutableSettings
> .settingsBuilder().put("cluster.name", "elasticsearch").build());
> Client client = transportClient.addTransportAddress(
> new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] { <node-1-ip>), 9300))
> .addTransportAddress(
> new InetSocketTransportAddress(InetAddress.getByAddress(new byte[] {<node-2-ip>}), 9300));
> ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> ```
> 
> node-1-ip,node-2-ip are the nodes address.
> 
> To access these machines i have to be VPN. Once I VPN and ran my program from my laptop it works. However, when i change the code to
> 
> ```
> NodeBuilder nb = new NodeBuilder().clusterName("elasticsearch");
> nb.settings().put("node.data", false);
> Node node = nb.client(true).node();
> node.start();
> 
> Client client = node.client();
> ClusterState clusterState = client.admin().cluster().prepareState().execute().actionGet().getState();
> 
> ```
> 
> I get the following exception:
> 
> Exception in thread "main" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]  
> at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)  
> at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:356)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:680)
> 
> What am I doing wrong? Why TransportClient is working fine however, when i create in memory node client it does not ?
> 
> ## thanks
> 
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/xiz\_QrSc8no/unsubscribe?hl=en-US](https://groups.google.com/d/topic/elasticsearch/xiz_QrSc8no/unsubscribe?hl=en-US).  
> To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:38am UTC](https://discuss.elastic.co/t/failed-to-start-the-client/11803/6 "2017-07-06T02:38:24Z")

</div>


