Setting up Neo4j Enterprise Edition Mac - 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 4.4.40

Last Update: 2024/12/27 - Neo4j 4.4.40

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

One - Location Location Location

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 /Users/youruser folder is perfect.

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

Do verify the sizes match up ...

<machine>:neo4j <user>$ ls -l scripts/
...  484 ... download.sh
...  189 ... environment.sh
...  215 ... move.sh
... 2222 ... settings.sh
...  228 ... unpack.sh
...  113 ... 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/zulu11.76.21-ca-jre11.0.25-macosx_x64.zip
Neo4j Enterprise Server install/neo4j-enterprise-4.4.40-unix.tar.gz
GDS library install/neo4j-graph-data-science-2.6.8.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/
...  245946456 ... neo4j-enterprise-4.4.40-unix.tar.gz
...   51829203 ... neo4j-graph-data-science-2.6.8.zip
...   40015523 ... zulu11.76.21-ca-jre11.0.25-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/zulu11.76.21-ca-jre11.0.25-macosx_x64.zip
+ tar -xzf install/neo4j-enterprise-4.4.40-unix.tar.gz
+ unzip -q install/neo4j-graph-data-science-2.6.8.zip -d install

<machine>:neo4j <user>$ ls -l
... install
... neo4j-enterprise-4.4.40
... scripts
... zulu11.76.21-ca-jre11.0.25-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 neo4j-enterprise-4.4.40/labs/apoc-4.4.0.34-core.jar neo4j-enterprise-4.4.40/plugins
+ mv install/neo4j-graph-data-science-2.6.8.jar neo4j-enterprise-4.4.40/plugins

And verify that things match up ...

<machine>:neo4j <user>$ ls -l neo4j-enterprise-4.4.40/plugins/
...      2217 ... README.txt
...  16748882 ... apoc-4.4.0.34-core.jar
...  58520104 ... neo4j-graph-data-science-2.6.8.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 morpheus. Alternatively you can also modify the neo4j.conf and apoc.conf files manually, the statement shows all the changes you need to make.

<machine>:neo4j <user>$ sh -x scripts/settings.sh
Selecting JVM - Version:11.0.25+9-LTS, Name:OpenJDK 64-Bit Server VM, Vendor:Azul Systems, Inc.
Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time.

<machine>:neo4j <user>$ tail -n 18 neo4j-enterprise-4.4.40/conf/neo4j.conf
metrics.enabled=true
metrics.namespaces.enabled=true
metrics.filter=*
metrics.csv.enabled=false
metrics.prometheus.enabled=false
metrics.graphite.enabled=false
metrics.jmx.enabled=true
dbms.security.procedures.unrestricted=apoc.*,gds.*
dbms.default_listen_address=0.0.0.0
dbms.logs.query.enabled=off
dbms.memory.heap.initial_size=2g
dbms.memory.heap.max_size=2g
dbms.memory.pagecache.size=1g
dbms.memory.transaction.global_max_size=2000m
dbms.tx_log.rotation.retention_policy=1G size
dbms.db.timezone=SYSTEM
dbms.logs.user.stdout_enabled=false
browser.remote_content_hostname_whitelist=*

<machine>:neo4j <user>$ cat neo4j-enterprise-4.4.40/conf/apoc.conf 
apoc.export.file.enabled=true
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=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 Terminal app unless you want to bring down the database). An important thing here is that you need to have the correct (11 for Neo4j 4.x.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/zulu11.76.21-ca-jre11.0.25-macosx_x64
<machine>:neo4j <user>$ neo4j-enterprise-4.4.40/bin/neo4j console
Directories in use:
home:         <yourlocation>/neo4j/neo4j-enterprise-4.4.40
config:       <yourlocation>/neo4j/neo4j-enterprise-4.4.40/conf
logs:         <yourlocation>/neo4j/neo4j-enterprise-4.4.40/logs
plugins:      <yourlocation>/neo4j/neo4j-enterprise-4.4.40/plugins
import:       <yourlocation>/neo4j/neo4j-enterprise-4.4.40/import
data:         <yourlocation>/neo4j/neo4j-enterprise-4.4.40/data
certificates: <yourlocation>/neo4j/neo4j-enterprise-4.4.40/certificates
licenses:     <yourlocation>/neo4j/neo4j-enterprise-4.4.40/licenses
run:          <yourlocation>/neo4j/neo4j-enterprise-4.4.40/run
Starting Neo4j.
2024-12-27 08:49:25.998+0100 INFO  Starting...
2024-12-27 08:49:26.457+0100 INFO  This instance is ServerId{xxxxxxxx} (xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb)
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J(W): Ignoring binding found at [jar:file:<yourlocation>/neo4j/neo4j-enterprise-4.4.40/lib/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J(W): See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
2024-12-27 08:49:28.133+0100 INFO  ======== Neo4j 4.4.40 ========
2024-12-27 08:49:28.182+0100 INFO  Progress tracking: enabled
2024-12-27 08:49:28.183+0100 INFO  Memory usage guard: minimum estimate
2024-12-27 08:49:28.189+0100 INFO  GDS license file: null
2024-12-27 08:49:28.190+0100 INFO  GDS license state: unlicensed
2024-12-27 08:49:28.198+0100 INFO  Register GraphDataScience...
2024-12-27 08:49:28.223+0100 INFO  GraphDataScience registered.
2024-12-27 08:49:28.224+0100 INFO  Register GraphDataScienceExtras...
2024-12-27 08:49:28.224+0100 INFO  GraphDataScienceExtras registered.
2024-12-27 08:49:28.224+0100 INFO  Register MetricsFacade...
2024-12-27 08:49:28.225+0100 INFO  MetricsFacade registered.
2024-12-27 08:49:28.225+0100 INFO  Register legacy Task Store/ Registry...
2024-12-27 08:49:28.225+0100 INFO  Task Store/ Registry registered.
2024-12-27 08:49:28.225+0100 INFO  Register legacy User Log Registry...
2024-12-27 08:49:28.226+0100 INFO  User Log Registry registered.
2024-12-27 08:49:28.625+0100 INFO  GDS compatibility: for Neo4j Settings 5.x (placeholder) -- not available, for Neo4j Settings 4.4 -- available, selected: Neo4j Settings 4.4
2024-12-27 08:49:28.625+0100 INFO  GDS compatibility: for Neo4j 4.4 -- available, for Neo4j 5.11 (placeholder) -- not available, for Neo4j 5.12 (placeholder) -- not available, for Neo4j 5.13 (placeholder) -- not available, for Neo4j 5.14 (placeholder) -- not available, for Neo4j 5.15 (placeholder) -- not available, for Neo4j 5.16 (placeholder) -- not available, for Neo4j 5.17 (placeholder) -- not available, for Neo4j RC (placeholder) -- not available, for Neo4j 5.19 (placeholder) -- not available, for Neo4j 5.20 (placeholder) -- not available, selected: Neo4j 4.4
2024-12-27 08:49:46.675+0100 INFO  Bolt enabled on [0:0:0:0:0:0:0:0]:7687.
2024-12-27 08:49:47.771+0100 INFO  Remote interface available at http://localhost:7474/
2024-12-27 08:49:47.775+0100 INFO  id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2024-12-27 08:49:47.775+0100 INFO  name: system
2024-12-27 08:49:47.775+0100 INFO  creationDate: 2024-12-27T08:49:29.226+01:00
2024-12-27 08:49:47.775+0100 INFO  Started.

The SLF4J(W) is a known warning that can be ignored.

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