preface

In enterprises, we usually store some pictures, videos, documents and other related data in object storage. Common object storage services include Aliyun’s OSS object storage, FastDFS distributed file system and the company’s private cloud platform, so as to facilitate data storage and quick acquisition. However, with the rapid development of business, we need to store some identity information for verification and real-name related data, which is sensitive. Therefore, we choose to use the open source distributed object storage compatible with S3 protocol -Minio for the storage of sensitive data to carry out self-built services.

A list,

MinIO object storage system is designed for massive data storage, artificial intelligence, and big data analysis. It is an object storage system based on the Apache License V2.0 open source protocol. It is fully compatible with Amazon S3 apis. It is suitable for storing massive images, videos, log files, backup data, and container/VM images. MinIO is implemented using The Golang language. The entire system runs in the user space of the operating system. The client communicates with the storage server using HTTP/HTTPS.

2. Installation steps

1. Query the miniO service version

docker search minio
Copy the code

2. Pull minio

Run the docker pull minio/minio command to download the stable image, and run the docker images command to view the downloaded image.

docker pull minio/minio
Copy the code

3. Start

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"
Copy the code

If the Linux version is installed, the startup command is as follows:

./minio server /usr/local/minio/data --console-address ": 9090"
Copy the code

Start successfully, IP+9000 access, I immediately silly ????

The latest version looks like this?? We need to install the previous version, so you installed minio after I wrote this article. Please don’t install the latest version. Don’t use this command:

docker pull minio/minio

4. Docker Hub download other versions

Hub.docker.com/r/minio/min…

Install a stable version prior to July of this year.

docker pull minio/minio:RELEASE2021.-06-17T00-10-46Z-28-gac7697426
Copy the code

1. Start the test

docker run -p 9000:9000 minio/minio:RELEASE2021.-06-17T00-10-46Z-28-gac7697426 server /data
Copy the code

Mentality explosion, not even this version, let’s move on to the next version.

Download and install the old version

1. Download the old version

Through the above pits, we found that minio version updates are very fast, and the latest version has become unrecognizable. I looked up the latest official release.

With over 200 releases both large and small, let’s keep looking for the next release, which will come on June 17, 2021.

docker pull minio/minio:RELEASE2021.-06-17T00-10-46Z
Copy the code

2, start,

docker run -p 9000:9000 minio/minio:RELEASE2021.-06-17T00-10-46Z server /data
Copy the code

See here I secretly happy, finally filled the pit.

3. Access testing

Enter IP+9000 to access the web page:

Or familiar taste ah, really fragrant !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

3. MinIO Customizes Access and Secret keys

docker run -p 9000:9000 minio/minio server /data
Copy the code

MinIO requires a persistent volume to store configuration and application data. However, just for testing, you can start MinIO by simply passing in a directory (/ data in the example below). This directory is created in the container’s file system when the container starts, but all data is lost when the container exits.

So we can’t do this at work, in real development, the above command is only for testing, so what should we pay attention to at work? First of all, your key and secret are important, is equivalent to your account password, do not set so simple, there is your file storage, assuming that the service down, the file is not lost, the service migration, the file can follow the migration, this is the work should pay attention to place.

To override MinIO’s automatically generated keys, 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 "[email protected]" \
  -v /usr/local/minio/data:/data \
  -v /usr/local/minio/config:/root/.minio \
  minio/minio:RELEASE2021.-06-17T00-10-46Z server /data
Copy the code
/usr/local/minio/data // Data volume storage path (added by yourself)
/usr/local/minio/config // Service profile (add your own)
Copy the code

After starting up again, we can find ourselves logging back in and using our own Access and Secret keys.

Create a new bucket and add a file to it:

After the upload is successful, we go to our service data volume storage location to check whether the file exists.

4. Start MinIO 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 "[email protected]" \
  -v /usr/local/minio/data:/data \
  -v /usr/local/minio/config:/root/.minio \
  minio/minio:RELEASE2021.-06-17T00-10-46Z server /data
Copy the code

The other small make up for you a Chinese document convenient Minio:docs.minio.org.cn/docs/master studying…

conclusion

Well, today’s article is the end, in the process of installing Minio, especially difficult, the latest version is really huge pit, Small make up, many detours, like the likes, comment !!!!!