Setting up Neo4j Enterprise Edition Linux retro - tomgeudens/practical-neo4j GitHub Wiki
Disclaimer: This document aims at getting a Neo4j database up-and-running in the context of a training or experiment. It is not fit for production installation purposes. It also assumes a single user developer installation and is in that respect similar to a Neo4j Desktop installation (which also provides the Enterprise Edition). For that purpose the Neo4j Enterprise Edition software requires no further licensing. For any other purpose ... it does !
Version: this document is current for version 3.5.35
Last Update: 2023/09/23 - Update for Neo4j Server 3.5.35, jre 8.0.283, GDS 1.1.7
This document will assume everything (software, installation, database) is going to happen in a single neo4j folder (which is created below). This folder must reside in a location that is writable for the user with which you are logged on. No elevated rights will be needed (and try to avoid using root). The /home/ folder is perfect.
<user>@<machine>:~$
<user>@<machine>:~$ mkdir neo4j
<user>@<machine>:~$ mkdir neo4j/scripts
<user>@<machine>:~$ cd neo4j
<user>@<machine>:~/neo4j$
Everything that follows will assume that you are positioned in the neo4j folder !
Now, five scripts need to be put in the scripts folder. You can download these from here :
<user>@<machine>:~/neo4j$ wget -O "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/version.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/download.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/unpack.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/move.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/settings.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/environment.sh
Do verify the sizes match up ...
<user>@<machine>:~/neo4j$ ls -l scripts/
... 913 ... download.sh
... 188 ... environment.sh
... 307 ... move.sh
... 1206 ... settings.sh
... 241 ... unpack.sh
... 144 ... version.sh
In this step a subfolder install will be created and the following softwares will be put into it :
What | Location |
---|---|
Java JRE | install/zulu8.72.0.17-ca-jre8.0.283-linux_x64.tar.gz |
Neo4j Enterprise Server | install/neo4j-enterprise-3.5.35-unix.tar.gz |
APOC library | install/apoc-3.5.0.17-all.jar |
APOC MongoDB dependencies | install/apoc-mongodb-dependencies-3.5.0.17.jar |
GDS library | install/neo4j-graph-data-science-1.1.7-standalone.zip |
The instructions below will use a simple script to accomplish this. Note that this is one of the scripts you downloaded earlier.
<user>@<machine>:~/neo4j$ sh -x scripts/download.sh
<user>@<machine>:~/neo4j$ ls -l install/
... 16066055 ... apoc-3.5.0.17-all.jar
... 1483697 ... apoc-mongodb-dependencies-3.5.0.17.jar
... 172839221 ... neo4j-enterprise-3.5.35-unix.tar.gz
... 4547144 ... neo4j-graph-data-science-1.1.7-standalone.zip
... 42190509 ... zulu8.72.0.17-ca-jre8.0.283-linux_x64.tar.gz
Do check that the sizes match with yours !
In this step both the java and and the neo4j softwares are unpacked. As in the previous step a small script (that you downloaded earlier) will be used to do that.
<user>@<machine>:~/neo4j$ sh -x scripts/unpack.sh
+ tar -xzf install/zulu8.72.0.17-ca-jre8.0.283-linux_x64.tar.gz
+ tar -xzf install/neo4j-enterprise-3.5.35-unix.tar.gz
+ unzip -q install/neo4j-graph-data-science-1.1.7-standalone.zip -d install
<user>@<machine>:~/neo4j$ ls -l
... install
... neo4j-enterprise-3.5.35
... scripts
... zulu8.72.0.17-ca-jre8.0.283-linux_x64
With all the plugins now in jar form, it's time to move them into the plugins folder.
<user>@<machine>:~/neo4j$ sh -x scripts/move.sh
+ mv install/apoc-3.5.0.17-all.jar neo4j-enterprise-3.5.35/plugins
+ mv install/apoc-mongodb-dependencies-3.5.0.17.jar neo4j-enterprise-3.5.35/plugins
+ mv install/neo4j-graph-data-science-1.1.7-standalone.jar neo4j-enterprise-3.5.35/plugins
And verify that things match up ...
<user>@<machine>:~/neo4j$ ls -l neo4j-enterprise-3.5.35/plugins/
... 16066055 ... apoc-3.5.0.17-all.jar
... 1483697 ... apoc-mongodb-dependencies-3.5.0.17.jar
... 5021124 ... neo4j-graph-data-science-1.1.7-standalone.jar
... 2207 ... README.txt
With that done, it’s time for some basic customization ...
Most of the default settings of Neo4j are fine for the purposes of a training or experimentation, but not all. The script below (that you downloaded earlier) fixes what needs fixing and also sets the initial password for the database to trinity. Alternatively you can also modify the neo4j.conf file manually, the statement shows all the changes you need to make.
<user>@<machine>:~/neo4j$ sh -x scripts/settings.sh
WARNING: Max 1024 open files allowed, minimum of 40000 recommended. See the Neo4j manual.
Changed password for user 'neo4j'.
<user>@<machine>:~/neo4j$ cat neo4j-enterprise-3.5.35/conf/neo4j.conf | tail -n 10
metrics.enabled=false
dbms.security.procedures.unrestricted=apoc.*,gds.*
dbms.connectors.default_listen_address=0.0.0.0
dbms.memory.heap.initial_size=1024m
dbms.memory.heap.max_size=1024m
dbms.memory.pagecache.size=1g
dbms.udc.enabled=false
dbms.tx_log.rotation.retention_policy=1G size
apoc.import.file.enabled=true
apoc.export.file.enabled=true
You can safely ignore that WARNING (if you get it) for now. That does matter for production, it doesn’t matter here.
Ready to start now ...
We are going to be running the database in console mode. That means that the command we are going to issue will continue running in the foreground (so do not close the shell unless you want to bring down the database). An important thing here is that you need to have the correct (8 for Neo4j 3.5.x) Java environment. And the final script you downloaded earlier does just that ...
<user>@<machine>:~/neo4j$ . ./scripts/environment.sh
<user>@<machine>:~/neo4j$ echo $JAVA_HOME
<yourlocation>/neo4j/zulu8.72.0.17-ca-jre8.0.283-linux_x64
<user>@<machine>:~/neo4j$ neo4j-enterprise-3.5.35/bin/neo4j console
Starting Neo4j.
2023-09-23 07:18:02.254+0000 INFO ======== Neo4j 3.5.35 ========
2023-09-23 07:18:02.263+0000 INFO Starting...
2023-09-23 07:18:03.379+0000 INFO Initiating metrics...
2023-09-23 07:18:03.379+0000 WARN Exporting tool have been configured to report values to but no metrics were enabled. Disabling kernel metrics extension.
2023-09-23 07:18:13.719+0000 INFO Bolt enabled on 0.0.0.0:7687.
2023-09-23 07:18:15.571+0000 INFO Started.
2023-09-23 07:18:15.691+0000 INFO Mounted REST API at: /db/manage
2023-09-23 07:18:16.849+0000 INFO Remote interface available at http://localhost:7474/
As before, you can safely ignore the open files warning in this setting (don't ignore it in production though).
Enjoy!
The observation has been made that it can be hard to correctly cut-and-paste the commands from in between the output and the explanation. Below you'll therefore find just the necessary commands.
Setup
The assumption is that you have positioned yourself in the location where the self-contained setup needs to go
mkdir neo4j
mkdir neo4j/scripts
cd neo4j
wget -O "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/version.sh
wget -O "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/download.sh
wget -O "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/unpack.sh
wget -O "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/move.sh
wget -O "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/settings.sh
wget -O "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/linux/environment.sh
Installation
The assumption is that you have positioned yourself in the neo4j folder (created in Setup)
sh -x scripts/download.sh
sh -x scripts/unpack.sh
sh -x scripts/move.sh
sh -x scripts/settings.sh
Running
Whereas Setup and Installation are only executed once, this one is repeated every time you want to start the database. The assumption is that you have positioned yourself in the neo4j folder (created in Setup)
. ./scripts/environment.sh
neo4j-enterprise-3.5.35/bin/neo4j console