Coder Social home page Coder Social logo

docker-neo4j's Introduction

NOTE: Supported images are available in the official image library on Docker Hub. Please use those in production.

Using the Neo4j Docker Image

Documentation for the Neo4j image can be found here.

You can start a Neo4j container like this:

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --volume=$HOME/neo4j/logs:/logs \
    neo4j:latest

To start a Neo4j Enterprise Edition container, you can run:

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
    --volume=$HOME/neo4j/data:/data \
    --volume=$HOME/neo4j/logs:/logs \
    neo4j:enterprise

Mounting the /data and /logs folder is optional, but it means that data can persist between closing and reopening Neo4j containers.

Neo4j images for ARM64

From 4.4.0 and onwards, Neo4j images have been available for ARM64 architectures through Docker Hub.

For earlier versions, we provide unsupported and untested builds of ARM64 Neo4j community edition from 4.0.0 to 4.3.23. These are unsuitable for production use, but may be useful for experimentation or hobbyists.

They are available on Docker hub at:

https://hub.docker.com/r/neo4j/neo4j-arm64-experimental

The images take the name format neo4j/neo4j-arm64-experimental:<VERSION>-arm64. Example usage:

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --volume=$HOME/neo4j/logs:/logs \
    neo4j/neo4j-arm64-experimental:4.1.0-arm64

Building and Developing the Neo4j Docker Image

See DEVELOPMENT.md

Getting support and contributing

For bug reports and feature requests, please create issues and pull requests against this Github repository.

If you need guidance with using Neo4j you can ask questions here: https://community.neo4j.com/

docker-neo4j's People

Contributors

azuobs avatar benbc avatar bfeshti avatar davidegrohmann avatar eastlondoner avatar ericsporre avatar gem-neo4j avatar gfx54b avatar glacialboy avatar glindroth avatar hannessandberg avatar jakewins avatar jangaraj avatar jennyowen avatar jexp avatar klaren avatar knutwalker avatar mishademianenko avatar petrjanouch avatar renetapopova avatar roxling avatar rweverwijk avatar snyk-bot avatar spacecowboy avatar srbaker avatar stdob avatar stefgia avatar tinwelint avatar unterstein avatar zimmre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-neo4j's Issues

Latest image (community/3.1.2) can't be restarted after being stopped on docker-compose

Environment: Mac (Docker for Mac stable channel installed).

Create docker-compose.yml file with:

neo4j3-data:
  image: busybox
  volumes:
    - /data

#Neo4J database engine
neo4j3-engine:
  image: neo4j:latest
  volumes_from:
    - neo4j3-data
  ports:
    - "7474:7474"
    - "7473:7473"
    - "7687:7687"
  expose:
    - "7474"
    - "7473"
    - "7687"
  environment:
    - NEO4J_AUTH=neo4j/testpassword

Start docker machines:
docker-compose up

neo4j image starts correctly.

Stop the machine

Start machines again:
docker-compose up

Machine fails to start with message:
Initial password was not set because live Neo4j-users were detected

With image 3.1.1, there's a warning: Warning: Initial password was not set because live Neo4j-users were detected, so the initial password has no effect. but the image restarts correctly.

Same steps can be obtained with docker... although it seems that neo4j:latest doesn't pull 3.1.2 directly?

$docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --env=NEO4J_AUTH=neo4j/testpassword neo4j:latest
Warning: Initial password was not set because live Neo4j-users were detected, so the initial password has no effect.
Starting Neo4j.
2017-03-15 17:41:34.351+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2017-03-15 17:41:35.326+0000 INFO  Starting...
2017-03-15 17:41:36.026+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-03-15 17:41:40.416+0000 INFO  Started.
2017-03-15 17:41:41.822+0000 INFO  Remote interface available at http://localhost:7474/
$docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --env=NEO4J_AUTH=neo4j/testpassword neo4j:3.1.2 
Unable to find image 'neo4j:3.1.2' locally
3.1.2: Pulling from library/neo4j
627beaf3eaaf: Pull complete 
1de20f2d8b83: Pull complete 
74e619d34827: Pull complete 
2b3f029f8f8c: Pull complete 
5c1be074b03c: Pull complete 
c39fa1958707: Pull complete 
da1a02f2fbbd: Pull complete 
5a1124342a43: Pull complete 
Digest: sha256:017761cba57d4a117507393cdf68cfc73113978f1395cc34dfb9fd881088b7d6
Status: Downloaded newer image for neo4j:3.1.2
command failed: initial password was not set because live Neo4j-users were detected.

NEO4J_AUTH doesn't take effect

Can't figure out why the NEO4J_AUTH environment variable is not taking effect. Here is my Dockerfile:

FROM neo4j/neo4j:2.3.0
ENV NEO4J_AUTH=neo4j/123456

But this is what follows:

$ docker run --detach --publish=7474:7474
$ curl http://localhost:7474
curl: (56) Recv failure: Connection reset by peer

After some time investigating, I see that there is a slight difference between setting and not setting the NEO4J_AUTH environment variable.

