Coder Social home page Coder Social logo

Comments (4)

spacecowboy avatar spacecowboy commented on August 20, 2024 5

You have some nested databases there due to mounting the wrong
directories in docker (which then created new database subdirectories
when it concluded the directories did not contain existing databases).

If you want to mount epe.graphdb, you need to place it in a
directory structure which maps to what neo4j expects.

NOTE: The directory structure changed in Neo4j 3.0 and that is
what I am describing here and assuming that you are using.

Easy and safe way

Currently you have:

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

The easiest way to mount that in docker is to do:

mkdir -p /User/testuser/Documents/Neo4j/databases
mv /User/testuser/Documents/Neo4j/epe.graphdb /User/testuser/Documents/Neo4j/databases/graph.db

And then you'd specify this in your compose file:

volumes:
    - /User/testuser/Documents/Neo4j:/data

Note that I renamed the database to avoid having to specify a full
configuration file.

Advanced and dangerous way

There is nothing magic going on here, so you can in fact mount your
desired database directly as graph.db inside the docker
container. We don't really want you to do this because it might change
at any time, but it might help you better understand how the mounting
works.

Your compose file just needs to specify:

volumes:
    - /User/testuser/Documents/Neo4j/epe.graphdb:/data/databases/graph.db

This mounts your local database named epe.graphdb as database
graphdb inside the container. You can do the same for hp.graphdb.

from docker-neo4j.

alexjajones avatar alexjajones commented on August 20, 2024 1

Fantastic!! That worked like a charm, I'm very grateful for your help πŸ‘ If we ever cross paths, coffees/beers are on me!

from docker-neo4j.

spacecowboy avatar spacecowboy commented on August 20, 2024

It looks like you a trying to pass the wrong directory to the container. You want to pass the raw data directory and not the graph.db directory.

To illustrate, this is the default structure of the /data directory:

/data
└── databases
    └── graph.db
        β”œβ”€β”€ index
        β”œβ”€β”€ neostore
        β”œβ”€β”€ neostore.counts.db.a
        β”œβ”€β”€ neostore.id
        β”œβ”€β”€ neostore.labeltokenstore.db
        β”œβ”€β”€ neostore.labeltokenstore.db.id
        β”œβ”€β”€ neostore.labeltokenstore.db.names
        β”œβ”€β”€ neostore.labeltokenstore.db.names.id
        β”œβ”€β”€ neostore.nodestore.db
        β”œβ”€β”€ neostore.nodestore.db.id
        β”œβ”€β”€ neostore.nodestore.db.labels
        β”œβ”€β”€ neostore.nodestore.db.labels.id
        β”œβ”€β”€ neostore.propertystore.db
        β”œβ”€β”€ neostore.propertystore.db.arrays
        β”œβ”€β”€ neostore.propertystore.db.arrays.id
        β”œβ”€β”€ neostore.propertystore.db.id
        β”œβ”€β”€ neostore.propertystore.db.index
        β”œβ”€β”€ neostore.propertystore.db.index.id
        β”œβ”€β”€ neostore.propertystore.db.index.keys
        β”œβ”€β”€ neostore.propertystore.db.index.keys.id
        β”œβ”€β”€ neostore.propertystore.db.strings
        β”œβ”€β”€ neostore.propertystore.db.strings.id
        β”œβ”€β”€ neostore.relationshipgroupstore.db
        β”œβ”€β”€ neostore.relationshipgroupstore.db.id
        β”œβ”€β”€ neostore.relationshipstore.db
        β”œβ”€β”€ neostore.relationshipstore.db.id
        β”œβ”€β”€ neostore.relationshiptypestore.db
        β”œβ”€β”€ neostore.relationshiptypestore.db.id
        β”œβ”€β”€ neostore.relationshiptypestore.db.names
        β”œβ”€β”€ neostore.relationshiptypestore.db.names.id
        β”œβ”€β”€ neostore.schemastore.db
        β”œβ”€β”€ neostore.schemastore.db.id
        β”œβ”€β”€ neostore.transaction.db.0
        β”œβ”€β”€ schema
        β”‚Β Β  └── label
        β”‚Β Β      └── lucene
        β”‚Β Β          └── labelStore
        β”‚Β Β              β”œβ”€β”€ 1
        β”‚Β Β              β”‚Β Β  └── write.lock
        β”‚Β Β              └── failure-message
        └── store_lock

So whatever you mount as the /data directory must have a databases sub directory. By default, the /data/databases directory contains a database named graph.db. It could be called anything (your seem to be called epe.graphdb?), in which case one must edit the configuration option dbms.active_database to match the desired name. And to do that in docker, you must mount a /conf volume with a configuration file. (just call it graph.db to make it easy for yourself)

from docker-neo4j.

alexjajones avatar alexjajones commented on August 20, 2024

Thanks for the quick and detailed reply!

So I have two neo4j data sets on my machine, default.graphdb and epe.graphdb thus the funny names.

This is the top level directory structure of the one I'm trying to include in the neo4j container (epe.graphdb):

