Comment on Moving db data (MariaDB) to NFS NAS Hello self-hosters! :) I’d like to tap in
shifting9810@lemmy.mrpostman.ch 3 weeks ago
I have never attempted this but to me it sounds like it might lead to weird issues if nfs is slow for some reason and it will definitely make your nextcloud instance slower. You can easily just try it out though. Copy the docker compose project, start another mariadb instance with its data directory mounted from the nas. That way you can figure it out yourself.
Personally I would just back up the database to the nas regularly. Yes if your laptop fails this requires copying data. You already need to install an os on the new laptop and pull the git repo so having one more step of copying the data should be easily doable in my opinion. Especially since you hopefully don’t plan on having your laptop break all the time.
Yeah, but if that setup leads to problem in a few months, I won’t catch that. That’s why I decided to ask and judging by the other answer, I dodged a bullet here
Now I’m thinking of setting up something like this. Maybe even in another container? One volume with data bound, one with NFS and a bunch of scripts in entrypoint to rsync(?) between the two on inotifywait. There is lsyncd but it’s been unmaintained for two years now
I know it has been 3 days since you posted buy why not set up replication in the database it self? Sounds like you’re over complicating replication.
I run in k8s but I have a database with local disk, and I have another cronjob that takes a backup into the first database docker init folder. Older backups end with -date so they won’t get picked up by the init script. You can do similar with just docker.
I’ll echo everyone else. Database need local disk. I speak from experience of doing it over NFS. Even containers that have a hidden sqlite3 database should get local disk.
AFAIK db replication would require running another db on NAS. Which I tried to avoid
Yeah, that’s why I’m thinking to do. Have a container that watches changes to db data and rsyncs those into the NAS for safekeeping. My main goal in all of this is so db data won’t die with laptop’s SSD
I think the inode rsync is a bad idea. The 2nd DB would be on the NAS but its not being used by the app, so as long as it’s asynchronous writes, you should be okay.
In either case, I hope you have backups, not just the copy