Here is the log output when setting the NEO4J_AUTH environment variable (pay attention to http://localhost:7474):

01:48:34.907 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2015-10-31 01:48:35.040+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2015-10-31 01:48:38.362+0000 INFO  Successfully started database
2015-10-31 01:48:38.399+0000 INFO  Starting HTTP on port 7474 (4 threads available)
2015-10-31 01:48:38.633+0000 INFO  Enabling HTTPS on port 7473
2015-10-31 01:48:38.713+0000 INFO  Mounting static content at /webadmin
2015-10-31 01:48:38.770+0000 INFO  Mounting static content at /browser
2015-10-31 01:48:39.870+0000 INFO  Remote interface ready and available at http://localhost:7474/

And here is the log output without having configured NEO4J_AUTH variable (which is the default config, and works):

01:46:47.561 [main] DEBUG i.n.u.i.l.InternalLoggerFactory - Using SLF4J as the default logging framework
2015-10-31 01:46:47.847+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2015-10-31 01:46:52.546+0000 INFO  Successfully started database
2015-10-31 01:46:52.607+0000 INFO  Starting HTTP on port 7474 (4 threads available)
2015-10-31 01:46:52.910+0000 INFO  Enabling HTTPS on port 7473
2015-10-31 01:46:53.044+0000 INFO  Mounting static content at /webadmin
2015-10-31 01:46:53.097+0000 INFO  Mounting static content at /browser
2015-10-31 01:46:54.630+0000 INFO  Remote interface ready and available at http://0.0.0.0:7474/

Did you see? In this case the address is http://0.0.0.0:7474, which indeed can be linked to the host's 7474 port, while http://localhost:7474 can't.

So, I tried to overwrite neo4j-server.properties with the following line uncommented: org.neo4j.server.webserver.address=0.0.0.0 without success. It doesn't change anything, even after restarting neo4j service.

Please, let me know if I'm doing something wrong.
Thank you very much!

Choose which local port to start

Would be nice to have a environment variable in order to choose which local port the service should start.

The problem:
If you are in a development/testing environment the service will always start using the port 7474. If you want to have two neo4j containers one running at 7474 and another one at 7475 (sharing the same host) you can't because this port are pretty much hard coded inside of the docker-entrypoint.sh. This is pretty much a common use case when using it along with docker-compose because you basically don't want to mix your development data and your automated testing data.

If you take a look at the docs you are proposing a solution using docker networks and HAProxies like this one:

docker network create --driver=bridge cluster

docker run --name=instance1 --detach --publish=7474:7474 --net=cluster --hostname=instance1 \

    --env=NEO4J_DATABASE_MODE=HA --env=NEO4J_HA_ADDRESS=instance1 --env=NEO4J_SERVER_ID=1 \

    --env=NEO4J_INITIAL_HOSTS=instance1:5001,instance2:5001,instance3:5001 \

    neo4j:enterprise-2.3



docker run --name=instance2 --detach --publish 7475:7474 --net=cluster --hostname=instance2 \

    --env=NEO4J_DATABASE_MODE=HA --env=NEO4J_HA_ADDRESS=instance2 --env=NEO4J_SERVER_ID=2 \

    --env=NEO4J_INITIAL_HOSTS=instance1:5001,instance2:5001,instance3:5001 \

    neo4j:enterprise-2.3



docker run --name=instance3 --detach --publish 7476:7474 --net=cluster --hostname=instance3 \

    --env=NEO4J_DATABASE_MODE=HA --env=NEO4J_HA_ADDRESS=instance3 --env=NEO4J_SERVER_ID=3 \

    --env=NEO4J_INITIAL_HOSTS=instance1:5001,instance2:5001,instance3:5001 \

    neo4j:enterprise-2.3

I don't know about you but I couldn't make it work correctly with docker-compose and I also thinks that for development/testing purposes its pretty much a "bazooka to kill an ant".

Proposed Solution:
My docker-compose.yml would look like:

neo4j:
  image: neo4j
  ports:
    - "7474"
  environment:
    NEO4J_AUTH: none
neo4j-test:
  image: neo4j
  ports:
    - "7475"
  environment:
    NEO4J_AUTH: none
    NEO4J_PORT: 7575

Notice the NEO4J_PORT env variable.

And my neo4j.yml would look like:

development:
  type: server_db
  url: http://neo4j:7474

test:
  type: server_db
  url: http://neo4j-test:7475

I may be wrong but looks like its pretty much like adding a
setting "org.neo4j.server.webserver.port" "${NEO4J_PORT:7474}" neo4j-server.properties to docker-entrypoint.sh and another few simple tweaks.

What are your thoughts?

Random exits

Hello, I'm using neo4j in a docker-compose project and sometimes I need to start the neo4j docker 3-4 times in order to stay up and it randomly exits (Exited (137)) sometimes after 3 days, sometimes after 3 hours. The same thing happens for docker-compose up as well as docker start project_db, the other services that I have along are working as expected.

docker-compose.yml

version: '2'   
services:   
    db:   
        image: neo4j   
        ports:   
            - "7474:7474"   
        volumes:   
            - "./data:/data"   
        environment:   
            NEO4J_AUTH: "neo4j/neo4j"   

How NEO4J_ALLOW_STORE_UPGRADE should be used ?

Hi,

I'm trying to migrate my Neo4j to Docker container.
All seems to work quite good, exept when I want to use my current database.

The database is not on the same Neo4j version than the Docker Image, so I need "allow_store_upgrade" set to true in neo4j.properties.

I've tried to use NEO4J_ALLOW_STORE_UPGRADE environment variable like this:

docker run --name=neo4j-test --detach --publish=7474:7474 --env=NEO4J_ALLOW_STORE_UPGRADE=true --volume=/mydata/neo4j-data/:/data --ulimit=nofile=40000:40000 neo4j

or

docker run --name=neo4j-test --detach --publish=7474:7474 --env=NEO4J_ALLOW_STORE_UPGRADE='true' --volume=/mydata/neo4j-data/:/data --ulimit=nofile=40000:40000 neo4j

But when I'm copying my graph.db content and start the container I still have this error:

docker logs neo4j-test

Starting Neo4j Server console-mode...
2015-12-23 12:20:23.146+0000 INFO No SSL certificate found, generating a self-signed certificate..
2015-12-23 12:20:24.633+0000 INFO Successfully shutdown Neo4j Server
2015-12-23 12:20:24.635+0000 ERROR Neo4j cannot be started, because the database files require upgrading and upgrades are disabled in configuration. Please set 'allow_store_upgrade' to 'true' in your configuration file and try again.

I've tried to do a "dump-config" to a config folder and the varialble is still on comment:

/conf# grep allow_store_upgrade neo4j.properties

allow_store_upgrade=true

Is there a bug in the docker image, or am I the bug ?

Regards,

Neo4j 3.0.0-alpha image

I am wondering if it is possible to add 3.3.0 alpha image?

Currently I changed all my manual Neo4j installations with docker images.
Only 3.0.0 is left.

I am using 3.0.0 locally, to develop against that version and my project.
So, adding 3.0.0 image for me will be:

  • Easy Neo4j 3.0.0-alpha installation
  • Easy upgrade
  • I will be cool developer with docker containers

Different directory for SSL certificates in Docker volume argument and settings.

The 3.1 operations manual provides the following command to provide your own certificate to a Docker container:

docker run --publish 7473:7473 --publish=7687:7687 --volume $HOME/neo4j/ssl:/ssl neo4j:3.1

However, the default dbms.directories.certificates is certificates.

So shouldn't the Docker command use --volume $HOME/neo4j/ssl:/var/lib/neo4j/certificates, or is something else going on? Does changing dbms.directories.certificates in your Dockerfile have any effect?

restart neo4j in docker without killing container

I've rolled my own Dockerfile to start with neo4j and include supervisord to run the docker-entrypoint script. It would be nice if I didn't have to do this and use my own image, but rather if Neo4j was setup this way from the get-go, or at least in some way that the container wouldn't die when trying to add additional conf entries aside from the few items that can be passed in as environment variables. If it helps, did the following:

Supervisord.conf:
[supervisord]
nodaemon=true

[program:neo4j]
command=/docker-entrypoint.sh neo4j
stopsignal=INT

Dockerfile:

FROM neo4j:enterprise

# Add the current working folder
COPY . /var/lib/neo4j

# Set the working directory to the new mapped folder.
WORKDIR /var/lib/neo4j

RUN apk update;apk add vim supervisor

#create the log dir for supervisor and copy the config file
RUN mkdir -p /var/log/supervisor

# Expose the node.js and consul ports to the Docker host.
EXPOSE 7474 7687 7473

CMD ["/usr/bin/supervisord", "--configuration=/var/lib/neo4j/supervisord.conf"]

Can't overwrite configuration

When running a new container and passing the configuration file (-v neo4j.conf:/var/lib/neo4j/conf/neo4j.conf) will result in overwriting my changes and reverting back to default.

Trying to play "smartass" and setting the file as read only will result in neo4j container restarting complaining that the file is read only.

Using the default neo4j:3.1.2 image from dockerhub
And tried also with neo4j:3.2.1 as well - same issue.

customized configuration of java heap size

I'm using the docker neo4j as my graph database. However, when I make some Cypher queries, it always runs to "java heap space" error. And I tried to change the configure file under $neo4j/conf dir, which contains two files: neo4j.conf and neo4j-wrapper.conf. I changed the neo4j-wrapper.conf to enlarge the dbms.memory.heap.initial_size=2048 and dbms.memory.heap.max_size=4096. But when I start the container again, it was modified to the original one again. What can I do to make the memory size be larger?

2.1.8 => 2.3.1 upgrade failure

Originally reported by davisd in the neo4j-users Slack #help-install channel.

Create a new AWS EC2 instance with Amazon linux

sudo yum install docker
sudo service docker start
sudo mkdir -p /data/neo4j
sudo chown ec2-user /data/neo4j
sudo -E docker run -i -t -d --name neo4j --privileged -v /data/neo4j:/var/lib/neo4j/data -p 7474:7474 vinelab/neo4j:2.1.8

Connect via the browser, create some data

sudo docker stop neo4j
sudo docker rm neo4j
sudo docker run --rm  --volume=$HOME/neo4j/conf:/conf neo4j dump-config

Edit the neo4j.properties under ~/neo4j/conf to allow upgrades

sudo docker run --detach --publish=7474:7474 --volume=/data/neo4j:/data --volume=$HOME/neo4j/conf:/conf --env=NEO4J_AUTH=none --ulimit=nofile=40000:40000 --name neo4j neo4j
sudo docker logs neo4j

You'll get a big stack trace, ultimately this is the issue:

Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UnexpectedUpgradingStoreVersionException: '/var/lib/neo4j/data/graph.db/neostore.nodestore.db' has a store version number that we cannot upgrade from. Expected 'v0.A.3' but file is version ''.

Invalid option docker run

Using Docker 1.9.1 on Windows 8 and pulled down the latest docker-neo4j repo

Ran a Docker build from the 2.3.1 directory using the tag neo4j/neo4j. Tried running with STDIN back:

 docker run -i -t --rm -p 7474:7474 -v //d/<path to data>:/data --name graphdb neo4j/neo4j

Every time I get ": invalid option". Not sure if I am missing an argument after the image? Note, that the volume to the image's data directory on my Windows machine is empty. Wondering if I am doing a rookie mistake with Docker or just missing something fundamental when try to run the neo4j image?

Plugins not loading

I mapped a volume to /var/lib/neo4j/plugins however my jars are not loaded on startup. I've tested using the latest framework and timetree jars.

Headless Neo

I have an application based on the Linkurious library, which I'm packaging into a Docker image. it was my hope that I'd be able to run a Neo container without publishing its ports (so the client can't access it) but --link the Linkurious container so that all access to the database would be through the app.

seemed reasonable enough until I realized that the app runs on the client browser and thus needs to be able to access Neo directly.

my concern is that users will just navigate to the /browser page and issue random queries and mess with data. so I asked Michael and he suggested that removing the libraries that implement the browser would solve this. the two files in question are:

neo4j-browser-2.3.0.jar

and

neo4j-server-2.3.0-static-web.jar

so whilst I can create a new image based on the official issued by Neo, I think a slight enhancement to the existing image would be better, since this is a very common requirement.

ideally I'd like to pass a --headless when running the Neo container, or maybe through an environment variable:

--env NEOJ_NO_BROWSER=true

รก la NO_AUTH

thoughts?

Image 3.1.3 not starting

Hi,

For information purpose, I had an issue with Neo4j community docker image 3.1.3 : not starting (data from 3.1.0, Apoc and MySQl in plugins folder). No issue in 3.1.0 :

Caused by: java.lang.ClassNotFoundException: org.neo4j.kernel.api.proc.Mode
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 20 more

My docker-compose :

neo4j:
  image: "neo4j:3.1.3"
  restart: always
  ports:
    - 7474:7474
    - 7687:7687
  volumes:
    - /DATA/neo4j/data/:/data
    - /DATA/neo4j/conf:/var/lib/neo4j/conf
    - /DATA/neo4j/plugins:/var/lib/neo4j/plugins
    - /DATA/neo4j/logs:/var/lib/neo4j/logs

Docker version: 17.04.0-ce build 4845c56
Ubuntu: 16.04.2 LTS

Limit Memory usage with docker

Is there any way to limit neo4j memory usage when running inside a docker container? I have a server with 2gb ram but most of it is used by neo4j, 800MB to be exact and there are a lot of other containers running which need more free memory. Please help.

3.1?

Haven't used the Docker container before, but went to pull 3.1, and it's not available?

Database not working/responding and no errors

I'm running the neo4j:latest container inside docker and currently experiencing issues. I went into some detail about this issue on stackoverflow.

After moving from 3.0 to the latest build, the web interface is accessible but logging into the server does nothing (hitting submit when logging in doesn't produce any response).

Input

Dockerfile

FROM neo4j:latest
MAINTAINER Andy Richardson

ENV NEO4J_AUTH neo4j/s3cret

EXPOSE 7474

Build script

# Build container
docker build -t fyp-neo4j:test -f $CWD/release/neo4j/Dockerfile $CWD

# Kill any previous containers
docker kill fyp-neo4j 2> /dev/null
docker rm fyp-neo4j 2> /dev/null

# Run container
docker run -d -p 7474:7474 -p 7687:7687 -p 7473:7473\
-v $HOME/neo4j/data:/data \
-v $HOME/logs:/logs \
--name=fyp-neo4j \
--net=fyp-network \
fyp-neo4j:test

Output

Command line log

Changed password for user 'neo4j'.
Starting Neo4j.
2017-02-11 16:29:44.749+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2017-02-11 16:29:46.635+0000 INFO  Starting...
2017-02-11 16:29:48.615+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-02-11 16:29:56.037+0000 INFO  Started.
2017-02-11 16:29:59.449+0000 INFO  Remote interface available at http://localhost:7474/

File log
The attached log contains output from numerous attemtps using different cache and heap sizes to no avail.
debug.txt

Causal clustering is not configurable with Docker service name (swarm mode)

I'm currently testing out the causal clustering feature in Docker swarm mode primarily with a docker-compose file and the command:

docker stack up -c compose-neo4j-master.yml neo4j

Ideally, the most concise "swarm mode way" to deploy the 3 core cluster nodes would be this:

services:
  neo4jcore:
     - NEO4J_dbms_mode=CORE
     - NEO4J_causalClustering_expectedCoreClusterSize=3
     - NEO4J_causalClustering_initialDiscoveryMembers=neo4jcore:5000
     deploy:
        replicas: 3

The neo4jcore:5000 part leverages the built-in DNS resolution and routing mesh within the neo4jcore service, so I wouldn't have to know the hostname/IP of each task container spawned by Docker.

However, running this configuration stops at

Attempting to connect to the other cluster members before continuing..

I haven't dug in the code, but I'm assuming either the expected count will never reach 3 because only 1 host was declared OR the load balancing provided by the docker swarm is getting in the way for core member nodes to properly do handshakes.

What did work for me is to do something similar to your test file causal-cluster-compose.yml and manually spread the services to different nodes.

services:
  neo4jcore1:
     - NEO4J_dbms_mode=CORE
     - NEO4J_causalClustering_expectedCoreClusterSize=3
     - NEO4J_causalClustering_initialDiscoveryMembers=neo4jcore1:5000,neo4jcore2:5000,neo4jcore3:5000
     deploy:
        replicas: 1
        placement:
          constraints:
             - node.hostname=node1
  neo4jcore2:
     - NEO4J_dbms_mode=CORE
     - NEO4J_causalClustering_expectedCoreClusterSize=3
     - NEO4J_causalClustering_initialDiscoveryMembers=neo4jcore1:5000, neo4jcore2:5000,neo4jcore3:5000
     deploy:
        replicas: 1
        placement:
          constraints:
             - node.hostname=node2
  neo4jcore3:
     - NEO4J_dbms_mode=CORE
     - NEO4J_causalClustering_expectedCoreClusterSize=3
     - NEO4J_causalClustering_initialDiscoveryMembers=neo4jcore1:5000, neo4jcore2:5000,neo4jcore3:5000
     deploy:
        replicas: 1
        placement:
          constraints:
             - node.hostname=node3

It would be great if neo4j/neo4j-docker played nice with this feature and supported it right out of the box.
Also by supporting this, clients can use a common connection string (e.g. bolt+routing://neo4jcore:7687)
without much configuration/reverse proxy help.

I'm thinking if it can generate the IP address list for the option NEO4J_causalClustering_initialDiscoveryMembers by doing nslookup on an intermediate environment variable declared in the compose file.

docker-entrypoint.sh overwrites .conf settings, sometimes incorrectly

We've had a pretty interesting day tracking down why our almost-ready-to-go-live Neo4j instance was running out of memory on a 32GB machine with a 10GB page size set in our neo4j.conf. We discovered that the neo4j-wrapper.conf running in the container had changed at container runtime and had different memory settings than what were baked into the image's config files.

The docker-entrypoint.sh script invariably overwrites settings in the config files based on (undocumented?) environment variables, for example:

  • $NEO4J_dbms_memory_heap_maxSize
  • $NEO4J_dbms_memory_pagecache_size
  • et al...

This was really surprising to us and hard to track down. We were using COPY commands in our FROM neo4j:enterprise Dockerfile to copy our customized .conf files into our derivative image, but these files' settings were being overwritten without any obvious cause (until we looked in the ENTRYPOINT).

Our workaround was to define these environment variables in our Dockerfile:

# NEO4J_dbms_memory_heap_maxSize is in megabytes
ENV NEO4J_dbms_memory_heap_maxSize   10000

# NEO4J_dbms_memory_pagecache_size is in kilobytes
ENV NEO4J_dbms_memory_pagecache_size 9000000

Furthermore, we noticed that dbms.memory.heap.initial_size setting was being set to the value intended for dbms.memory.heap.max_size, and that there is no way to set the initial size via these variables. Even if we set the setting's value in our config file, this entrypoint would just overwrite it. We'd probably need to COPY in our own customized /docker-entrypoint.sh in to get around this bug.

I noticed that the two separate config files (neo4j.conf and neo4j-wrapper.conf were being merged together in Neo4j 3.1 but maybe along with 3.1 we could figure out a better way to manage these config settings for the Docker image?

It seems standard practice across Dockerized services to respect config files first and then overwrite a setting iff an environment variable was actually defined. Modifying the config file in the container at container initialization time is probably not the most elegant option for making the environment variable overrides, either.

Thoughts?

Unable to run it on Fedora 23

Hi, I have recently started experimenting with docker and neo4j, I do not have much knowledge about it now, so you can even suggest me some readings apart from official docs.

I just installed docker and ran the command:

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    neo4j:3.0

Can someone please tell me what volume is? I changed my docker folder to another mount point (which works)

But it seems that this image is blocked by selinux (which is far from my knowledge)

here is error which I got:
Then I got warnig by selinux, I used commands to allow the operation then it came again with, write, add_name, create

Unable to find image 'neo4j:3.0.2' locally Trying to pull repository docker.io/library/neo4j ... 3.0.2: Pulling from docker.io/library/neo4j 51f5c6a04d83: Pull complete 65e9ddd8bd7a: Pull complete 02500df954bf: Pull complete e3b067df5fd6: Pull complete 121bc2f7d35c: Pull complete 33b88e5aef8c: Pull complete 9e022032b28e: Pull complete 904d018c83c1: Pull complete 207da73bc483: Pull complete bb52553717f4: Pull complete Digest: sha256:7123cbc791bcb44085f16d994121d3e84cf3b25a7e984b602e9901765138a2d6 Status: Downloaded newer image for docker.io/neo4j:3.0.2 Starting Neo4j. 2016-06-14 07:44:44.634+0000 INFO No SSL certificate found, generating a self-signed certificate.. 2016-06-14 07:44:45.025+0000 INFO Starting... 2016-06-14 07:44:45.504+0000 INFO Bolt enabled on 0.0.0.0:7687. 2016-06-14 07:44:45.596+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@60789398' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@60789398' was successfully initialized, but failed to start. Please see attached cause exception. org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@60789398' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:68) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:217) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:87) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:66) at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:28) Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@60789398' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:189) ... 3 more Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /var/lib/neo4j/data/databases/graph.db at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:144) at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:40) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108) at org.neo4j.server.CommunityNeoServer.lambda$static$31(CommunityNeoServer.java:55) at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:89) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:434) ... 5 more Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.internal.StoreLockerLifecycleAdapter@3c913e84' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:140) ... 10 more Caused by: org.neo4j.kernel.StoreLockException: Unable to create path for store dir: /var/lib/neo4j/data/databases/graph.db. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access) at org.neo4j.kernel.internal.StoreLocker.storeLockException(StoreLocker.java:90) at org.neo4j.kernel.internal.StoreLocker.checkLock(StoreLocker.java:66) at org.neo4j.kernel.internal.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:434) ... 12 more Caused by: java.io.IOException: Unable to create directory path [/var/lib/neo4j/data/databases/graph.db] for Neo4j store. at org.neo4j.io.fs.DefaultFileSystemAbstraction.mkdirs(DefaultFileSystemAbstraction.java:108) at org.neo4j.kernel.internal.StoreLocker.checkLock(StoreLocker.java:60) ... 14 more

Warning by selinux

`***** Plugin catchall (100. confidence) suggests **************************

If you believe that java should be allowed write access on the data directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
-- cmd to run> ausearch -c 'java' --raw | audit2allow -M my-java
-- cmd to run> semodule -X 300 -i my-java.pp

Additional Information:
Source Context system_u:system_r:svirt_lxc_net_t:s0:c243,c742
Target Context system_u:object_r:admin_home_t:s0
Target Objects data [ dir ]
Source java
Source Path java
Port
Host oglop-pc
Source RPM Packages
Target RPM Packages
Policy RPM selinux-policy-3.13.1-158.15.fc23.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name oglop-pc
Platform Linux oglop-pc 4.4.9-300.fc23.x86_64 #1 SMP Wed
May 4 23:56:27 UTC 2016 x86_64 x86_64
Alert Count 2
First Seen 2016-06-14 09:44:45 CEST
Last Seen 2016-06-14 09:44:45 CEST
Local ID 50904f57-44cf-474d-aa5e-d46ab19388a0

Raw Audit Messages
type=AVC msg=audit(1465890285.586:399): avc: denied { write } for pid=17493 comm="java" name="data" dev="dm-0" ino=1458830 scontext=system_u:system_r:svirt_lxc_net_t:s0:c243,c742 tcontext=system_u:object_r:admin_home_t:s0 tclass=dir permissive=0

Hash: java,svirt_lxc_net_t,admin_home_t,dir,write`

Using it in docker-compose

I am trying to use this image with docker-compose as follows:


graphdb:
  image: neo4j
  volumes:
    - /opt/data
  ports:
    - "7474:7474"
    - "1337:1337"

How do I access it from the shell?

How do I set an username:password?

Mapping an existing local neo4j database to a neo4j docker container [OSX]

I seem to be having troubles mapping a local database to the docker container. I have exhausted google and stackoverflow after hours of search and still can't get it working. Im wondering if there's an issue or am I just barking up the wrong tree.

Here is my docker-compose.yml:

version: '2'
services:
  neo4j:
    image: neo4j
    ports:
     - "7474:7474"
    volumes:
      - /User/testuser/Documents/Neo4j/epe.graphdb/data:/data
    environment:
       NEO4J_AUTH: neo4j/neo4j

When using the desktop application for neo4j, setting the database location to the following works perfect and I can browse the data. But the browser within the docker container returns no data.

/User/testuser/Documents/Neo4j/epe.graphdb

Sorry if this is just me being stupid, close if this is the case.

Is there a way to switch databases from within Cypher?

I've been experimenting with the provided "graph.db" inside the Docker instance for neo4j, and I'd now like to abandon everything I've done and start over. The obvious thing to do would seem to be to create a new database, point the console at it, and keep going. It's not clear to me how that would be done, though, even after looking at the documentation.

