Search code examples
rethinkdbrethinkdb-python

Where does the data go once you've done rethinkdb restore


After I've used rethinkdb restore, where does rethinkdb import that data / access that data from?

I've tried searching for this answer, but my choice in keywords to use must be inadequate.

I want to use this directory as a shared volume for my docker container so the docker container is "separate" from the data but also has w/r access to the data.


Solution

  • It imports into the data directory. Which is, by default, folder rethinkdb_data in working directory where you execute rethinkdb. Unless you specify a different with -d.

    $ rethinkdb -h

    Running 'rethinkdb' will create a new data directory or use an existing one, and serve as a RethinkDB cluster node. File path options: -d [ --directory ] path specify directory to store data and metadata

    If you are using Docker, and you didn't change the data directory with -d, then it's probably is store in 'rethinkdb_datain yourWORKDIR` instruction in Dockerfile. You can mount it outside for persistent.

    Take this image as example: https://github.com/stuartpb/rethinkdb-dockerfiles/blob/master/trusty/2.1.4/Dockerfile, it's official RethinkDB docker https://hub.docker.com/_/rethinkdb/

    We can see that it has instruction:

    WORKDIR /data 
    

    And it runs with:

    CMD ["rethinkdb", "--bind", "all"]
    

    Therefore, it store data in /data/rethinkdb_data. You can either mount the whole /data or only /data/rethinkdb_data/