How do I set Docker-based Linux deployment so that databases are stored in a different directory than actual data? Both are by default stored in the /app/config bind-mounted directory. I want to put databases on a different storage — small, but fast SSD.
I tried setting symlinks to data directories, but then storj complains that Error: piecestore monitor: disk space requirement not met despite that the data directories symlink to a file system with plenty of space.
Alexey, I do not have enough disk space to store files on a local drive. I’m now running Storj from SMB. I would like to move databases to local storage.
I can’t do iSCSI in this system. But I have extremely well-maintained SMB, as evidenced by the fact, that I’ve run this node already for two months with zero problems and all success rates at >95%. Which is why I’m asking the question above. Is there any answer to that question?
Ok, it seems that without changing the source code, this is impossible. Thankfully, changing the source code if you don’t mind hard-coding paths to the database files is not difficult.
I agree with Alexey that you shouldn’t use symlinks or SMB at all, but if you are going to use them, use a local folder as your data folder and symlink blobs, temp and trash to SMB locations. That way all db’s inclusing shm and wal files will be local and only piece storage is remote. It would be safer than symlinking the databases, but I have no guarantee that this will work or work reliably and you’re still dealing with added latency for your disk writes and reads. You’d be on your own if you have any issues with this setup.
If I may ask, what system are those SMB shares on? Can that system run docker?
The only thing I can think of beyond that is set up a local thin provisioning file system which shows more space than is actually available. It starts to quickly become seriously hacky and a patchwork or less than ideal things.
why do you want the database on a SSD? It’s not required. Its a very lightweight database. What do you do if an upgrade does not detect what you have done and your node crashes and gets disqualified. Is if worth it?
Have you tried mounting /config to a local folder and /config/storage and /config/trash (paths may not be correct) to SMB? I don’t know if docker supports nested mounting but that would solve your issue. That way everything would be local except the large storage folder
Didn’t you say you created symlinks instead? According to @xopok this method can be used to do separate databases from blob storage, so I recommend trying it