Configuring Neo4j-Provided Cloud Instances

configuration
knowledge-base

(M. David Allen) #1

In Neo4j's documentation, you'll find a lot of references to configuring instances via neo4j.conf. In cloud instances, this works similarly, with a few exceptions. In cloud instances, as you start/stop VMs, instance IP addresses and other things can change. Also, it can be useful to manage instances from the outside with "tags" on the VM rather than shelling into the machine itself. This mini-article describes how configuration of those cloud instances works.

Templates

Essentially, the normal neo4j.conf file is used to configure the neo4j service inside of the VM, but when running in neo4j-provided cloud VMs, this is driven by a template file you’ll find at /etc/neo4j/neo4j.template .

That template contains certain variables, for example:

dbms.logs.http.enabled=$dbms_logs_http_enabled

The template contains other substitutions as well, so for example the VM can detect its own public IP address and then use that as the advertised address for client connections. As the VM is stopped/restarted and may get a fresh dynamic IP, the configuration will keep pace when neo4j restarts.

Due to this template, you can set a custom metadata item on the instance with the key dbms_logs_http_enabled and its value will be substituted into neo4j.conf when the service starts. Being able to set configuration items from outside of neo4j.conf is very convenient when you start integrating neo4j together with other components.

Within these cloud images, do not directly edit /etc/neo4j/neo4j.conf , because it will be replaced by template substitutions each time the service starts. Instead, edit the template to suit your needs.

If you customize metadata on the VM to configure neo4j, please remember you’ll need to restart the neo4j system service, or restart the VM for those changes to take effect.

Troubleshooting

A common problem users might run into is making changes directly to neo4j.conf and finding that the sever does not respect their configuration changes. This is due to the point above, that the actual /etc/neo4j/neo4j.conf is over-written each time the service starts, in order to provide for those substitutions. Make sure you edit the template file directly. All other guidance is exactly the same as you would use with any neo4j.conf file.


Configuring AWS EC2 Marketplace AMIs credentials