Open alexliffick opened 7 years ago
If you're going to the trouble of making your own docker image to use supervisord I'd heavily recommend that you run neo4j directly instead of the entrypoint script. Then you wouldn't have to fight the setting code.
So something like
[program:neo4j]
command=/var/lib/neo4j/bin/neo4j console
stopsignal=INT
using supervisord in a docker container is not the way to go: if you process dies, the container dies. Just restart the container. Docker provides the --restart always
flag for this purpose.
@spacecowboy I am in a situation where I want to restore a graph.db
folder from a different machine. The process needs me to unbind the cluster-state. But because I am running docker containers, stopping the process will simply stop the container.
Yes I have the trouble too! I want to import some csv data to graph.db ,but always display error. Because the docker run a instance of neo4j which I can access it about http://localhost:7474/ but how can I stop the process rather than simply stop the container.
/var/lib/neo4j # neo4j-admin import --nodes=import/movies.csv --database graph.db Neo4j version: 3.5.5 Importing the contents of these files into /data/databases/graph.db: Nodes: /var/lib/neo4j/import/movies.csv
Available resources: Total machine memory: 3.86 GB Free machine memory: 895.90 MB Max heap memory : 491.00 MB Processors: 1 Configured max memory: 3.04 GB High-IO: false
IMPORT FAILED in 18047d 12h 53m 50s 261ms.
Data statistics is not available.
Peak memory usage: 0.00 B
Import error: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
Caused by:org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
org.neo4j.kernel.impl.store.UnderlyingStorageException: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
at org.neo4j.kernel.impl.store.NeoStores.verifyRecordFormat(NeoStores.java:217)
at org.neo4j.kernel.impl.store.NeoStores.
WARNING Import failed. The store files in /data/databases/graph.db are left as they are, although they are likely in an unusable state. Starting a database on these store files will likely fail or observe inconsistent records so start at your own risk or delete the store manually unexpected error: org.neo4j.io.pagecache.impl.FileLockException: This file is locked by another process, please ensure you don't have another Neo4j process or tool using it: '/data/databases/graph.db/neostore'.'
Same issue here, using it in Kubernetes. For now I use a workaround:
tail -f /dev/null
To solve the use-case of imports I'm now working on using a Kubernetes initContainer to seed the database using a previously registered dump.
@nicorikken I have the same problem, but a different solution in Kubernetes. I used a Job and created a modified image from the Neo4j image. I mounted a Persistent Volume to this container on /data
. From this, I ran neo4j-admin
on the data, saving the ingested data to the volume. I then created a Deployment for a fresh, unmodified Neo4j image and mounted this volume to it, so it contained the ingested data.
@Rohithzr This would count as an administrative procedure and needs to be done by set of cli parameters where you can import your new graph from the other directory without restarting the main process. The proper solution wouldn't be to make this kind of workaround to keep the container always running, would be to add the proper functionality in neo4j for import from a directory / NFS
Having said that you could override the entrypoint to start neo4j &; and to tail -f somke log file
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:
Dockerfile: