Neo4j 即使允许创建集群,启动Heo4j HA集群中的第一个节点也会失败

Neo4j 即使允许创建集群,启动Heo4j HA集群中的第一个节点也会失败,neo4j,Neo4j,在尝试诊断集群的另一个问题时,我尝试隔离环境以强制选举事件。虽然我的应用无法启动,但在隔离状态下启动节点时出现以下异常: Caused by: java.util.concurrent.TimeoutException: null at org.neo4j.cluster.statemachine.StateMachineProxyFactory$ResponseFuture.get(StateMachineProxyFactory.java:300) ~[neo4j-cluster-2

在尝试诊断集群的另一个问题时,我尝试隔离环境以强制选举事件。虽然我的应用无法启动,但在隔离状态下启动节点时出现以下异常:

Caused by: java.util.concurrent.TimeoutException: null
    at org.neo4j.cluster.statemachine.StateMachineProxyFactory$ResponseFuture.get(StateMachineProxyFactory.java:300) ~[neo4j-cluster-2.0.1.jar:2.0.1]
    at org.neo4j.cluster.client.ClusterJoin.joinByConfig(ClusterJoin.java:158) ~[neo4j-cluster-2.0.1.jar:2.0.1]
    at org.neo4j.cluster.client.ClusterJoin.start(ClusterJoin.java:91) ~[neo4j-cluster-2.0.1.jar:2.0.1]
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:503) ~[neo4j-kernel-2.0.1.jar:2.0.1]
    ... 59 common frames omitted
我的配置设置为60秒连接超时(
ha.cluster\u join\u timeout
),这样各个节点就可以初始化集群(
ha.allow\u init\u cluster

查看
ClusterJoin
类中被截断的代码块,我相信在一些负面情况下,代码将再次尝试连接,或者当前节点将创建一个新集群

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 to join cluster, create new one
                        console.log( "Could not join cluster of " + hosts.toString() );
                        console.log( format( "Creating new cluster with name [%s]...", config.getClusterName() ) );
                        cluster.create( config.getClusterName() );
                        break;
                    }

                    console.log( "Could not join cluster, timed out. Retrying..." );
                }
            }
但是,
TimeoutException
不是这些情况之一,事实上joinByConfig方法也抛出TimeoutException。
stateMachineProxy工厂$ResponseFuture
类(实现Future)在等待时间且未收到状态机消息时抛出
TimooutException

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();
    }
加入群集时是否应该超时,如果配置为初始化群集,则不应传播TIMOUTEException,并且应初始化新群集?如果不是这样,那么集群服务器是否总是必须同时启动