MasterNotDiscoveredException on client

Hi,
My client seems not able to connect to elasticsearch cluster (0.19.3).

Here's client log:
DEBUG;[zen.ping.multicast:94][main] [Jester] using group [224.2.2.4], with port [54328], ttl [3], and address [null]
DEBUG;[zen.ping.unicast:94][main] [Jester] using initial hosts [], with concurrent_connects [10]
DEBUG;[elasticsearch.discovery.zen:94][main] [Jester] using ping.timeout [2m]
DEBUG;[discovery.zen.elect:94][main] [Jester] using minimum_master_nodes [-1]
DEBUG;[discovery.zen.fd:94][main] [Jester] [master] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
DEBUG;[discovery.zen.fd:94][main] [Jester] [node ] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
WARN;[org.elasticsearch.discovery:114][main] [Jester] waited for 30s and no initial state was set by the discovery
INFO;[search.analyzer.ElasticSearchIndexer:180][main] Search cluster qa-search01
ERROR;[search.analyzer.ElasticSearchIndexer:205][main] org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]

Here's server log:
[TRACE][discovery.zen.ping.multicast] [Proteus] [1] received ping_request from [[Jester][mVQxLCYzSQugPNA4P3T4Yg][inet[/10.3.5.21:9300]]{client=true, data=false}], sending ping_response{target [[Proteus][_G945VyASLyJ2FrxRs_x7g][inet[/10.3.5.109:9300]]], master [[Proteus][_G945VyASLyJ2FrxRs_x7g][inet[/10.3.5.109:9300]]], cluster_name[qa-search01]}

It seems like the server "Proteus" received the ping request from the client "Jester" and responded,
but the client timed out (30 sec).

Is there anywhere else I should look at to investigate what is happening?

Thanks for your help!

It is solved by adding '-Djava.net.preferIPv4Stack=true' to java command that starts the client.
Before adding this, the multicast ping sent by the client had ttl=1, and after adding this, the ttl=3.
I don't know why this was needed, but it works now.

Further question:

  • how can I change client setting, such as multicast ttl?
    I think ttl=3 is the default. How can I change?

Can that be fed into NodeBuilder.settings(Settings)?
If so, will that be ImmutableSettings.settingsBuilder().put("discovery.zen.ping.multicast.ttl", 4)?
How about "discoverty.zen.ping_timeout"? Can it be set by the same way?

Thank you for your help.

You can build all your settings using settingsBuilder and then pass them to
TransportClient:

Settings settings = ImmutableSettings.settingsBuilder()
.put("discovery.zen.ping.multicast.ttl", 4)
.put("client.transport.ping_timeout", "10s")
.put("cluster.name", "my_cluster")
.build();
TransportClient client = new TransportClient(settings);

On Friday, July 20, 2012 4:09:22 PM UTC-4, arta wrote:

It is solved by adding '-Djava.net.preferIPv4Stack=true' to java command
that
starts the client.
Before adding this, the multicast ping sent by the client had ttl=1, and
after adding this, the ttl=3.
I don't know why this was needed, but it works now.

Further question:

  • how can I change client setting, such as multicast ttl?
    I think ttl=3 is the default. How can I change?

Can that be fed into NodeBuilder.settings(Settings)?
If so, will that be
ImmutableSettings.settingsBuilder().put("discovery.zen.ping.multicast.ttl",

4)?
How about "discoverty.zen.ping_timeout"? Can it be set by the same way?

Thank you for your help.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/MasterNotDiscoveredException-on-client-tp4020605p4020656.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Thank you Igor.
What if I use 'Node node = NodeBuilder.nodeBuilder().client(true).node();' ?
I can't find any place I can feed ImmutableSettings in.

    Node node = NodeBuilder
            .nodeBuilder()
            .client(true)
            .settings(settings)
            .node();

On Friday, July 20, 2012 6:27:58 PM UTC-4, arta wrote:

Thank you Igor.
What if I use 'Node node = NodeBuilder.nodeBuilder().client(true).node();'
?
I can't find any place I can feed ImmutableSettings in.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/MasterNotDiscoveredException-on-client-tp4020605p4020662.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.