In this post we will be covering how to shutdown neo4j service gracefully under different versions of neo4j.

Version 1.x

In version 1.x the Neo4j Console hosted the gremlin shell that allowed us to issue the command for a graceful shutdown.

g.getRawGraph().shutdown()

Version 2.0 – 2.2.x

With the version 2.0 release, the team revamped the Neo4J Console and removed the gremlin console. By doing that they also made it difficult to shutdown Neo4j gracefully. If you were like me, struggling to figure out how to shut it down properly, please follow the workaround I was given by Michael Hunger from the Neo4j team.

Kill the Neo4j process that is currently running and then host the database using Neo4JShell.bat, which can be found in the bin folder, and shut it down gracefully by typing in “quit”.

 Version 2.3.x

The Neo4j team added new PowerShell commands to perform common Neo4j Server tasks as part of v2.3 release, which includes starting and stopping the server properly. They just made our lives easier.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s