neo4j - Starting first node in Heo4j HA cluster fails even when allowed to create cluster -
whilst trying diagnose different issue cluster tried isolating environments force elections events. when starting nodes in isolation though app failed start exception:
caused by: java.util.concurrent.timeoutexception: null @ org.neo4j.cluster.statemachine.statemachineproxyfactory$responsefuture.get(statemachineproxyfactory.java:300) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.cluster.client.clusterjoin.joinbyconfig(clusterjoin.java:158) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.cluster.client.clusterjoin.start(clusterjoin.java:91) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.kernel.lifecycle.lifesupport$lifecycleinstance.start(lifesupport.java:503) ~[neo4j-kernel-2.0.1.jar:2.0.1] ... 59 common frames omitted
my configuration set 60 second join timeout (ha.cluster_join_timeout
) , such individual nodes can initialize cluster (ha.allow_init_cluster
).
looking @ truncated chunk of code clusterjoin
class believe after negative cases code either loop attempting again connect, or current node create new cluster.
private void joinbyconfig() throws timeoutexception { while( true ) { if (config.getclusterjointimeout() > 0) { try { console.log( "joined cluster:" + clusterconfig.get(config.getclusterjointimeout(), timeunit.milliseconds )); return; } catch ( interruptedexception e ) { console.log( "could not join cluster, interrupted. retrying..." ); } catch ( executionexception e ) { logger.debug( "could not join cluster " + this.config.getclustername() ); if ( e.getcause() instanceof illegalstateexception ) { throw ((illegalstateexception) e.getcause()); } if ( config.isallowedtocreatecluster() ) { // failed join cluster, create new 1 console.log( "could not join cluster of " + hosts.tostring() ); console.log( format( "creating new cluster name [%s]...", config.getclustername() ) ); cluster.create( config.getclustername() ); break; } console.log( "could not join cluster, timed out. retrying..." ); } }
however timeoutexception
not 1 of these cases , in fact joinbyconfig method throws timeoutexception. statemachineproxyfactory$responsefuture
class (which implements future) throws timooutexception
when time has been waited , no state machine message has been received.
public synchronized object get( long timeout, timeunit unit ) throws interruptedexception, executionexception, timeoutexception { if ( response != null ) { getresult(); } this.wait( unit.tomillis( timeout ) ); if ( response == null ) { throw new timeoutexception(); } return getresult(); }
should case when joining cluster has timed out, , if configured intialise cluster timoutexception should not propagated , new cluster should initialised? if not case, clustered servers have started in unison?
Comments
Post a Comment