Neo4j HA Configuration

220 views
Skip to first unread message

Stephen Mallette

unread,
Jun 17, 2016, 7:10:44 AM6/17/16
to Gremlin-users, d...@tinkerpop.apache.org
I tested out the Neo4j HA configuration with TinkerPop yesterday and it worked nicely. We sometimes get questions about how to set that up or how to get Gremlin Server to point at a cluster rather than run in embedded mode, so it was nice to see this working. I wrote up some documentation on how to get this configured in TinkerPop:


It's pretty simple really. TinkerPop really just acts as a pass through for Neo4j configuration options so if you follow Neo4j's instructions in their documentation you just append those options into your TinkerPop graph instances and you should be good to go. I was able to get a three node cluster running purely in Gremlin Server going in just a few minutes.

Note that while I referenced 3.2.1 documentation above, this feature should work in both 3.1.2-incubating (maybe all of 3.1.x but i didn't test) and 3.2.0-incubating.

drVillo

unread,
Jul 4, 2016, 3:43:14 PM7/4/16
to Gremlin-users, d...@tinkerpop.apache.org
Hi, thanks for posting this.

I have been trying to do something similar but I fail to understand how to attach gremlin to an already running Neo4j server. Whenever I try to call Neo4jGraph.open() I get an error because the database is locked by another process. Is the idea that I should bring up the whole cluster via TinkerPop instead?

Finally, and with the risk of going off-topic: if my purpose is to use gremlin within an existing Neo4j server (which serves a couple of extensions as well) I would be better off using https://github.com/thinkaurelius/neo4j-gremlin-plugin?  

Thanks a lot, cheers
F

Stephen Mallette

unread,
Jul 4, 2016, 7:12:22 PM7/4/16
to Gremlin-users
If you are getting that error then you are still trying to connect via embedded mode. neo4j-gremlin does not connect to neo4j server over its REST api or anything like that. it can only join a configured neo4j HA cluster, which is what is described in the TinkerPop documentation. i suppose that if you are using Neo4j Server and NOT their HA configuration then the better approach is to use the neo4j-gremlin-plugin - though i'm not sure what version of Gremlin that's pinned at right now. Your other option is to just use Gremlin Server instead of Neo4j Server. 

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5cc193ae-e3cc-4722-9592-b788ca0d010b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

drVillo

unread,
Jul 5, 2016, 4:13:50 AM7/5/16
to Gremlin-users
Thanks for  your reply. I actually have an HA Neo4j server but for my early tests I have been trying to hook up on a standalone instance that we use to verify backups. 

Are you saying I could build up a cluster where some nodes run the stock Neo4j server and some other the gremlin one? That'd be neat:)
Cheers
F

Stephen Mallette

unread,
Jul 5, 2016, 10:39:58 AM7/5/16
to Gremlin-users
If you are running an HA cluster of Neo4j Servers then I don't see what it wouldn't be possible to include a Gremlin Server instance or two in that cluster. Even Gremlin Console, when connected via HA essentially becomes a node in that HA cluster.

ha...@nugit.co

unread,
Jan 25, 2018, 10:19:39 AM1/25/18
to Gremlin-users
Hello Stephen,
I tried to setup the HA cluster for Neo4j following the documentation here: 

But I could not get the Servers to start up.
I changed the option names to the ones provided here:

And it worked. My neo4j plugin is 3.3.0 and so is my server. Not sure why it worked.

Another issue I'm facing is, that in a cluster if I kill one of these instances and try to bring it back up to join the cluster. It fails.
I get this error in the server logs for the instances that are still alive.
"[WARN] HttpGremlinEndpointHandler - Invalid request - responding with 400 Bad Request and no gremlin script supplied"

Would appreciate your input on these issues.
Have attached the properties and yaml files for your reference.

Thanks
Harsh
neo4j_ha1.properties
neo4j_ha2.properties
neo4j_ha3.properties
gremlin-server-neo4j-ha1.yaml
gremlin-server-neo4j-ha2.yaml
gremlin-server-neo4j-ha3.yaml

Robert Dale

unread,
Jan 25, 2018, 10:51:25 AM1/25/18
to gremli...@googlegroups.com
In TinkerPop 3.3.1, Neo4j was upgraded from 2.3 to 3.2.  See also http://tinkerpop.apache.org/docs/3.3.1/upgrade/#_upgrade_neo4j

Robert Dale

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/779a8aa1-7b77-48fc-96df-c4e62c3dffd4%40googlegroups.com.

ha...@nugit.co

unread,
Jan 25, 2018, 10:54:39 AM1/25/18
to Gremlin-users
Thanks Robert. That explains the changes in the names.
Would you be knowing about the reason behind the cluster behaviour. An instance cannot reconnect back into the cluster after it has been killed.

Thanks,
Harsh

Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Robert Dale

unread,
Jan 25, 2018, 11:08:15 AM1/25/18
to gremli...@googlegroups.com
I don't know.  You may want to check the neo4j 3.2 issues/changelog.  If there's a fix in a newer version, you may be able to swap out all the neo4j 3.2.3 jars for 3.2.x jars or update and rebuild neo4j-tinkerpop-api-impl.

Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/d644b15d-bff3-4943-9c4a-069d575999ce%40googlegroups.com.

Harshvardhan Joshi

unread,
Jan 27, 2018, 4:10:22 AM1/27/18
to gremli...@googlegroups.com
I tried following your suggestion Robert. But the cluster behaviour is still the same.

To be clear, the following are the plugins available on my Gremlin Server:
1) neo4j-tinkerpop-api-impl - 0.-3-2.3.3
2) neo4j-gremlin - 3.3.0

Am I missing some plugins?

Maybe you could help me check if following the documentation on the Tinkerpop page allows you to create a HA cluster without these issues occurring on your side?

Thanks,
Harsh

You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/tDAgNo3ndEA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CABed_4q6Wrga4vumxwOONRk41wY7B7LmYR0AFNJdprmMVndXCA%40mail.gmail.com.

Robert Dale

unread,
Feb 9, 2018, 10:01:10 AM2/9/18
to gremli...@googlegroups.com
I checked that both TinkerPop 3.3.0 with Neo4j 2.3.3 and TinkerPop 3.3.1 with Neo4j 3.2.3 work with the configurations provided.  I'm not a Neo4j HA expert but killing and rejoining appeared to work for me.  Check your neo4j logs to see if anything is amiss there.

Robert Dale

Harsh

To unsubscribe from this group and all its topics, send an email to gremlin-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.

Harshvardhan Joshi

unread,
Feb 10, 2018, 1:39:24 AM2/10/18
to gremli...@googlegroups.com
Thanks Robert. I got it running.

Harshvardhan Joshi

unread,
Feb 14, 2018, 1:02:51 AM2/14/18
to gremli...@googlegroups.com
Hey Robert,

Would you mind sharing the your configuration files.
The gremlin server and Neo4J properties file.

I’m running into another issue and just wanted to check if it’s the same as yours.

Thank you,
Harsh

To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CABed_4qLjx-Sk2Dn%2BvohHrh8UZumDUs2zdHXJZKt1z30jkP70A%40mail.gmail.com.

Robert Dale

unread,
Feb 15, 2018, 7:38:02 PM2/15/18
to gremli...@googlegroups.com
I just used a clean download and the properties configurations from the docs - http://tinkerpop.apache.org/docs/3.3.0/reference/#_high_availability_configuration

Robert Dale

Harsh

To unsubscribe from this group and all its topics, send an email to gremlin-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages