mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #945] Question: Mounting symlink'd index.sqlite3 on SSD when using docker-compose #587
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#587
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @akhilleusuggo on GitHub (Mar 15, 2022).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/945
Hello,
I've tried many ways to make it work, but I can't achieve to have the database hosted outside of the /data directory.
I'm running the project on ZFS (hard drives), the performance is O.K, but it start to get slow on the DB side, and when trying to add multiple links error 500 starts occurring.
You suggest running the database at the least on SSD https://github.com/ArchiveBox/ArchiveBox#storage-requirements , but doesn't seem to work with docker-compose, or I'm unable to mount it properly.
My home directory is an NVMe SSD, I would like to have the
index.sqlite3on/home/user/data/index.sqlite3Tried symbolic link, but does fail. Compose doesn't start, looping errors.
Tried to add a volume like this, but keeps recreating the database from scratch.
Any proper way of mounting it?
@akhilleusuggo commented on GitHub (Mar 15, 2022):
I've managed to fix my issue. Seems like docker is not very friendly with symbolic links.
The mount folder/files must be identical of the docker.
In this example, I had to create a
/datafolder on the host machine. Copy to it the index.sqlite3Expose the index.sqlite3 in the docker container volumes.
/data/index.sqlite3:/data/index.sqlite3Not sure why*, but the script keeps creating a dummy file
index.sqlite3@pirate commented on GitHub (Mar 15, 2022):
Correct, docker doesn't work to mount symbolic links as volumes.
If the mounted file is not valid inside docker it will try to overwrite it an create that empty index.sqlite3 you're seeing.
Hard links should work however, or you can mount the symlink destination as a volume as well (at the same path inside and outside of docker) and then it should work.
@akhilleusuggo commented on GitHub (Mar 15, 2022):
Could you explain what do you mean by
If you could provide an example I'd appreciate it.
@pirate commented on GitHub (Mar 16, 2022):
For example if you have this folder layout on the host:
Then you would need to mount it like so in
docker-compose.yml:(note the symlink path must be mounted to the same path as it is on the host inside docker)
@akhilleusuggo commented on GitHub (Mar 16, 2022):
Ok, I see what you mean. Like a reverse symlink.
Thank you, I'll try this way out.
@akhilleusuggo commented on GitHub (Apr 13, 2022):
@pirate I don't want to reopen the issue, but your last example logically works, but when it comes to running the database, how would I do that?
How can I tell Archivebox that the database (index.sqlite3) is mounted on
/media/someSSD/archivebox/index.sqliteand not on the default locationdata/index.sqlite3Just by creating a symbolic link, doesn't mean the data will be written to the location of the symlink. Will still be written on the default /data/index.sqlite3 witch I have on spinning drives with ZFS (compression/dedup ON), and you know performance is horrible compared to without.
Your example maybe was meant to fix the docker symlink issue; but not Archivebox issue.
If more than 1 project has a database that requires mounting on /data/index.sqlite3, this solution will not work.
I'm not saying that archivebox issue, but would be nice if we had a variable to point where the database is located.
I know that maybe the last resort would that each one would be rebuilding the image to reflect the location where he wants to store the db.