Background:
In the past two days, I have been sorting out knowledge points, and then learning Minio. At the beginning, I met some updates, which took me a lot of time. I used it for too long before, and changed a lot of things. After using found that do not know how to set permanent access, out of this article.
Cover location: Don’t know
Author: Yin Heng
Docker has installed the latest Minio
2. Set SpringBoot to Minio 👩💻
Docker searches for minio/ MC images
🥳 ~
docker search minio
Copy the code
Docker pulls minio/ MC image
docker pull minio/mc
Copy the code
If you want to use it, use the latest. Go straight. (Default does not specify the version, pull is to pull the latest).
(I am not going to say that I am lazy to check the version number 👨💻👨💻)
🏄 came ️ 🏄 ♀ ️
Docker starts the minio/ MC container
docker run -it --entrypoint=/bin/sh minio/mc
Copy the code
Sh-4.4 # Enter == MC version== to view the version information
🤸 came ️ 🤸 ♀ ️
4. Bind the minio/ MC to the Minio Server
mc config host add <ALIAS> <YOUR-S3-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> [--api API-SIGNATURE]
Copy the code
== Explanation: ==
- ALIAS: A short nickname for your cloud storage service.
- S3 Endpoint, Access Key, and Secret Key are provided by your cloud storage service.
- endpoint http://ip:9000
- Access key, secret key to here everyone must know.
- The API signature is optional and is set to “S3v4” by default.
For example 🙋♀️
Obtain URL, access key and Secret key from MinIO service.MC config host add minio http://47.113.227.254:9000 AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI K7MDENG/bPxRfiCYEXAMPLEKEY - API S3v4Copy the code
If the binding is successful: the following sentence appears.
Check whether the minio Server binding was successful:
Run the following command to view the buckets used
mc ls minio
Copy the code
Note: Minio here is the alias we just took. 🏋 ️ came ️ 🏋 ️ ♀ ️
5. MC related commands
The command | role |
---|---|
ls | List files and folders |
mb | Create a bucket or a folder |
cat | Displays file and object contents |
pipe | Redirects a STDIN to an object or file or STDOUT |
share | Generate urls for sharing |
cp | Copy files and objects |
mirror | Mirror buckets and folders |
find | Find files based on parameters |
diff | Compare the differences between two folders or buckets |
rm | Delete files and objects |
events | Managed Object Notification |
watch | Listen for events on files and objects |
policy | Managing Access Policies |
session | Manages saved sessions for the cp command |
config | Manage MC configuration files |
update | Check for software updates |
version | Output Version Information |
💅 🤝
Vi.The official documentation
Set up a public access permanent access link
mc policy set public minio/commons Set the minio Commons bucket to public and permanently accessible
mc policy setPublic minio barrelCopy the code
Note: through this change to permanent access, success is sure to be successful, I here is a small demo, there is no what to consider security is not safe.
However, if it is a private project, it is not recommended for safety.
Note: == external links do not need to be generated using minio’s API. = =
HTTP: IP address :9000/bucket/ file name. The suffix
Example: http://IP:9000/commons/2021/07/25/2ea65db733844f3f85bca1346f943a3e.jpg 👨 🚀 🦸 ♀ ️ 🙋 ♀ ️
Set up a permanent download link
** Configuration policy command view **: MC policy
mc policy set download minio/test
mc policy set public minio/test
Copy the code
This command is used to set the server mybucket to open management, can be downloaded directly through the URL.
[bucket name]/[path] can be spliced to a specific folder or file
Similar to the following XXX. XXX. XXX. XXX: 9000 / mybucket/xx…
self-talk
Let’s go on learning together, actually already on the road. 👩💻👩💻 🛌 Lie flat.