epe.graphdb
β”œβ”€β”€ certificates/
β”œβ”€β”€ data/
β”œβ”€β”€ databases/
β”œβ”€β”€ dbms/
β”œβ”€β”€ index/
β”œβ”€β”€ logs/
β”œβ”€β”€ neostore
β”œβ”€β”€ neostore.counts.db.a
β”œβ”€β”€ neostore.counts.db.b
β”œβ”€β”€ neostore.id
β”œβ”€β”€ neostore.labeltokenstore.db
β”œβ”€β”€ neostore.labeltokenstore.db.id
β”œβ”€β”€ neostore.labeltokenstore.db.names
β”œβ”€β”€ neostore.labeltokenstore.db.names.id
β”œβ”€β”€ neostore.nodestore.db
β”œβ”€β”€ neostore.nodestore.db.id
β”œβ”€β”€ neostore.nodestore.db.labels
β”œβ”€β”€ neostore.nodestore.db.labels.id
β”œβ”€β”€ neostore.propertystore.db
β”œβ”€β”€ neostore.propertystore.db.arrays
β”œβ”€β”€ neostore.propertystore.db.arrays.id
β”œβ”€β”€ neostore.propertystore.db.id
β”œβ”€β”€ neostore.propertystore.db.index
β”œβ”€β”€ neostore.propertystore.db.index.id
β”œβ”€β”€ neostore.propertystore.db.index.keys
β”œβ”€β”€ neostore.propertystore.db.index.keys.id
β”œβ”€β”€ neostore.propertystore.db.strings
β”œβ”€β”€ neostore.propertystore.db.strings.id
β”œβ”€β”€ neostore.relationshipgroupstore.db
β”œβ”€β”€ neostore.relationshipgroupstore.db.id
β”œβ”€β”€ neostore.relationshipstore.db
β”œβ”€β”€ neostore.relationshipstore.db.id
β”œβ”€β”€ neostore.relationshiptypestore.db
β”œβ”€β”€ neostore.relationshiptypestore.db.id
β”œβ”€β”€ neostore.relationshiptypestore.db.names
β”œβ”€β”€ neostore.relationshiptypestore.db.names.id
β”œβ”€β”€ neostore.schemastore.db
β”œβ”€β”€ neostore.schemastore.db.id
β”œβ”€β”€ neostore.transaction.db.72
β”œβ”€β”€ neostore.transaction.db.73
β”œβ”€β”€ schema
└── store_lock

When looking at the structure of epe.graphdb, the /data directory seems to be more complicated than the one you described (limited to three levels deep for readability):

epe.graphdb/data/
β”œβ”€β”€ databases
β”‚Β Β  β”œβ”€β”€ databases
β”‚Β Β  β”‚Β Β  └── graph.db
β”‚Β Β  β”œβ”€β”€ dbms
β”‚Β Β  β”‚Β Β  └── auth
β”‚Β Β  └── graph.db
β”‚Β Β      β”œβ”€β”€ databases
β”‚Β Β      β”œβ”€β”€ dbms
β”‚Β Β      β”œβ”€β”€ index
β”‚Β Β      β”œβ”€β”€ neostore
β”‚Β Β      β”œβ”€β”€ neostore.counts.db.a
β”‚Β Β      β”œβ”€β”€ neostore.id
β”‚Β Β      β”œβ”€β”€ neostore.labeltokenstore.db
β”‚Β Β      β”œβ”€β”€ neostore.labeltokenstore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.labeltokenstore.db.names
β”‚Β Β      β”œβ”€β”€ neostore.labeltokenstore.db.names.id
β”‚Β Β      β”œβ”€β”€ neostore.nodestore.db
β”‚Β Β      β”œβ”€β”€ neostore.nodestore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.nodestore.db.labels
β”‚Β Β      β”œβ”€β”€ neostore.nodestore.db.labels.id
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.arrays
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.arrays.id
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.index
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.index.id
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.index.keys
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.index.keys.id
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.strings
β”‚Β Β      β”œβ”€β”€ neostore.propertystore.db.strings.id
β”‚Β Β      β”œβ”€β”€ neostore.relationshipgroupstore.db
β”‚Β Β      β”œβ”€β”€ neostore.relationshipgroupstore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.relationshipstore.db
β”‚Β Β      β”œβ”€β”€ neostore.relationshipstore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.relationshiptypestore.db
β”‚Β Β      β”œβ”€β”€ neostore.relationshiptypestore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.relationshiptypestore.db.names
β”‚Β Β      β”œβ”€β”€ neostore.relationshiptypestore.db.names.id
β”‚Β Β      β”œβ”€β”€ neostore.schemastore.db
β”‚Β Β      β”œβ”€β”€ neostore.schemastore.db.id
β”‚Β Β      β”œβ”€β”€ neostore.transaction.db.0
β”‚Β Β      β”œβ”€β”€ schema
β”‚Β Β      └── store_lock
└── dbms
    └── auth

So my question would be, should I be referencing epe.graphdb/data/ or epe.graphdb/data/databases or something completely different?

Hope that makes sense,

Thanks again!

from docker-neo4j.

Related Issues (20)

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.