Neo4j can be installed as a server, running either as a headless application or system service.
Download the latest release from http://neo4j.com/download
Extract the contents of the archive
NEO4J_HOME
Use the scripts in the bin directory
$NEO4J_HOME/bin/neo4j start
%NEO4J_HOME%\bin\Neo4j.bat
For information on High Availability, please refer to Chapter 26, High Availability.
With administrative rights, Neo4j can be installed as a Windows service.
%NEO4J_HOME%
bin\Neo4j.bat install
To uninstall, run bin\Neo4j.bat remove
as Administrator.
To query the status of the service, run bin\Neo4j.bat status
To start the service from the command prompt, run bin\Neo4j.bat start
To stop the service from the command prompt, run bin\Neo4j.bat stop
Note | |
---|---|
Some users have reported problems on Windows when using the ZoneAlarm firewall. If you are having problems getting large responses from the server, or if Webadmin does not work, try disabling ZoneAlarm. Contact ZoneAlarm support to get information on how to resolve this. |
Neo4j can participate in the normal system startup and shutdown process. The following procedure should work on most popular Linux distributions:
cd $NEO4J_HOME
sudo ./bin/neo4j install
if asked, enter your password to gain super-user privileges
service neo4j-service status
should indicate that the server is not running
service neo4j-service start
will start the server
During installation you will be given the option to select the user Neo4j will run as.
You will be asked to supply a username (defaulting to neo4j
) and if that user is not present on the system it will be created as a system account and the $NEO4J_HOME/data directory will be chown
'ed to that user.
You are encouraged to create a dedicated user for running the service and for that reason it is suggested that you unpack the distribution package under /opt or your site specific optional packages directory.
After installation you may have to do some platform specific configuration and performance tuning. For that, refer to Section 25.11, “Linux specific notes”.
To remove the server from the set of startup services, the proper command is
service neo4j-service remove
+ which will stop the server, if running, and remove it.
Note that if you chose to create a new user account, on uninstall you will be prompted to remove it from the system.
Using Homebrew, to install the latest stable version of Neo4j Server, issue the following command:
brew install neo4j && neo4j start
This will get a Neo4j instance running on http://localhost:7474.
The installation files will reside in ls /usr/local/Cellar/neo4j/community-{NEO4J_VERSION}/libexec/
— to tweak settings and symlink the database directory if desired.
Neo4j can be installed as a Mac launchd job:
cd $NEO4J_HOME
./bin/neo4j install
launchctl list | grep neo
should reveal the launchd "org.neo4j.server.7474" job for running the Neo4j Server
./bin/neo4j status
should indicate that the server is running
launchctl stop org.neo4j.server.7474
should stop the server.
launchctl start org.neo4j.server.7474
should start the server again.
To remove the launchctl service, issue the command
./bin/neo4j remove
Neo4j can be set up to run as several instances on one machine, providing for instance several databases for development. To configure, install two instances of the Neo4j Server in two different directories following the steps outlined below.
First, create a directory to hold both database instances, and unpack the development instance:
cd $INSTANCE_ROOT
mkdir -p neo4j
cd neo4j
tar -xvzf /path/to/neo4j-community.tar.gz
mv neo4j-community dev
Next, configure the instance by changing the following values in dev/conf/neo4j-server.properties, see even Section 28.1, “Securing access to the Neo4j Server”:
org.neo4j.server.webserver.port=7474 # Uncomment the following if the instance will be accessed from a host other than localhost. org.neo4j.server.webserver.address=0.0.0.0
Before running the Windows install or startup, change in dev/conf/neo4j-wrapper.properties
# Name of the service for the first instance wrapper.name=neo4j_1
Start the instance:
dev/bin/neo4j start
Check that instance is available by browsing to http://localhost:7474/webadmin/
In many cases during application development, it is desirable to have one development database set up, and another against which to run unit tests. For the following example, we are assuming that both databases will run on the same host.
Now create the unit testing second instance:
cd $INSTANCE_ROOT/neo4j
tar -xvzf /path/to/neo4j-community.tar.gz
mv neo4j-community test
Next, configure the instance by changing the following values in test/conf/neo4j-server.properties to
7475
(and HTTPS to a port other than default if you are using it)
# Note the different HTTP port number from the development instance org.neo4j.server.webserver.port=7475 # Assign a different port number for HTTPS org.neo4j.server.webserver.https.port=7464 # Uncomment the following if the instance will be accessed from a host other than localhost org.neo4j.server.webserver.address=0.0.0.0
Differentiate the instance from the development instance by modifying test/conf/neo4j-wrapper.properties.
wrapper.name=neo4j-test
On Windows, you even need to change the name of the service in bin\neo4j.bat to be able to run it together with the first instance.
set serviceName=Neo4j-Server-test set serviceDisplayName=Neo4j-Server-test
Start the instance:
test/bin/neo4j start
Check that instance is available by browsing to http://localhost:7475/webadmin/
Copyright © 2013 Neo Technology