Setting up Neo4j Enterprise Edition Windows 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 a regular (non-elevated) powershell window! If you or you organisation haven't jumped on the new open source powershell releases yet, it's about time. Seriously. The below has been tested with version 7.4.4. It will work with the earlier proprietary versions too (that has not been tested but any powershell 3 and up is usually fine).
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 an Administrator user). The C:\users<your user>\Documents folder is perfect.
PS C:\Users\Your User> $PSVersionTable
Name Value
---- -----
PSVersion 7.4.4
...
PS C:\Users\Your User> cd .\Documents\
PS C:\Users\Your User\Documents> mkdir neo4j
PS C:\Users\Your User\Documents> mkdir .\neo4j\scripts
PS C:\Users\Your User\Documents> cd .\neo4j\
PS C:\Users\Your User\Documents\neo4j> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy ByPass
PS C:\Users\Your User\Documents\neo4j>
Right, so setting the execution policy will allow you to excute scripts (this is sometimes blocked). And these are the scripts we are going to download and execute :
PS C:\Users\Your User\Documents\neo4j> $WebClient = New-Object System.Net.WebClient
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/version.ps1", (Get-Location).Path + "\scripts\version.ps1")
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/download.ps1", (Get-Location).Path + "\scripts\download.ps1")
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/unpack.ps1", (Get-Location).Path + "\scripts\unpack.ps1")
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/move.ps1", (Get-Location).Path + "\scripts\move.ps1")
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/settings.ps1", (Get-Location).Path + "\scripts\settings.ps1")
PS C:\Users\Your User\Documents\neo4j> $WebClient.DownloadFile("https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/threefive/windows/start.ps1", (Get-Location).Path + "\scripts\start.ps1")
Do verify the sizes match up ...
PS C:\Users\Your User\Documents\neo4j> dir .\scripts\
... Length Name
... ------ ----
... 2396 download.ps1
... 1617 move.ps1
... 1745 settings.ps1
... 798 start.ps1
... 1496 unpack.ps1
... 219 version.ps1
Yes it is possible to do things completely manual, however :
- This is quite error-prone and may eat up a great deal of time in a training or experiment
- If you can not run the scripts (because of limitations on your laptop) it’s unlikely that you’ll be able to run Neo4j anyway ... (the Desktop installation will very likely also fail to start a database).
So with the scripts in place we are ready for the next step ...
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.282-win_x64.zip |
Neo4j Enterprise Server | install/neo4j-enterprise-3.5.35-windows.zip |
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.
PS C:\Users\Your User\Documents\neo4j> .\scripts\download.ps1
Downloading - there is no progress indicator! Please be patient!
Setting the versions ... Done!
Creating 'install' folder ... Done!
neo4j to: C:\Users\Your User\Documents\neo4j\install\neo4j-enterprise-3.5.35-windows.zip ... Done!
jre to: C:\Users\Your User\Documents\neo4j\install\zulu8.72.0.17-ca-jre8.0.282-win_x64.zip ... Done!
gds to: C:\Users\Your User\Documents\neo4j\install\neo4j-graph-data-science-1.1.7-standalone.zip ... Done!
apoc to: C:\Users\Your User\Documents\neo4j\install\apoc-3.5.0.17-all.jar ... Done!
apocmongodb to: C:\Users\Your User\Documents\neo4j\install\apoc-mongodb-dependencies-3.5.0.17.jar ... Done!
Downloading Complete
Do check that the sizes match with yours !
PS C:\Users\Your User\Documents\neo4j> dir .\install\
... Length Name
... ------ ----
... 16066055 apoc-3.5.0.17-all.jar
... 1483697 apoc-mongodb-dependencies-3.5.0.17.jar
... 173388765 neo4j-enterprise-3.5.35-windows.zip
... 4547144 neo4j-graph-data-science-1.1.7-standalone.zip
... 40178647 zulu8.72.0.17-ca-jre8.0.282-win_x64.zip
Next up ... 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.
PS C:\Users\Your User\Documents\neo4j> .\scripts\unpack.ps1
Unpacking the downloads...
Setting the versions ... Done!
Unpacking neo4j to: C:\Users\Your User\Documents\neo4j\ ... Done!
Unpacking jre to: C:\Users\Your User\Documents\neo4j\ ... Done!
Unpacking gds to: C:\Users\Your User\Documents\neo4j\install ... Done!
Unpacking Complete
With all the plugins now in jar form, it's time to move them into the plugins folder.
PS C:\Users\Your User\Documents\neo4j> .\scripts\move.ps1
Moving the plugins...
Setting the versions ... Done!
Moving gds to: C:\Users\Your User\Documents\neo4j\neo4j-enterprise-3.5.35\plugins ... Done!
Moving apoc to: C:\Users\Your User\Documents\neo4j\neo4j-enterprise-3.5.35\plugins ... Done!
Moving apocmongodb to: C:\Users\Your User\Documents\neo4j\neo4j-enterprise-3.5.35\plugins ... Done!
Moving Complete
Do check that the sizes match with yours !
PS C:\Users\Your User\Documents\neo4j> dir .\neo4j-enterprise-3.5.35\plugins\
... Length Name
... ------ ----
... 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
Most of the default settings of Neo4j are fine for the purposes of a training or experimentation, but not all. The script below 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.
PS C:\Users\Your User\Documents\neo4j> .\scripts\settings.ps1
Changing Settings...
Setting the versions ... Done!
Adding config to C:\Users\Your User\Documents\neo4j\neo4j-enterprise-3.5.35\conf\neo4j.conf
* 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.export.file.enabled=true
* apoc.import.file.enabled=true
Done!
Setting Java Environment for this session ... Done!
Importing Neo4j Modules ... Done!
Setting neo4j initial password ... Changed password for user 'neo4j'.
0
Done!
Settings Complete
It is important to note that if the changing of the password did not work, it's unlikely that the database start in the next step will.
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 that terminal window unless you want to bring down the database).
PS C:\Users\Your User\Documents\neo4j> .\scripts\start.ps1
Starting Neo4j!
Setting the versions ... Done!
Setting Java Environment for this session ... Done!
Importing Neo4j Modules ... Done!
2024-07-29 18:21:19.133+0000 INFO ======== Neo4j 3.5.35 ========
2024-07-29 18:21:19.137+0000 INFO Starting...
2024-07-29 18:21:19.789+0000 INFO Initiating metrics...
2024-07-29 18:21:19.789+0000 WARN Exporting tool have been configured to report values to but no metrics were enabled. Disabling kernel metrics extension.
2024-07-29 18:21:24.315+0000 INFO Bolt enabled on 0.0.0.0:7687.
2024-07-29 18:21:25.203+0000 INFO Started.
2024-07-29 18:21:25.296+0000 INFO Mounted REST API at: /db/manage
2024-07-29 18:21:25.880+0000 INFO Remote interface available at http://localhost:7474/
Enjoy!
Note that a CTRL-C will stop the database and that you obviously only have to repeat this final step to start the database again!