2

次の initial_host を持つ 4 つの Neo4j インスタンス (v.1.9.3) のクラスターがあります。

ha.initial_hosts=192.168.1.10:5001,192.168.1.10:5002,192.168.1.10:5003,192.168.1.10:5004  

このクラスターを、applicationContext ファイルで次の構成を保持している Spring アプリ (Spring-data-neo4j を使用) の 1 つに使用しています。

<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase"
    destroy-method="shutdown" scope="singleton"> 
    <constructor-arg name="storeDir" index="0" value="E:/Neo4J Enterprise Edition/db1/data/graph.db" />
    <constructor-arg index="1">
        <map>
            <entry key="ha.server_id" value="5" />
            <entry key="ha.pull_interval" value="10" />
            <entry key="ha.server" value="192.168.1.10:6005" />
            <entry key="ha.initial_hosts" value="192.168.1.10:5001,192.168.1.10:5002,192.168.1.10:5003,192.168.1.10:5004" />
        </map>
    </constructor-arg>
</bean><neo4j:config graphDatabaseService="graphDatabaseService" />  

クラスターは正常に動作しており、インスタンス間のデータの適切な同期/レプリケーションが行われています。

クラスターを共有したり、同じクラスターで別のアプリケーションを実行したりすることはできますか?
これを実現するために、次のように 2 番目のアプリの別の構成を作成しました。

<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase"
        destroy-method="shutdown" scope="singleton"> 
        <constructor-arg name="storeDir" index="1" value="E:/db_5/graph.db" />
        <constructor-arg index="2">
            <map>
                <entry key="ha.server_id" value="6" />
                <entry key="ha.pull_interval" value="10" />
                <entry key="ha.server" value="192.168.1.10:6006" />
                <entry key="ha.initial_hosts" value="192.168.1.10:5001,192.168.1.10:5002,192.168.1.10:5003,192.168.1.10:5004" />
            </map>
        </constructor-arg>
    </bean>
    <neo4j:config graphDatabaseService="graphDatabaseService" />  

しかし、それは常に例外で終わります。以下は、その数行です。

    Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.cluster.client.ClusterClient@9bad4f' was successfully initialized, but failed to start. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
    ... 78 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.cluster.client.ClusterJoin@c47498' was successfully initialized, but failed to start. Please see attached cause exception.
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
    at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
    at org.neo4j.cluster.client.ClusterClient.start(ClusterClient.java:421)
    at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
    ... 80 more
Caused by: java.lang.IllegalStateException: i was denied entry
    at org.neo4j.cluster.protocol.cluster.ClusterState$2.handle(ClusterState.java:199)
    at org.neo4j.cluster.protocol.cluster.ClusterState$2.handle(ClusterState.java:121)
    at org.neo4j.cluster.statemachine.StateMachine.handle(StateMachine.java:88)
    at org.neo4j.cluster.StateMachines$1.run(StateMachines.java:135)
    ... 3 more  

2番目の構成に問題はありますか? このリンクにアクセスしました。エントリキーを変更ha.server_idha.serverて、同じドメインの2つの異なるマシンでプロジェクトを実行しようとしましたが、助けにはなりませんでした。

ここで私が間違っていることを教えてください。ありがとう

4

0 に答える 0