30s time delay to build the client when peer hosts not correct!


(Bozena Wegorek) #1

When peer nodes are not correct or dead, ES spends 30s doing nothing,
what property configures it?
None of these work:
Builder builder = ImmutableSettings.settingsBuilder()
.put(ES_CONFIG_CLUSTER_PROPERTY_KEY, this.clusterName)
.putArray(ES_CONFIG_PEER_HOSTS_PROPERTY_KEY,
this.peerHosts)
.put("discovery.zen.fd.ping_timeout", 2)
.put("discovery.zen.ping.timeout", 2)
.put("discovery.zen.ping.multicast.enabled", false)
.put("gateway.expected_nodes", 2);

...

Here's the time wasting code:

long createTime = System.currentTimeMillis();
node = NodeBuilder.nodeBuilder()
.client(true)
.settings(settings)
.node();
createTime = System.currentTimeMillis() - createTime;
System.out.println("create time=" + createTime);

/********* createTime is 30s ************/

node.start()
node.client()

ES version: 0.18.7


(Shay Banon) #2

The node will wait for a proper discovery to happen (finding a master node) on startup, by default, it is 30 seconds. You can configure that by setting discovery.initial_state_timeout setting.

On Thursday, February 9, 2012 at 6:53 PM, Bozena Wegorek wrote:

When peer nodes are not correct or dead, ES spends 30s doing nothing,
what property configures it?
None of these work:
Builder builder = ImmutableSettings.settingsBuilder()
.put(ES_CONFIG_CLUSTER_PROPERTY_KEY, this.clusterName)
.putArray(ES_CONFIG_PEER_HOSTS_PROPERTY_KEY,
this.peerHosts)
.put("discovery.zen.fd.ping_timeout", 2)
.put("discovery.zen.ping.timeout", 2)
.put("discovery.zen.ping.multicast.enabled", false)
.put("gateway.expected_nodes", 2);

...

Here's the time wasting code:

long createTime = System.currentTimeMillis();
node = NodeBuilder.nodeBuilder()
.client(true)
.settings(settings)
.node();
createTime = System.currentTimeMillis() - createTime;
System.out.println("create time=" + createTime);

/********* createTime is 30s ************/

node.start()
node.client()

ES version: 0.18.7


(system) #3