2.2.3. Neo4j system service

This article covers configuring and operating the Neo4j system service. It assumes that your system has systemd, which is the case for most Linux distributions.

2.2.3.1. Configuration

Configuration is stored in /etc/neo4j/neo4j.conf. See Section 3.1, “File locations” for a complete catalog of where files are found for the various packages.

2.2.3.2. Starting the service automatically on system start

If you installed the RPM package and want Neo4j to start automatically on system boot then you need to enable the service. On Debian-based distributions this is done for you at installation time.

systemctl enable neo4j

2.2.3.3. Controlling the service

System services are controlled with the systemctl command. It accepts a number of commands:

systemctl {start|stop|restart} neo4j

Service customizations can be placed in a service override file. To edit your specific options, do the following command which will open up an editor of the appropriate file:

systemctl edit neo4j

Then place any customizations under a [Service] section. The following example lists default values which may be interesting to change for some users:

[Service]
# The user and group which the service runs as.
User=neo4j
Group=neo4j
# If it takes longer than this then the shutdown is considered to have failed.
# This may need to be increased if the system serves long-running transactions.
TimeoutSec=120

You can print the effective service, including possible overrides, with:

systemctl cat neo4j

Remember to restart neo4j if you change any settings.

systemctl restart neo4j

2.2.3.4. Log

The neo4j log is written to journald which can be viewed using the journalctl command:

journalctl -e -u neo4j

journald automatically rotates the log after a certain time and by default it commonly does not persist across reboots. Please see man journald.conf for further details.