使用两个实例创建Neo4j集群时出错

时间:2016-01-12 06:13:44

标签: neo4j

我正在尝试使用

中给出的配置创建一个neo4j集群,其中包含两个实例

http://neo4j.com/docs/stable/ha-setup-tutorial.html

我尝试了很多东西,但是当我在initial_hosts条目中添加另一个IP并重启服务器时它无法启动它将无法启动。

当我运行命令neo4j.bat

 INFO  Write transactions to database disabled  
 INFO  Initiating metrics..
 INFO  Attempting to join cluster of [IP of my pc:5001, ip of another pc:5001]

并且服务器已启动,但是当我点击localhost时:7474它无效。

我的其他配置在我的电脑中:

neo4j.properties

ha.cluster_server=my IP on my machine:5001
ha.server=IP of my pc:6363
ha.server_id=1
online_backup_server=ip of my pc:6366

neo4j-server.properties

org.neo4j.server.database.mode=HA
org.neo4j.server.webserver.address=0.0.0.0

我也启用了日志属性

org.neo4j.server.http.log.config=conf/neo4j-http-logging.xml

但没有创建日志文件。

1 个答案:

答案 0 :(得分:0)

对于每个节点,您需要使用不同的端口。

<强> neo4j01 / CONF / neo4j.properties

ha.cluster_server=localhost:5001
ha.server=localhost:6363
ha.server_id=1
online_backup_server=localhost:6366
ha.initial_hosts=localhost:5001,localhost:5002

<强> neo4j01 / CONF / neo4j-server.properties

org.neo4j.server.database.mode=HA
org.neo4j.server.webserver.address=0.0.0.0

<强> neo4j02 / CONF / neo4j.properties

ha.cluster_server=localhost:5002
ha.server=localhost:6363
ha.server_id=2
online_backup_server=localhost:6366
ha.initial_hosts=localhost:5001,localhost:5002

<强> neo4j02 / CONF / neo4j-server.properties

org.neo4j.server.database.mode=HA
org.neo4j.server.webserver.address=0.0.0.0

以下是如何在本地计算机上运行群集的示例 - https://github.com/MicTech/neo4j-ha-configuration