I used Spring Data Neo4j Embedded recently for one of the POC. It works blazing fast on single machine. Before going to production, I wanted to separate database from the application server. I configured three Neo4j Server instances and HA proxy and used Spring Data Neo4j Rest to connect. But the speed was worst. Each query takes more than 30 seconds to execute.
I am thinking to use Neo4j Embedded with HA? Can someone provide me links/tutorials to configure Spring Data Neo4j in Embedded mode with HA proxy.
I wish to have 3 neo4j servers and multiple application servers. Thanks.
Additional Log
17:43:10.695 [main] DEBUG o.s.b.f.annotation.InjectionMetadata - Processing injected method of bean 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': AutowiredMethodElement for public void org.springframework.data.neo4j.config.Neo4jConfiguration.setConversionService(org.springframework.core.convert.ConversionService)
17:43:10.703 [main] DEBUG o.s.b.f.annotation.InjectionMetadata - Processing injected method of bean 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': AutowiredMethodElement for public void org.springframework.data.neo4j.config.Neo4jConfiguration.setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService)
17:43:10.703 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'graphDatabaseService'
17:43:10.703 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'graphDatabaseService'
17:43:10.832 [main] DEBUG neo4j - WARNING! Deprecated configuration options used. See manual for details
17:43:10.832 [main] DEBUG neo4j - neo4j.ext.udc.disable has been replaced with neo4j.ext.udc.enabled
17:43:10.832 [main] DEBUG neo4j - cannot configure writers and searchers individually since they go together
17:43:14.467 [main] DEBUG neo4j - Writing at flush-requested: -1
17:43:16.163 [main] DEBUG neo4j - Read HA server:54.234.75.138:6002 (for machineID 2) from zoo keeper
17:43:16.821 [main] DEBUG neo4j - Read HA server:54.234.75.138:6003 (for machineID 3) from zoo keeper
17:43:17.445 [main] DEBUG neo4j - Writing at flush-requested: -6
17:43:19.013 [main] DEBUG neo4j - getMaster 2 based on [MachineInfo[ID:2, sequence:46, last tx:672, server:(54.234.75.138, 6002), master for last tx:1], MachineInfo[ID:3, sequence:47, last tx:672, server:(54.234.75.138, 6003), master for last tx:1]]
I have tried setting it as follows:
<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase" destroy-method="shutdown" scope="singleton">
<constructor-arg name="storeDir" index="0" value="data/graph.db" />
<constructor-arg index="1">
<map>
<entry key="ha.server_id" value="${server.id}"></entry>
<entry key="ha.server" value="${ha.server.address}:${ha.server.port}"></entry>
<entry key="ha.coordinators" value="${coordinators}"></entry>
<entry key="enable_remote_shell" value="port=1331"></entry>
<entry key="ha.pull_interval" value="1"></entry>
</map>
</constructor-arg>
</bean>
My neo4j-ha.properties file
server.id=1
ha.server.address=192.168.1.9
ha.server.port=7474
coordinators=192.168.1.9:5001,192.168.1.9:5002,192.168.1.9:5003
server.id=2
ha.server.address=192.168.1.9
ha.server.port=7475
coordinators=192.168.1.9:5001,192.168.1.9:5002,192.168.1.9:5003
server.id=3
ha.server.address=192.168.1.9
ha.server.port=7476
coordinators=192.168.1.9:5001,192.168.1.9:5002,192.168.1.9:5003
Still no luck, it halts with the following log
16:49:13.386 [main] DEBUG o.s.b.f.annotation.InjectionMetadata - Processing injected method of bean 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': AutowiredMethodElement for public void org.springframework.data.neo4j.config.Neo4jConfiguration.setGraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService)
16:49:13.387 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'graphDatabaseService'
16:49:13.387 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'graphDatabaseService'
16:49:13.522 [main] DEBUG neo4j - WARNING! Deprecated configuration options used. See manual for details
16:49:13.522 [main] DEBUG neo4j - neo4j.ext.udc.disable has been replaced with neo4j.ext.udc.enabled
16:49:13.522 [main] DEBUG neo4j - cannot configure writers and searchers individually since they go together