I think I can accomplish the same goal by killing my Docker container and then restarting it pointing at a new data directory, but it would seem to make more sense somehow if there was a better way than that, ideally a set of commands within Cypher.

thanks for any hints!

dump-config throws exception

Executable "dump-config" is not found.

$ sudo docker run --name neo4j-feeder-1 -v /mnt/btrfs/dockervols/data:/data -v /mnt/btrfs/dockervols/neo4j-feeder-1/conf:/conf neo4j/neo4j:milestone_enterprise dump-config
exec: "dump-config": executable file not found in $PATH2015/10/09 19:42:13 Error response from daemon: Cannot start container db10941520bf2a4ac1fb90db1b70050ad7b550deba2d6e8182dfca04d3bb8aa7: exec: "dump-config": executable file not found in $PATH

It is possible to start the container with no cmd.

Can't connect to bolt port when using docker swarm

Using a simple docker service create command:

docker service create --constraint node.role==manager --name neo4j --network mynetwork --mount type=volume,src=Neo4jData,target=/data neo4j:3.1.0

I get this error when trying to connect to the bolt port, using the c# bolt driver:
Neo4j.Driver.V1.ClientException: Failed to connect to the server neo4j:7687 within connection timeout 5000ms

I can't seem to get it to work. Does anyone have a suggestion. Running it on plain docker on 1 server, no problem. It just works...

