An unmanaged extension for the REST server for Neo4j that provides master information in HA clusters
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a simple unmanaged plugin for Neo4j REST server, which provides endpoints for asking an instance if it is the current HA master and which is the current HA master.

Obviously this extension is not useful in a non-HA setting.

To use this, issue

mvn package

in the top level directory and then get the jar from target/ . You can drop that into your server's plugins/ directory and add a line in that reads like

When you restart you should be able to do a

curl http://<server>:<port>/ha-info/masterinfo/{isMaster,getMaster}

and get a true/false for the first one and the <server>:<ha-port> for the second.

In addition, when true is returned, the response status is set to 200 OK. When a slave responds the response content is "false" and the response status is 303 SEE OTHER, with a Location header set to the value of the actual master's HA URI. This allows usage of this plugin as alive check in Amazon ELB.  

Note that getMaster returns not the REST port (default of 7474) but the HA port (default 6001). You will have to manipulate the string if you need different information, such as only the host.