In enterprises, we usually store some pictures, videos, documents and other related data in object storage. Common object storage services include Alibaba cloud OSS object storage, FastDFS distributed file system and the company's private cloud platform, so as to facilitate data storage and rapid access. However, with the rapid development of business, we need to store some identity information for auditing and real name related data. This part of data is more sensitive. Therefore, for the storage of sensitive data, we choose to use the open source distributed object storage Minio compatible with S3 protocol for self built services.
MinIO object storage system is designed for massive data storage, artificial intelligence and big data analysis, based on Apache license v2 0 open source protocol object storage system, which is fully compatible with Amazon S3 interface, and the maximum single object can reach 5TB. It is suitable for storing massive pictures, videos, log files, backup data and container / virtual machine images. MinIO is mainly implemented in Golang language. The whole system runs in the user state space of the operating system. http/https communication protocol is adopted between the client and the storage server.
2, Installation steps
1. Query minio service version
docker search minio
2. Pull the minio
Execute the command docker pull Mini / mini to download the stable version image, and use the command docker images to view the downloaded image.
docker pull minio/minio
If docker is installed, the startup command is as follows:
docker run -p 9000:9000 --name minio \ -d --restart=always \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio@123 \ -v /usr/local/minio/data:/data \ -v /usr/local/minio/config:/root/.minio \ minio/minio server /data --console-address ":9000" --address ":9090"
If it is installed in linux, the startup command is as follows:
./minio server /usr/local/minio/data --console-address ":9090"
Start successfully, IP+9000 access, I suddenly stupid????
The latest edition looks like this??? My heart is broken. The concise interface is gone. We need to install the previous version, so you installed minio after I wrote this article. Don't install the latest version. Don't use this command:
docker pull minio/minio
4. Download other versions of docker hub
Install the stable version before July this year.
docker pull minio/minio:RELEASE.2021-06-17T00-10-46Z-28-gac7697426
1. Start test
docker run -p 9000:9000 minio/minio:RELEASE.2021-06-17T00-10-46Z-28-gac7697426 server /data
Mentality explosion, this version can't do either. Let's continue to find the next version.
3, Download and install older versions
1. Download old version
Through the above pit, we found that the version update iteration of minio is very fast, and the latest version has become beyond recognition and unknown. I checked the latest version released on the official website.
More than 200 versions have been released, large and small. We continue to find the next version, June 17, 2021.
docker pull minio/minio:RELEASE.2021-06-17T00-10-46Z
docker run -p 9000:9000 minio/minio:RELEASE.2021-06-17T00-10-46Z server /data
Seeing this, I was overjoyed and finally filled the pit.
3. Access test
Enter IP+9000 to access the web page:
It's still a familiar taste. It's really fragrant!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3. MinIO custom Access and Secret keys
docker run -p 9000:9000 minio/minio server /data
MinIO requires a persistent volume to store configuration and application data. However, if it's just for testing, you can start MinIO by simply passing a directory (in the following example, / data). This directory will be created in the container's file system when the container starts, but all data will be lost when the container exits.
So we can't do this in our work and real development. The above commands are only for testing. What should we pay attention to in our work? First of all, your key and secret are important. They are equivalent to your account and password. Don't set them as simple as that. There is also your file storage. Assuming that the service is down, the file is not lost, and the service is migrated, the file can also be migrated. This is what we should pay attention to in our work.
To override the automatically generated key of MinIO, you can set the Access and Secret keys as environment variables. MinIO allows regular strings as Access and Secret keys.
docker run -p 9000:9000 --name minio\ -e "MINIO_ACCESS_KEY=admin" \ -e "MINIO_SECRET_KEYemail@example.com" \ -v /usr/local/minio/data:/data \ -v /usr/local/minio/config:/root/.minio \ minio/minio:RELEASE.2021-06-17T00-10-46Z server /data
/usr/local/minio/data // Data volume storage path (self added) /usr/local/minio/config //Service profile (self added)
After restarting, we can find that we can log in again and use our own Access and Secret keys.
Create a new bucket and add a file to it:
After the upload is successful, we go to the storage location of our service data volume to check whether the file exists.
4. MinIO is started in background mode
If you want to run in the background, add the - d parameter
docker run -d -p 9000:9000 --name minio\ -e "MINIO_ACCESS_KEY=admin" \ -e "MINIO_SECRET_KEYfirstname.lastname@example.org" \ -v /usr/local/minio/data:/data \ -v /usr/local/minio/config:/root/.minio \ minio/minio:RELEASE.2021-06-17T00-10-46Z server /data
In addition, the editor will give you a Chinese document to facilitate learning Minio: http://docs.minio.org.cn/docs/master/minio-docker-quickstart-guide
Well, today's article ends. In the process of installing Minio, it's very difficult. The latest version is really huge pit. I've made up a lot of detours. I like it and comment on it!!!!!