Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有高可用性的嵌入式Neo4j_Neo4j_Spring Data Neo4j - Fatal编程技术网

具有高可用性的嵌入式Neo4j

具有高可用性的嵌入式Neo4j,neo4j,spring-data-neo4j,Neo4j,Spring Data Neo4j,我在一个POC中使用了最近嵌入的Spring数据Neo4j。它在一台机器上快速工作。在投入生产之前,我想将数据库与应用服务器分离。我配置了三个Neo4j服务器实例和HA代理,并使用Spring数据Neo4j Rest进行连接。但速度最差。每个查询的执行时间超过30秒 我正在考虑使用嵌入HA的Neo4j?有人能给我提供链接/教程,用HA代理在嵌入式模式下配置Spring Data Neo4j吗 我希望有3台neo4j服务器和多台应用服务器。 谢谢 附加日志 我尝试将其设置如下: <bean

我在一个POC中使用了最近嵌入的Spring数据Neo4j。它在一台机器上快速工作。在投入生产之前,我想将数据库与应用服务器分离。我配置了三个Neo4j服务器实例和HA代理,并使用Spring数据Neo4j Rest进行连接。但速度最差。每个查询的执行时间超过30秒

我正在考虑使用嵌入HA的Neo4j?有人能给我提供链接/教程,用HA代理在嵌入式模式下配置Spring Data Neo4j吗

我希望有3台neo4j服务器和多台应用服务器。 谢谢

附加日志
我尝试将其设置如下:

<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> 
仍然不走运,它会以下面的日志停止

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
瑞克

下面是一个关于如何将嵌入式HA的参数传递到
HighlyAvailableGraphDatabase
的示例

<neo4j:config graphDatabaseService="graphDatabaseService" />

<context:property-placeholder 
        location="file:/etc/neo4j-ha.properties" />

<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase"
                destroy-method="shutdown" scope="singleton">
                <constructor-arg index="0" value="${database.path}" />
                <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>


另请参见此处:

不久前我曾就此写过一篇博文。应该给你想要的。(尽管我决定使用Java配置)


迈克尔,这不管用。更新了跟踪问题。它会在中间停止,然后tomcat不会启动。
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
<neo4j:config graphDatabaseService="graphDatabaseService" />

<context:property-placeholder 
        location="file:/etc/neo4j-ha.properties" />

<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase"
                destroy-method="shutdown" scope="singleton">
                <constructor-arg index="0" value="${database.path}" />
                <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>