Neo4j can be installed as a server, running either as a headless application or system service.
Download the latest release from http://neo4j.org/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
doc
directory for details
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 query
To start/stop the service from the command prompt, run bin\Neo4j.bat +action+
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 21.9, “Linux specific notes”.
Finally, 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 stabel version of Neo4j Server, do
brew install neo4j && neo4j start
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.
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 24.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
It’s good practice to reset the unit testing database before each test run. This capability is not built into Neo4j server, so install a server plugin that does this:
wget http://github.com/downloads/jexp/neo4j-clean-remote-db-addon/test-delete-db-extension-1.4.jar
mv test-delete-db-extension-1.4.jar test/plugins
Next, configure the instance by changing the following values in test/conf/neo4j-server.properties to
7475
# Note the different port number from the development instance org.neo4j.server.webserver.port=7475 # Uncomment the following if the instance will be accessed from a host other than localhost org.neo4j.server.webserver.address=0.0.0.0 # Add the following lines to the JAXRS section at the bottom of the file org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.server.extension.test.delete=/db/data/cleandb org.neo4j.server.thirdparty.delete.key=secret-key
Differentiate the instance from the development instance by modifying test/conf/neo4j-wrapper.properties
.
wrapper.name=neo4j-test
Start the instance:
test/bin/neo4j start
Check that instance is available by browsing to http://localhost:7475/webadmin/#
Test the remote clean plugin by switching to the webadmin "Console" tab, selecting "HTTP" and entering the following:
DELETE /db/data/cleandb/secret-key
If this returns a "200 OK" response, the plugin is configured correctly.
For information on High Availability, please refer to Chapter 22, High Availability.
Copyright © 2012 Neo Technology