Question

Using Neo4j 2.0 M3 and have 2 nodes in the cluster Here are my messages.log file for one node:

2013-09-11 19:18:30.377+0000 INFO  [o.n.c.p.c.ClusterState]: Joining cluster neo4j.ha
2013-09-11 19:18:30.378+0000 INFO  [o.n.c.p.c.ClusterState]: 2 joining:Name:neo4j.ha Nodes:{1=cluster://10.7.19.143:5001} Roles:{coordinator=1}, last delivered:-1
2013-09-11 19:18:30.379+0000 DEBUG [o.n.c.p.c.ClusterState]: Setup join timeout for cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.379+0000 DEBUG [o.n.c.p.c.ClusterState$2]: ClusterState: discovery-[configurationResponse]->joining from:cluster://10.7.19.143:5001 conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.381+0000 DEBUG [o.n.c.p.a.m.AcceptorState$1]: AcceptorState: start-[join]->acceptor conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.382+0000 DEBUG [o.n.c.p.a.m.LearnerState$1]: LearnerState: start-[join]->learner conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.382+0000 DEBUG [o.n.c.p.a.m.AtomicBroadcastState$1]: AtomicBroadcastState: start-[join]->joining conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.415+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: Learned and closed instance 0 from conversation cluster://10.7.19.142:5001/11# and the content was Change cluster config, join:2
2013-09-11 19:18:30.416+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: LearnerState: learner-[learn]->learner from:cluster://10.7.19.143:5001 instance:0 conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.416+0000 DEBUG [o.n.c.p.a.m.AtomicBroadcastState$2]: AtomicBroadcastState: joining-[broadcastResponse]->joining conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.418+0000 DEBUG [o.n.c.p.c.ClusterState$3]: ClusterState: joining-[configurationChanged]->entered conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.418+0000 DEBUG [o.n.c.p.c.ClusterState$4]: ClusterState: entered-[joinResponse]->entered conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.418+0000 INFO  [o.n.c.c.ClusterJoin]: Joined cluster:Name:neo4j.ha Nodes:{1=cluster://10.7.19.143:5001, 2=cluster://10.7.19.142:5001} Roles:{coordinator=1}
2013-09-11 19:18:30.418+0000 DEBUG [o.n.c.p.a.m.AtomicBroadcastState$2]: AtomicBroadcastState: joining-[entered]->broadcasting conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.419+0000 DEBUG [o.n.c.p.a.m.ProposerState$1]: ProposerState: start-[join]->proposer conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.420+0000 DEBUG [o.n.c.p.a.m.AcceptorState$2]: AcceptorState: acceptor-[join]->acceptor conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.420+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: LearnerState: learner-[join]->learner conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.421+0000 DEBUG [o.n.c.p.e.ElectionState$1]: ElectionState: start-[join]->election conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.421+0000 DEBUG [o.n.c.p.s.SnapshotState$1]: SnapshotState: start-[join]->ready conversation-id:cluster://10.7.19.142:5001/11#
2013-09-11 19:18:30.425+0000 DEBUG [o.n.k.h.c.HighAvailabilityMemberStateMachine]: Got masterIsElected(1), changed PENDING -> PENDING. Previous elected master is null
2013-09-11 19:18:30.425+0000 DEBUG [o.n.c.p.e.ElectionState$2]: ElectionState: election-[performRoleElections]->election conversation-id:cluster://10.7.19.142:5001/12#
2013-09-11 19:18:34.748+0000 DEBUG [o.n.c.p.e.ElectionState$2]: ElectionState: election-[vote:coordinator]->election from:cluster://10.7.19.143:5001 conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.770+0000 DEBUG [o.n.c.p.a.m.AcceptorState$2]: AcceptorState: acceptor-[prepare]->acceptor from:cluster://10.7.19.143:5001 instance:1 conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.785+0000 DEBUG [o.n.c.p.a.m.AcceptorState$2]: AcceptorState: acceptor-[accept]->acceptor from:cluster://10.7.19.143:5001 instance:1 conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.797+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: Learned and closed instance 1 from conversation cluster://10.7.19.143:5001/13# and the content was Change cluster config, elected:1 as coordinator
2013-09-11 19:18:34.797+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: LearnerState: learner-[learn]->learner from:cluster://10.7.19.143:5001 instance:1 conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.797+0000 DEBUG [o.n.c.p.a.m.AtomicBroadcastState$3]: AtomicBroadcastState: broadcasting-[broadcastResponse]->broadcasting conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.798+0000 DEBUG [o.n.c.p.c.ClusterState$4]: ClusterState: entered-[configurationChanged]->entered conversation-id:cluster://10.7.19.143:5001/13#
2013-09-11 19:18:34.798+0000 DEBUG [o.n.k.h.c.HighAvailabilityMemberStateMachine]: Got masterIsElected(1), changed PENDING -> PENDING. Previous elected master is 1
2013-09-11 19:18:34.798+0000 DEBUG [o.n.c.p.s.SnapshotState$3]: SnapshotState: ready-[refreshSnapshot]->refreshing conversation-id:cluster://10.7.19.142:5001/13#
2013-09-11 19:18:34.799+0000 DEBUG [o.n.c.p.c.ClusterState$4]: ClusterState: entered-[removeClusterListener]->entered conversation-id:cluster://10.7.19.142:5001/14#
2013-09-11 19:18:34.816+0000 DEBUG [o.n.c.p.s.SnapshotState$2]: SnapshotState: refreshing-[snapshot]->ready from:cluster://10.7.19.143:5001 conversation-id:cluster://10.7.19.142:5001/13#
2013-09-11 19:18:50.420+0000 INFO  [o.n.k.i.DiagnosticsManager]: --- SERVER STARTED START ---
2013-09-11 19:18:50.961+0000 INFO  [o.n.k.i.DiagnosticsManager]: --- STARTED diagnostics for org.neo4j.server.configuration.Configurator START ---
2013-09-11 19:18:50.962+0000 INFO  [o.n.k.i.DiagnosticsManager]: Server configuration:
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.database.location = data/graph.db
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.address = 10.7.19.142
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.port = 7474
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.https.enabled = true
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.https.port = 7473
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.https.cert.location = conf/ssl/snakeoil.cert
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.https.key.location = conf/ssl/snakeoil.key
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webserver.https.keystore.location = data/keystore
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webadmin.rrdb.location = data/rrd
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.db.tuning.properties = conf/neo4j.properties
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.manage.console_engines = [gremlin, shell]
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.database.mode = HA
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.http.log.enabled = true
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.http.log.config = conf/neo4j-http-logging.xml
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webadmin.management.uri = /db/manage/
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: org.neo4j.server.webadmin.data.uri = /db/data/
2013-09-11 19:18:50.963+0000 INFO  [o.n.k.i.DiagnosticsManager]: --- STARTED diagnostics for org.neo4j.server.configuration.Configurator END ---
2013-09-11 19:18:50.977+0000 INFO  [o.n.k.i.DiagnosticsManager]: Mounted discovery module (org.neo4j.server.rest.discovery) at: /
2013-09-11 19:18:50.980+0000 INFO  [o.n.k.i.DiagnosticsManager]: Mounted REST API at: /db/data/
2013-09-11 19:18:50.981+0000 INFO  [o.n.k.i.DiagnosticsManager]: Mounted management API at: /db/manage/
2013-09-11 19:18:51.023+0000 INFO  [o.n.k.i.DiagnosticsManager]: Mounted webadmin at: /webadmin
2013-09-11 19:18:52.621+0000 INFO  [o.n.k.i.DiagnosticsManager]: Server started on: http://10.7.19.142:7474/
2013-09-11 19:18:52.621+0000 INFO  [o.n.k.i.DiagnosticsManager]: --- SERVER STARTED END ---

So when I go to the console on the webserver I get:

neo4j-sh (?)$ START n=node(*) RETURN n;
==> TransactionFailureException: Timeout waiting for cluster to elect master

Any thoughts on how I can remedy?

Was it helpful?

Solution

In neo4j, you need at least 3 nodes in a cluster. If you only want 2 nodes, you need to start up at least one arbiter. Read here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top