使用1.8.2 --尝试(最初)设置2节点HA集群。
遵循的"22.5.4.以HA模式启动嵌入的Neo4j“一节
http://docs.neo4j.org/chunked/stable/ha-setup-tutorial.html
我已经在我的pom.xml中添加了以下内容:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ha</artifactId>
<version>${neo4j-version}</version>
</dependency>并将我的application-content.xml修改为:
<neo4j:config graphDatabaseService="graphDatabaseService" />
<context:property-placeholder
location="file:/etc/whiteRabbit.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>和
/etc/whiteRabbit.properties包含:
节点1(地址: 192.168.1.68)
server.id=1
ha.server.address=localhost
ha.server.port=6001
database.path=/databases/data/graph.db
coordinators=localhost:2181,192.168.1.100:2181和节点2(地址192.168.1.100)
server.id=2
ha.server.address=localhost
ha.server.port=6001
database.path=/databases/data/graph.db
coordinators=localhost:2181,192.168.1.68:2181当我启动每个实例时,我会得到正常的启动日志,然后
14:57:58.171 [localhost-startStop-1] INFO neo4j - WARNING! Deprecated configuration options used. See manual for details
14:57:58.171 [localhost-startStop-1] INFO neo4j - neo4j.ext.udc.disable has been replaced with neo4j.ext.udc.enabled
14:57:58.171 [localhost-startStop-1] INFO neo4j - cannot configure writers and searchers individually since they go together(只有首两个与医管局变更有关的高级管理人员)
然后..。没什么..。(!)
初创公司只是止步于此。鉴于上面提到的页面中独立服务器的设置配置提到将协调器实例作为流程的单独部分启动,我是否需要在此处手动执行此操作?或者,这应该自己照顾自己吗?我如何找到日志记录信息,以便开始找出为什么我只看到节点挂起?顺便说一句,如果我只启动一个节点,行为也没有什么不同--相同的挂起,日志中的相同位置……
我猜我错过了一些简单的东西?
D
发布于 2013-05-13 22:40:01
您可以在属性文件中创建bean。此外,为了实现HA,您可以使用类HighlyAvailableGraphDatabase。这样做:
<bean id="configuration" class="org.neo4j.helpers.collection.MapUtil" factory-method="load">
<constructor-arg value="/etc/whiteRabbit.properties" />
</bean>
<bean id="graphDatabaseService" class="org.neo4j.kernel.HighlyAvailableGraphDatabase" destroy-method="shutdown" scope="singleton">
<constructor-arg name="storeDir" index="0" value="${database.path}" />
<constructor-arg name="config" index="1" ref="configuration" />
</bean>但是,configuration bean应该指向一个neo4j.properties文件,您可以让该文件包含上面拥有的所有属性。
https://stackoverflow.com/questions/16524542
复制相似问题