I have a cluster of 4 Neo4j instance (v.1.9.3) with following initial_host:
ha.initial_hosts=192.168.1.10:5001,192.168.1.10:5002,192.168.1.10:5003,192.168.1.10:5004
I am using this cluster for one of my spring app (using Spring-data-neo4j) for which I have kept following configuration in my applicationContext file:
<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" />
Cluster is running properly, with proper sync / replication of data between instances.
Now is it possible to share cluster or run another application on the same cluster ?
To achieve this I wrote another configuration for second app as follow:
<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" />
but it always end up with exception. Following are the few lines of it:
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
Is there any thing wrong with second configuration ? I visited this link. and tried with changing ha.server_id
and ha.server
entry key and running the project on two different machine of the same domain, but no help.
Can any one please point me out what I am doing wrong here ? Thanks