Configuring a single Neo4j database

Before continuing, we advise you to read chapter 4 "Configuration" of the pdf documentation (or online ). In this part, we will give the configuration elements to properly set up a single Neo4j server for use by SECollab.


Before starting

It is necessary to shut down the Neo4j database before making modifications. Depending on the type of installation, you must execute the command:

Main settings

Before continuing, we advise you to read chapter 4 "Configuration" of the pdf documentation (or online ). In the rest of this section, we will give the configuration elements to correctly configure a single Neo4j server for use by SECollab.

Minimum configuration

The following parameters must be modified or added (if they do not exist) in the Neo4j configuration file neo4j.conf.

# Recommended settings for 32GB memory
dbms.memory.heap.initial_size=12g
dbms.memory.heap.max_size=12g
dbms.memory.pagecache.size=12g

# Default connector settings
dbms.default_listen_address=0.0.0.0
dbms.connectors.default_advertised_address=SERVER-IP-OR-HOSTNAME
	
# Bolt connector
dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=REQUIRED

# Bolt SSL configuration
dbms.ssl.policy.bolt.enabled=true

# Disable http/https connectors
dbms.connector.http.enabled=false
dbms.connector.https.enabled=false

Some explanations :

Activation of other connectors (optional)

If you wish, you can enable an HTTP (S) connector to access a simplified web interface for querying and managing the Neo4j database. As a safety precaution, we only recommend using the HTTPS connector and for local use only. An example of setting is:

# HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=true
dbms.connector.http.listen_address=127.0.0.1:7473
dbms.connector.http.advertised_address=localhost:7473

# Https SSL configuration
dbms.ssl.policy.https.enabled=true
dbms.ssl.policy.https.base_directory=/var/lib/neo4j/https/certificates
dbms.ssl.policy.https.private_key=neo4j.key
dbms.ssl.policy.https.public_certificate=neo4j.crt

With these settings, from the Neo4j server, you can access a web interface at the address https://localhost:7473.

For more details, see section 4.7 of the pdf documentation (or online).

Changing the resource path (optional)

You can easily change the storage location of some Neo4j resources.

# Paths of directories in the installation.
dbms.directories.data=/var/lib/neo4j/data
dbms.directories.plugins=/var/lib/neo4j/plugins
dbms.ssl.policy.bolt.base_directory=/var/lib/neo4j/bolt/certificates
dbms.ssl.policy.https.base_directory=/var/lib/neo4j/https/certificates
dbms.directories.logs=/var/log/neo4j

Memory settings

For a demonstrator (POC, pre-production) SECollab, 8GB of RAM are sufficient. In this case and using the Neo4j tool NEO4J_HOME/neo4j-admin memrec --memory=8g , the recommended configuration is as follows:

administrator@neo4j-single:~$ neo4j-admin memrec --memory=8g
# Memory settings recommendation from neo4j-admin memrec:
..
# Based on the above, the following memory settings are recommended:
dbms.memory.heap.initial_size=3600m
dbms.memory.heap.max_size=3600m
dbms.memory.pagecache.size=2g

For more information, please refer to the pdf documentation, sections 11.1 (or online) and 12.5 (or online).

Log slow queries

To analyze performance issues, we recommend enabling the query log. For more details, see section 10.2.1 of the pdf documentation (or online).

Example to log queries taking more than 15 seconds to execute:

# Enable query logging
dbms.logs.query.enabled=INFO
dbms.logs.query.threshold=15s

# Dump maximal details about that slowy query
dbms.logs.query.parameter_logging_enabled=true
dbms.logs.query.time_logging_enabled=true
dbms.logs.query.allocation_logging_enabled=true
dbms.logs.query.page_logging_enabled=true

Upgrading a 3.5.x database to a 4.4.x

An upgrade is mandatory in order to use Neo4j 4.4.x, otherwise the database won't start. The following configuration is added into the configuration file NEO4J_HOME/conf/neo4j.conf:
# Enable this to be able to upgrade a store from an older version.
dbms.allow_upgrade=true
    

Make sure your have properly created a backup of your database and before upgrading your 3.5.x database. That means creating a copy of the directory configured with dbms.directories.data.

For further informations, refer to the official documentation:

Configuration reference

A complete and detailed reference of the configuration file can be found in Appendix A.1 of the pdf documentation (or online).

Apply the changes

To apply the changes made to the configuration file, restart the Neo4j database. Depending on the type of installation, you must execute the command: