Note
|
Most of the monitoring features are only available in the Enterprise edition of Neo4j. |
In order to be able to continuously get an overview of the health of a Neo4j database, there are different levels of monitoring facilities available. Most of these are exposed through JMX. Neo4j Enterprise also has the ability to automatically report metrics to commonly used monitoring systems, like Graphite.
Per default, the Neo4j Enterprise Server edition does not allow remote JMX connections, since the relevant options in the conf/neo4j-wrapper.conf configuration file are commented out.
To enable this feature, you have to remove the #
characters from the various com.sun.management.jmxremote
options there.
When commented in, the default values are set up to allow remote JMX connections with certain roles, refer to the conf/jmx.password, conf/jmx.access and conf/neo4j-wrapper.conf files for details.
Make sure that conf/jmx.password has the correct file permissions.
The owner of the file has to be the user that will run the service, and the permissions should be read only for that user.
On Unix systems, this is 0600
.
On Windows, follow the tutorial at http://docs.oracle.com/javase/7/docs/technotes/guides/management/security-windows.html to set the correct permissions. If you are running the service under the Local System Account, the user that owns the file and has access to it should be SYSTEM.
With this setup, you should be able to connect to JMX monitoring of the Neo4j server using <IP-OF-SERVER>:3637
, with the username monitor
and the password Neo4j
.
Note that it is possible that you have to update the permissions and/or ownership of the conf/jmx.password and conf/jmx.access files — refer to the relevant section in conf/neo4j-wrapper.conf for details.
Warning
|
For maximum security, please adjust at least the password settings in conf/jmx.password for a production installation. |
For more details, see: http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html.
First, start your embedded database or the Neo4j Server, for instance using
$NEO4j_HOME/bin/neo4j start
Now, start JConsole with
$JAVA_HOME/bin/jconsole
Connect to the process running your Neo4j database instance:
Now, beside the MBeans exposed by the JVM, you will see an org.neo4j
section in the MBeans tab.
Under that, you will have access to all the monitoring information exposed by Neo4j.
For opening JMX to remote monitoring access, please see Adjusting remote JMX access to the Neo4j Server and the JMX documention.
When using Neo4j in embedded mode, make sure to pass the com.sun.management.jmxremote.port=portNum
or other configuration as JVM parameters to your running Java process.
In order to programmatically connect to the Neo4j JMX server, there are some convenience methods in the Neo4j Management component to help you find out the most commonly used monitoring attributes of Neo4j. See [tutorials-java-embedded-jmx] for an example.
Once you have access to this information, you can use it to for instance expose the values to SNMP or other monitoring systems.