Setting up Neo4j Enterprise Edition Mac Five - 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 5.26.1
Last Update: 2025/01/17 - Neo4j 5.26.1 - THIS DOCUMENT IS CURRENTLY FROZEN (UNTIL I HAVE ACCESS TO A MAC AGAIN)
Important : All of the below is executed in the Terminal app !
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/fiveohandbeyond/mac/version.sh
<machine>:neo4j <user>$ curl -o "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/download.sh
<machine>:neo4j <user>$ curl -o "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/unpack.sh
<machine>:neo4j <user>$ curl -o "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/move.sh
<machine>:neo4j <user>$ curl -o "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/settings.sh
<machine>:neo4j <user>$ curl -o "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/environment.sh
Do verify the sizes match up ...
<machine>:neo4j <user>$ ls -l scripts/
... 592 ... download.sh
... 233 ... environment.sh
... 215 ... move.sh
... 3118 ... settings.sh
... 246 ... unpack.sh
... 198 ... 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/OpenJDK17U-jre_x64_mac_hotspot_17.0.13_11.tar.gz |
Neo4j Enterprise Server | install/neo4j-enterprise-5.26.1-unix.tar.gz |
GDS library | install/neo4j-graph-data-science-2.13.2.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/
... 37474201 ... OpenJDK17U-jre_x64_mac_hotspot_17.0.13_11.tar.gz
... 446056796 ... neo4j-enterprise-5.26.1-unix.tar.gz
... 56479054 ... neo4j-graph-data-science-2.13.2.zip
Do check that the sizes match with yours !
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
+ tar -xzf install/OpenJDK17U-jre_x64_mac_hotspot_17.0.13_11.tar.gz
+ tar -xzf install/neo4j-enterprise-5.26.1-unix.tar.gz
+ unzip -q install/neo4j-graph-data-science-2.13.2.zip -d install
<machine>:neo4j <user>$ ls -l
... install
... jdk-17.0.13+11-jre
... neo4j-enterprise-5.26.1
... scripts
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-5.26.1/labs/apoc-5.26.1-core.jar neo4j-enterprise-5.26.1/plugins
+ mv install/neo4j-graph-data-science-2.13.2.jar neo4j-enterprise-5.26.1/plugins
And verify that things match up ...
<machine>:neo4j <user>$ ls -l neo4j-enterprise-5.26.1/plugins/
... 2217 ... README.txt
... 2962631 ... apoc-5.26.1-core.jar
... 63936757 ... neo4j-graph-data-science-2.13.2.jar
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 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
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 25 neo4j-enterprise-5.26.1/conf/neo4j.conf
# Custom - Generic
server.config.strict_validation.enabled=false
# Custom - Metrics
server.metrics.enabled=true
server.metrics.filter=*
server.metrics.csv.enabled=false
server.metrics.prometheus.enabled=false
server.metrics.graphite.enabled=false
server.metrics.jmx.enabled=true
# Custom - Query Log
db.logs.query.enabled=OFF
# Custom - Miscellaneous
dbms.db.timezone=SYSTEM
dbms.security.procedures.unrestricted=apoc*,gds*
browser.remote_content_hostname_whitelist=*
# Custom - Memory
server.memory.heap.initial_size=2g
server.memory.heap.max_size=2g
server.memory.pagecache.size=1g
dbms.memory.transaction.total.max=2000m
db.memory.transaction.max=1g
# Custom - Network Settings
server.default_listen_address=0.0.0.0
# no usage data collection please
dbms.usage_report.enabled=false
<machine>:neo4j <user>$ cat neo4j-enterprise-5.26.1/conf/apoc.conf
apoc.export.file.enabled=true
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=true
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 Terminal app unless you want to bring down the database). An important thing here is that you need to have the correct (17 for Neo4j 5.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/jdk-17.0.13+11-jre/Contents/Home
<machine>:neo4j <user>$ neo4j-enterprise-5.26.1/bin/neo4j console
Directories in use:
home: <yourlocation>/neo4j/neo4j-enterprise-5.26.1
config: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/conf
logs: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/logs
plugins: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/plugins
import: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/import
data: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/data
certificates: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/certificates
licenses: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/licenses
run: <yourlocation>/neo4j/neo4j-enterprise-5.26.1/run
Starting Neo4j.
2025-01-17 06:13:32.477+0000 INFO Logging config in use: File '<yourlocation>/neo4j/neo4j-enterprise-5.26.1/conf/user-logs.xml'
2025-01-17 06:13:32.494+0000 INFO The license agreement was accepted with environment variable NEO4J_ACCEPT_LICENSE_AGREEMENT=yes when the Software was started.
2025-01-17 06:13:32.525+0000 INFO Starting...
2025-01-17 06:13:35.506+0000 INFO ======== Neo4j 5.26.1 ========
2025-01-17 06:13:35.535+0000 INFO This instance is ServerId{xxxxxxxx} (xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb)
2025-01-17 06:13:35.574+0000 INFO GDS license file: null
2025-01-17 06:13:35.574+0000 INFO GDS license state: unlicensed
2025-01-17 06:13:35.576+0000 INFO Prometheus: disabled
2025-01-17 06:13:35.577+0000 WARN GDS metrics disabled
2025-01-17 06:13:35.583+0000 INFO Progress tracking: enabled
2025-01-17 06:13:35.584+0000 INFO Memory usage guard: minimum estimate
2025-01-17 06:13:35.588+0000 INFO Register GDS Memory Facade...
2025-01-17 06:13:35.589+0000 INFO GDS Memory Facade registered.
2025-01-17 06:13:35.613+0000 INFO Building Graph Data Science extension...
2025-01-17 06:13:35.618+0000 INFO Register Graph Data Science...
2025-01-17 06:13:35.618+0000 INFO Graph Data Science registered.
2025-01-17 06:13:35.619+0000 INFO Register Metrics...
2025-01-17 06:13:35.619+0000 INFO Metrics registered.
2025-01-17 06:13:35.620+0000 INFO Register Model Catalog...
2025-01-17 06:13:35.620+0000 INFO Model Catalog registered.
2025-01-17 06:13:35.621+0000 INFO Register Task Registry Factory...
2025-01-17 06:13:35.621+0000 INFO Task Registry Factory registered.
2025-01-17 06:13:35.622+0000 INFO Register Task Store...
2025-01-17 06:13:35.623+0000 INFO Task Store registered.
2025-01-17 06:13:35.623+0000 INFO Register User Log Registry Factory...
2025-01-17 06:13:35.624+0000 INFO User Log Registry Factory registered.
2025-01-17 06:13:35.624+0000 INFO Graph Data Science extension built.
2025-01-17 06:13:35.624+0000 INFO Building Graph Data Science Extras extension...
2025-01-17 06:13:35.625+0000 INFO Register Graph Data Science Extras...
2025-01-17 06:13:35.626+0000 INFO Graph Data Science Extras registered.
2025-01-17 06:13:35.626+0000 INFO Graph Data Science Extras extension built.
2025-01-17 06:13:36.091+0000 INFO Resolved endpoints with LIST{endpoints:'[localhost:5000]'} to '[localhost:5000]'
2025-01-17 06:13:37.220+0000 INFO Resolved endpoints with LIST{endpoints:'[localhost:5000]'} to '[localhost:5000]'
2025-01-17 06:13:39.289+0000 INFO Default database 'neo4j' is created
2025-01-17 06:13:53.698+0000 INFO Bolt enabled on 0.0.0.0:7687.
2025-01-17 06:13:53.702+0000 INFO Bolt (Routing) enabled on 0.0.0.0:7688.
2025-01-17 06:13:55.306+0000 INFO HTTP enabled on 0.0.0.0:7474.
2025-01-17 06:13:55.306+0000 INFO Remote interface available at http://localhost:7474/
2025-01-17 06:13:55.311+0000 INFO id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2025-01-17 06:13:55.311+0000 INFO name: system
2025-01-17 06:13:55.311+0000 INFO creationDate: 2025-01-17T07:13:38.131+01:00
2025-01-17 06:13:55.311+0000 INFO Started.
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
curl -o "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/version.sh
curl -o "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/download.sh
curl -o "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/unpack.sh
curl -o "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/move.sh
curl -o "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/mac/settings.sh
curl -o "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/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-5.26.1/bin/neo4j console