neo4j-shell support

at present the Dockerfile doesn't export port 1337, which is used by the neo4j-shell utility. this makes it impossible to load a database via scripts since the utility is refused connection.

could we add that port number to the export list? is there anything else that's needed for that to work?

Mounting via --volume fails

I'm running Neo from a Docker container like this:

docker run -d -p 7474:7474 --name neo --env NEO4J_NO_AUTH=true --volume /Applications/neo4j-community-2.2.5/data:/data neo4j/neo4j

where the /Applications path contains my existing database (I have Neo installed locally and it uses that path). if I attach to the container and take a look, there's a database there:

docker exec -it neo /bin/bash
ls /data/graph.db

but running a query match (n) return n at the /browser comes back empty. I'm running on OSX Yosemite. any thoughts?

Exception rrd store when trying to override the data file

Environment - mac, os x 10.11
Latest neo4j docker release
Docker Toolbox 1.8.3 (latest installed yesterday)

Docker command: run --detach --publish=7474:7474 --volume=$HOME/neo4j-data:/data neo4j/neo4j
Database is created but followed with exception:
2015-10-14 15:50:45.112+0000 INFO [API] Setting startup timeout to: 120000ms based on 120000
2015-10-14 15:50:46.438+0000 INFO [API] Successfully started database
2015-10-14 15:50:46.503+0000 ERROR [API] Unable to open rrd store, attempting to recreate it
java.io.IOException: Invalid file header. File [/data/graph.db/rrd] is not a RRD4J RRD file
at org.rrd4j.core.Header.validateHeader(Header.java:208) ~[rrd4j-2.2.jar:na]
at org.rrd4j.core.RrdDb.(RrdDb.java:214) ~[rrd4j-2.2.jar:na]
at org.rrd4j.core.RrdDb.(RrdDb.java:184) ~[rrd4j-2.2.jar:na]
at org.neo4j.server.rrd.RrdFactory.validateStepSize(RrdFactory.java:245) [neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.rrd.RrdFactory.createRrdb(RrdFactory.java:168) [neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.rrd.RrdFactory.createRrdDbAndSampler(RrdFactory.java:95) [neo4j-server-2.2.5.jar:2.2.5]
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:216) [neo4j-server-2.2.5.jar:2.2.5]

Missing line in /docker-entrypoint.sh in running docker container

Hi,

  1. I am currently using neo4j/neo4j-experimental:3.1.0-RC1-enterprise for a demo (tried neo4j/neo4j-experimental:3.1.0-RC1 as well)
  2. In #68 the second line of the following snippet was added to the entrypoint.sh, see https://github.com/neo4j/docker-neo4j/blob/master/src/3.1/docker-entrypoint.sh#L45
      setting "dbms.mode" "${NEO4J_dbms_mode:-}"
 +    setting "dbms.connectors.default_advertised_address" "${NEO4J_dbms_connectors_defaultAdvertisedAddress:-}"
      setting "ha.server_id" "${NEO4J_ha_serverId:-}"
  1. I see, that the images were updated 14 hours ago, see https://hub.docker.com/r/neo4j/neo4j-experimental/tags/

But my /docker-entrypoint.sh looks like inside the container looks like:

    setting "dbms.connector.bolt.listen_address" "0.0.0.0:7687"
    setting "dbms.mode" "${NEO4J_dbms_mode:-}"
    setting "ha.server_id" "${NEO4J_ha_serverId:-}"
    setting "ha.host.data" "${NEO4J_ha_host_data:-}"

Possibility to specify single configuration files

Currently there is possibility to specify some of most-used configuration via --env variables.
Also, we can specify conf/ as volume.

I am using different Neo4j versions locally (2.2.6, 2.3.0, 3.0.0). Env variables is OK for me.
But I want to additionally configure Neo4j logging, by providing just single configuration file.

Mouting conf/ will force me to handle all configuration, for all version separately, because configuration may differ from version-to=version.

neo4j-enterprise randomly shutting down

Hello, I am running the latest enterprise build. Unfortunately the docker container keep randomly shutting down. It says the shut down was initiated by request, but the computer running it was not even been used when it shut down, it happened at like 4 in the morning.

2017-07-07 22:36:40.888+0000 INFO  ======== Neo4j 3.2.1 ========
2017-07-07 22:36:41.213+0000 INFO  Starting...
2017-07-07 22:36:42.204+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-07-07 22:36:42.236+0000 INFO  Initiating metrics...
2017-07-07 22:36:45.860+0000 INFO  Started.
2017-07-07 22:36:46.101+0000 INFO  Mounted REST API at: /db/manage
2017-07-07 22:36:47.118+0000 INFO  Remote interface available at http://localhost:7474/
2017-07-07 23:24:08.554+0000 INFO  Neo4j Server shutdown initiated by request
2017-07-07 23:24:08.646+0000 INFO  Stopping...
2017-07-07 23:24:09.029+0000 INFO  Stopped.

and another time:

2017-07-08 01:47:45.323+0000 INFO  Starting...
2017-07-08 01:47:46.199+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2017-07-08 01:47:46.218+0000 INFO  Initiating metrics...
2017-07-08 01:47:49.260+0000 INFO  Started.
2017-07-08 01:47:49.457+0000 INFO  Mounted REST API at: /db/manage
2017-07-08 01:47:50.216+0000 INFO  Remote interface available at http://localhost:7474/
2017-07-08 04:44:50.267+0000 INFO  Neo4j Server shutdown initiated by request
2017-07-08 04:44:50.348+0000 INFO  Stopping...
2017-07-08 04:44:50.809+0000 INFO  Stopped.

Not working with boot2docker in windows

When I run it exists after few seconds.

This is the output from the interactive shell:

ln: failed to create symbolic link /data/graph.db/rrd': Protocol error cp: cannot stat /conf/*': No such file or directory
Starting Neo4j Server console-mode...
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties-Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled-XX:-OmitStackTraceInFastThrow -XX:hashCode=5 -Dneo4j.ext.udc.source=tarball -Djava.rmi.server.hostname=f8597329741d
2015-08-05 15:25:26.009+0000 INFO [API] Setting startup timeout to: 120000ms based on 120000
2015-08-05 15:25:29.163+0000 INFO [API] Successfully started database
2015-08-05 15:25:29.233+0000 INFO [API] Successfully shutdown Neo4j Server.
2015-08-05 15:25:29.382+0000 INFO [API] Successfully stopped database

dbms.backup.address config value cannot be overridden by an env variable

I would like to initialize Neo4J backups remotely but obviously can't without enabling the 'dbms.backup.address' config value. I have had to take a copy of the neo4j.conf and inject it to the docker container because the value cannot be overridden using an environment variable like other settings can.

Could this be fixed? Ideally, so that all settings within the config file could be overridden.

`tools/` not in the image?

Looking for recovery tools such as tools/src/main/java/org/neo4j/tools/dump/LenientInvalidLogEntryHandler.java and /tools/src/main/java/org/neo4j/tools/rebuild/RebuildFromLogs.java

Failed to connect to web interface with conf in volume

Hi, I was trying to start the official docker image, with provided conf dir via volume, like the following:

docker run --rm --publish=7474:7474 --volume=${DB_DIR}:/data/graph.db --volume=${CONF_DIR}:/conf neo4j

and from the printed log, everything seems to be working:

Starting Neo4j Server console-mode...
2016-03-30 11:49:03.208+0000 INFO  No SSL certificate found, generating a self-signed certificate..
2016-03-30 11:49:09.060+0000 INFO  Successfully started database
2016-03-30 11:49:09.118+0000 INFO  Starting HTTP on port 7474 (8 threads available)
2016-03-30 11:49:09.470+0000 INFO  Enabling HTTPS on port 7473
2016-03-30 11:49:09.613+0000 INFO  Mounting static content at /webadmin
2016-03-30 11:49:09.702+0000 INFO  Mounting static content at /browser
2016-03-30 11:49:11.400+0000 INFO  Remote interface ready and available at http://localhost:7474/

however, the 7474 port can't be reached, and curl results failure:

$ curl 127.0.0.1:7474
curl: (56) Recv failure: Connection reset by peer

I thought there should be something wrong with my configurations, hence I dumped a set of configurations from the docker image and retried, except getting the same failure above.

Once I removed volume=${CONF_DIR}:/conf from my docker run command, the web interface runs smoothly. And the log is same to the case which fails.

Anyone happens to know where I did it wrong? Could really use your help. Thanks.

exit code 143 on graceful shutdown

I'm starting and stopping neo4j with a docker-compose-file:

version: '2'
services:
  neo4j:
    image: neo4j:2.3.2
    ports:
      - 7474:7474
    volumes:
      - ./data:/data

On docker-compose stop I'm getting an '143' exit-code, when the log-messages seems to be fine (console-output from windows docker toolbox):

Stopping neo4j_neo4j_1 ...
neo4j_1 | 2016-03-21 09:00:52.599+0000 INFO  Neo4j Server shutdown initiated by request
neo4j_1 | 2016-03-21 09:00:52.643+0000 INFO  Successfully shutdown Neo4j Server
neo4j_1 | 2016-03-21 09:00:52.725+0000 INFO  Successfully stopped database
Stopping neo4j_neo4j_1 ... done
neo4j_neo4j_1 exited with code 143

Make dbms.connectors.default_advertised_address configurable in docker-entrypoint.sh

In order to support networking features like overlay networks and virtual IPs, it would be great if dbms.connectors.default_advertised_address would be configurable. It would be great, if it would be possible to inject the advertised addressed from the outside, for example using NEO4J_dbms_advertisedAddress environment variable.
This property should only be set, if the environment variable is set.

Different neo4j service share the same data

I would like to create 2 different Neo4j service with Rancher (which use Cattle as orchestration engine).

I followed guide to create storage driver here. I wrote (at Volumes tab, Volume line) in the first service /data/service1:/data and /data/service2:/data in the second. When I ssh to my server, both of them show up (/data/service1 and /data/service2).

But amazingly, both service serve the same data. For example, when I create a node in service 1, it's also showed up in service 2.

Please show me where i am wrong :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.