How to use Volumes in Minio?
-
I tried to use the new Volumes in Minio but somehow I can't. What I did:
- create Volume
- Mount Volume in app
- checked via Console if it is availabe at /media: YES
But then, it seems there is no config in a running app to change the storage from /data to /media.
In the docs (https://docs.minio.io/docs/minio-server-configuration-guide) it says nothing about storage location except during creation of the container itself.
Or am I looking in the wrong direction
-
As far as I understand, you can edit the
env.sh
file created after first run in minio. There is a lineexport CLOUDRON_MINIO_STARTUP_ARGS='server /app/data/data'
and you should be able to adjust that/app/data/data
path to point to the volume instead.This would not migrate any existing data of course, but should work on a fresh installation.
-
@nebulon ok good suggestions, I've tried it but then ran into the issue I couldn't login anymore:
- moved the data inside data/data to /srv/s3-01
- changed env.sh
- app didn't start because of error:
ERROR CUnable to initialize backend: Unable to write to the backend Dec 08 11:20:17 C> Please ensure MinIO binary has write permissions for the backend
- because WebTerminal in app didn't work I had to stop app and changed back env.sh
- after restart app, in WebTerminal executed :
sudo chown -R cloudron /media/s3-01 && sudo chmod u+rxw /media/s3-01
- changed env.sh again
- in WebTerminal I can reach the mount and there are no errors
- Try to login the web-GUI:
The access key ID you provided does not exist in our records
- tested
/app/code/minio-credentials get
and got the correct credentials .....?!?!?
I think I will start with a fresh app and delete the 300GB backup data from my MacBook and let's hope that latter doesn't crash in the meantime
-
Well I would suggest to test this with a fresh minio instance first to ensure the process works!
I think there might be more places which need to be made adjustable regarding the credentials. That being said maybe the
server <folder>
approach was not the best one in the first place, just what came to mind. -
@nebulon I've found some more: the actual config files are created after reboot in the new volume (hidden), and they don't contain the "old" credentials. The Cloudron script
/app/code/minio-credentials
is hardcoded to create them in data/data instead of the new volume. -
End of the story:
- migration did not succeed (I think Minio also doesn't like moving files in the background?)
- created a new app
- added Volume
- changed the
sudo chown -R cloudron /media/s3-01 && sudo chmod u+rxw /media/s3-01
- changed the env.sh
- changed the config in
/media/s3-01/.minio.sys/config/config.json
(search for minioadmin and change those access and secret keys) - I deleted the .minio.sys in the data/data
- started the app
Now buckets are created in the Volume and backup to Minio seems to work (at least I do see now about 400Mbit upload from my MacBook)
-
@imc67 Why do you want to make it use a volume? Minio's /app/data is really it's "database" and is not meant to be shared with others. If you just want to move the storage location to some other place, you should use the Move Data Directory configuration.
The volumes stuff is really for content/files that can be used by all apps. It's not meant for one app to share it's internal data with another.
-
@imc67 Ah, this is a workaround for forgetting to disable backups during minio update! Eventually, volumes will gain backup feature and your workflow might break
Maybe at the browser session level, the checkbox state of the Update dialog can be remembered (at a per-app level). Would that help?
-
@girish said in How to use Volumes in Minio?:
Maybe at the browser session level, the checkbox state of the Update dialog can be remembered (at a per-app level). Would that help?
I remember this kind of thing is indeed suggested before in the forum, however if only on browser session then it will be different when using other browsers at the same time I guess?
-
@imc67 I think previously @nebulon defaulted the value to the value of "automatic backups" but that change wasn't correct, so we had reverted it. This is because just because the user didn't want automatic daily backups, doesn't mean he doesn't want backup during an update.
@nebulon Is it easy to store the checkbox state per app (in localstorage or something?). What do you think?
-
@girish I guess we can store that in localstorage, hopefully thought does not get confusing when using more than one browser then. Generally I am questioning here why the manual update even comes into play on such a regular basis that this checkbox is an issue in the first place.
-
@nebulon for me it is no issue anymore because of the Volumes. In this Minio app I don't share the Volume with other apps and it's not backed up just like I want.
Hopefully in future releases, like @girish wrote, when they will be backed up there will also be an option to never backup specific Volumes?