0
votes

I am trying to setup a Neo4j HA cluster using the Enterprise version 2.1.5. Everything works just fine when I setup a cluster locally. However, when I try to use different machines to form the cluster one node fails to start and simply keeps still after writing INFO [Cluster] Write transactions to database disabled to the console log file. In my case the master stucks while the slave tries to join the cluster.

What can cause this behaviour?

Configuration

Master

conf/neo4j.properties

ha.server_id=1
ha.cluster_server=<ip:m>:5001
ha.initial_hosts=<ip:m>:5001,<ip:s>:5001
ha.server=<ip:m>:6001

conf/neo4j-server.properties

org.neo4j.server.webserver.address=<ip:m>
org.neo4j.server.webserver.https.port=7484

Slave

conf/neo4j.properties

ha.server_id=2
ha.cluster_server=<ip:s>:5001
ha.initial_hosts=<ip:m>:5001,<ip:s>:5001
ha.server=<ip:s>:6001
ha.slave_only=true

conf/neo4j-server.properties

org.neo4j.server.webserver.address=<ip:s>
org.neo4j.server.webserver.https.port=7484

Console/log files output

Master

terminal

$ sudo /var/lib/neo4j/bin/neo4j start

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...WARNING: not changing user
HA instance started in process [30188]. Will be operational once connected to peers. See /var/lib/neo4j/data/log/console.log for current status.

data/log/console.log
2014-11-25 10:13:48.759+0000 INFO [Cluster] Write transactions to database disabled

data/log/neo4j.0.0.log
file is empty

Slave

terminal

$ sudo su
$ /var/lib/neo4j/bin/neo4j start

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...HA instance started in process [4057]. Will be operational once connected to peers. See /var/lib/neo4j/data/log/console.log for current status.

data/log/console.log
Detected incorrectly shut down database, performing recovery..
2014-11-25 10:17:23.427+0000 INFO [Cluster] Write transactions to database disabled
2014-11-25 10:17:24.402+0000 INFO [Cluster] Attempting to join cluster of [<ip:m>:5001, <ip:s>:5001]

data/log/neo4j.0.0.log
file is empty

1

1 Answers

1
votes

A cluster needs to have at least 3 instances since a master election requires a quorum (more than half). Try to setup a third instance to solve this and amend the 3rd instance to initial_hosts. Be sure to have the 3 instances on the same network or use a vpn for this.