liudev
October 30, 2023, 9:55am
1
doc
in the doc of a docker file, it shows:
# This directory is where LiteFS will store internal data.
# You must place this directory on a persistent volume.
data:
dir: "/var/lib/litefs"
my question’s when docker run each time , /var/lib/litefs
will not be persistent .
so, how to do that?
gcv
October 30, 2023, 10:04am
2
You have to set up a volume. Here is an example of the fly.toml file:
And here on the litefs.yml file:
# This directory is where your application will access the database.
fuse:
dir: "/mnt/dbs"
# This directory is where LiteFS will store internal data.
# You must place this directory on a persistent volume.
data:
dir: "/mnt/litefs"
# If true, then LiteFS will not exit if there is a validation
# issue on startup. This can be useful for debugging issues as
# it avoids constantly restarting the node on ephemeral hosting.
exit-on-error: false
lease:
type: "consul"
The databases will be persisted in the volume mounted in the ‘mnt’ folder.
liudev
October 30, 2023, 10:21am
3
does that mean that if i am not use fly.io , i should run mount a local directory to the litefs container?
like:
docker run --privileged - v /mnt:/mnt
gcv
October 30, 2023, 10:38am
4
I don’t think it’s easy to use LiteFS outside of Fly. The team behind it can provide you with more information.
Yes, if you’re running with just Docker then you’ll need to mount the directory for /mnt
or /mnt/litefs
so that it’s persisted between restarts.
liudev
October 31, 2023, 2:36am
6
sorry. I am a newbie.
for this specific configuration.
the only thing i need to config in dockerfile is:
volumes:
- /var/lib/litefs:/mnt/litefs
is that means that my real database is existed on host folder /var/lib/litefs
, and litefs use the mounted folder as internally
/mnt/litefs
, so is the config of fuse matters below?
fuse:
dir: "/litefs"
system
Closed
November 7, 2023, 2:37am
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.