How to install Neo4j 2.0+ as a Windows service

I am testing the Neo4j 2.0 community beta for Windows, but I see no way to install it as a service. The only way to start Neo4j seems to be through neo4j-community.exe, but it requires interactivity to press the start button. The batch file that existed in release 1.X was gone.

Does anyone have any ideas?

+6
source share
3 answers

If you look here: http://www.neo4j.org/download/other_versions The Windows version shows the download in .zip format. There are bat files in the bin folder.

Run it as an administrator and use the install command to install it as a service.

+4
source

Now use the powershell method (bat files become obsolete). There is a good guide here

  • Download the ZIP file ( download page ).
  • Unzip it to C: \ neo4j
  • Open PowerShell as an administrator and use: C:\neo4j\bin\neo4j install-service
  • Use the same command for all other operations (i.e. C:\neo4j\bin\neo4j restart )

If you encounter problems, check the following :

  • Are you running powershell as an administrator?

  • You are allowed to run powershell scripts ( Set-ExecutionPolicy -ExecutionPolicy Unrestricted - USE WITH CAUTION).

  • Have you installed java and set the JAVA_HOME environment variable to the java directory (e.g. C: \ Program Files \ Java \ jre1.8.0_65)?

Old answer (in case it works better for people)

  • Go to the neo4j download page and select other settings. Download the zip file.

  • Unzip it to C: \ neo4j (optional, but you can copy and paste script examples more easily).

  • Follow the instructions here in brief:

  • Type: Import-Module C:\Neo4j\bin\Neo4j-Management.psd1

  • To install the service, enter:

    'C: \ Neo4j' | Initialize-Neo4jServer -ListenOnIPAddress 127.0.0.1 -PassThru | Install-Neo4jServer -PassThru | Launch Neo4jServer

+6
source

To extend @LameCoder's answer to a few steps I had to take:

  • Download the latest neo4j 2.nn zip file (not exe)
  • Unzip the final location for this instance
  • Download and install the Java SDK 7 (8 is disabled, but Neo says it uses 7)
  • At the SETX JAVA_HOME "C:\Program Files\Java\jdk1.7.0_80" command prompt SETX JAVA_HOME "C:\Program Files\Java\jdk1.7.0_80" . This sets the global environment variable.
  • In the Neo4j folder, from the administrator console: <PATH>\bin\Neo4jInstaller.bat install . You will be denied access if you did not start the console.
  • If your environment variable was set correctly, it will set
  • Reboot so that the environment variable is available to the service
  • Note that the service is up and running at http://localhost:7474

To run multiple instances

  • Modify Neo4jInstaller.bat to change the serviceName and serviceDisplayName
  • In the same file as above, edit the org.neo4j.server.webserver.port and org.neo4j.server.webserver.https.port for individual ports

To run on a different host on the application server

  • Uncomment the org.neo4j.server.webserver.address property in the org.neo4j.server.webserver.address file to open service nodes other than 127.0.0.1
+4
source

Source: https://habr.com/ru/post/957586/


All Articles