Setting up Neo4j Enterprise Edition Mac 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: 2024/07/29 - Update for Neo4j Server 3.5.35, jre 8.0.283, GDS 1.1.7

Important : All of the below is executed in the Terminal app !

One - Location Location Location

<machine>:~ <user>$
<machine>:~ <user>$ mkdir neo4j
<machine>:~ <user>$ mkdir neo4j/scripts
<machine>:~ <user>$ cd neo4j
<machine>:neo4j <user>$

Everything that follows will assume that you are positioned in the neo4j folder !

Now, six scripts need to be put in the scripts folder. You can download these from here :

<machine>:neo4j <user>$ curl -o "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/version.sh
<machine>:neo4j <user>$ curl -o "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/download.sh
<machine>:neo4j <user>$ curl -o "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/unpack.sh
<machine>:neo4j <user>$ curl -o "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/move.sh
<machine>:neo4j <user>$ curl -o "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/settings.sh
<machine>:neo4j <user>$ curl -o "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/environment.sh

Do verify the sizes match up ...

<machine>:neo4j <user>$ ls -l scripts/
...  924 ... download.sh
...  189 ... environment.sh
...  307 ... move.sh
... 1207 ... settings.sh
...  239 ... unpack.sh
...  144 ... version.sh

Two - Downloading the softwares

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.382-macosx_x64.zip
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.

<machine>:neo4j <user>$ sh -x scripts/download.sh
<machine>:neo4j <user>$ 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
...  41434533 ... zulu8.72.0.17-ca-jre8.0.382-macosx_x64.zip

Do check that the sizes match with yours !

Three - Unpacking the softwares

In this step, everything that is compressed will be unpacked. Typically that's the Neo4j software, the Java software and the Graph Data Science zip.

<machine>:neo4j <user>$ sh -x scripts/unpack.sh
+ unzip -q install/zulu8.72.0.17-ca-jre8.0.382-macosx_x64.zip
+ 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

<machine>:neo4j <user>$ ls -l
... install
... neo4j-enterprise-3.5.35
... scripts
... zulu8.72.0.17-ca-jre8.0.382-macosx_x64

Four - Move plugins in place

With all the plugins now in jar form, it's time to move them into the plugins folder.

<machine>:neo4j <user>$ 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 ...

<machine>:neo4j <user>$ ls -l neo4j-enterprise-3.5.35/plugins
...      2207 ... README.txt
...  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

With that done, it’s time for some basic customization ...

Five - Settings

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.

<machine>:neo4j <user>$ sh -x scripts/settings.sh
Changed password for user 'neo4j'.

<machine>:neo4j <user>$ 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

Ready to start now ...

Six - Starting

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 ...

<machine>:neo4j <user>$ . ./scripts/environment.sh
<machine>:neo4j <user>$ echo $JAVA_HOME
<yourlocation>/neo4j/zulu8.72.0.17-ca-jre8.0.382-macosx_x64
<machine>:neo4j <user>$ neo4j-enterprise-3.5.35/bin/neo4j console
Starting Neo4j.
2024-07-29 18:29:09.952+0000 INFO  ======== Neo4j 3.5.35 ========
2024-07-29 18:29:09.964+0000 INFO  Starting...
2024-07-29 18:29:11.570+0000 INFO  Initiating metrics...
2024-07-29 18:29:11.571+0000 WARN  Exporting tool have been configured to report values to but no metrics were enabled. Disabling kernel metrics extension.
2024-07-29 18:29:19.806+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2024-07-29 18:29:21.450+0000 INFO  Started.
2024-07-29 18:29:21.550+0000 INFO  Mounted REST API at: /db/manage
2024-07-29 18:29:22.308+0000 INFO  Remote interface available at http://localhost:7474/

Enjoy!

Appendix - Just the commands

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
curl -o "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/version.sh
curl -o "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/download.sh
curl -o "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/unpack.sh
curl -o "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/move.sh
curl -o "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/settings.sh
curl -o "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/mac/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
⚠️ **GitHub.com Fallback** ⚠️