1. Download the installation file minio
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
To download this file, the network may be slow and difficult to download. At this time, you can download the minio installation package locally through the download tool and directly copy the link behind wget.
If it’s too slow, you can use my network disk address: add it
- Install minio service
1. Upload the file to the server. Mine is placed under /opt/minio. If not, create the folder yourself.
2. Place the minio file under minio, create data under the minio folder, (mkdir data) create the /data directory, which is used as the storage directory for minio
3 、chmod +x minio
4. Start the minio service . This startup is only temporary. Close the xshell page and the service will stop.
./minio server /data
5. Start as shown in the figure below. If you want to run in the background, you can use the following command.
nohup minio server /data &
5.2 Background operation can also be configured like this
- nohup /opt/minio server /opt/minio/data > /opt/data/minio.log 2>&1 &
The nohup.out folder will be generated , which contains accesskey and secretkey.
Port 9000 needs to be opened , the port can be modified
- Modify configuration file:
Customize MINIO_ACCESS_KEY and MINIO_SECRET_KEY
export MINIO_ACCESS_KEY=minio
export MINIO_SECRET_KEY=miniostorage
export MINIO_VOLUMES="/opt/data" // Custom folder address
Restart: nohup minio server /data &
Custom port
nohup minio server --address IP:PORT /data &
- Configure https access
During the project's use of the minio server to upload and download files, it was discovered that since the website uses https access mode and minio uses http access mode, directly jumping to http in https will cause security issues. There are many answers to this problem online, most of which talk about adding access headers, requesting through forms, or redirecting through nginx. This writing method always treats the symptoms but not the root cause. Considering that minio is such a popular distributed server, it is impossible not to support the mainstream https access method, and there is less information to be found online. I went directly to the official documentation and found the corresponding minio configuration method. Finally, I added the certificate using openssl and changed the minio access method to https to solve the problem.
Using OpenSSL:
Generate private key:
Copyopenssl genrsa -out private.key 2048
Generate self-signed certificate:
Copyopenssl req -new -x509 -days 3650 -key private.key -out public.crt -subj "/C=US/ST=state/L=location/O=organization/CN=domain"
Among them, 3650 is the number of days the certificate is valid, the province where the state is located, the city where the location is located, the organization, and the domain
Place the generated private and public keys in Minio 's config/ certs
folder
The relevant information address of the official website is as follows:
https://docs.min.io/cn/how-to-secure-access-to-minio-server-with-tls
https://docs.min.io/cn/minio-server-configuration-guide.html