This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.
Download the installation file
wget http://dl.minio.org.cn/server/minio/release/linux-amd64/minio
Copy the code
Create a data folder
mkdir /opt/minio/data
Copy the code
Three, start,
/minio server /opt/minio/data >/dev/null &Copy the code
If the following problems occur, the port is occupied:
Replace the port or kill the process that occupies the port.
The successful startup is as follows:
Access the console direct IP address :9000, will directly jump to the console.
Set up permanent access links
In many cases, our images need to be accessed directly by the browser, which is set up through the minio client.
Download client:
wget https://dl.minio.io/client/mc/release/linux-amd64/mc
Copy the code
To give permission
chmod 777 mc
Copy the code
Add server
/ MC config host add minio http://172.16.3.28:9000/ minioadmin minioadminCopy the code
Set the bucket that you want to open for download, with miniO attached
./mc policy set download minio/graph-editor
Copy the code
Visit pictures:
http://172.16.3.28:9000/graph-editor/img/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210820174907.jpg
Copy the code
5. Change user name and password:
export MINIO_ROOT_USER=admin
export MINIO_ROOT_PASSWORD=12345678
Copy the code
Note that minio’s password is required to be 8 characters, otherwise it will fail to start, as shown below:
[root@public-server9 minio]# ./minio server /opt/minio/data1
ERROR Unable to validate credentials inherited from the shell environment: Invalid credentials
> Please provide correct credentials
HINT:
Access key length should be at least 3, and secret key length at least 8 characters
Copy the code
6. Cluster deployment
You need to run the following command on each node, as shown in the following figure. There are three directories on each node
Nohup. / minio server -- -- the console - address ": 10001" http://172.16.3.28/opt/minio/data1 http://172.16.3.28/opt/minio/data2 http://172.16.3.28/opt/minio/data3, http://172.16.3.29/opt/minio/data1, http://172.16.3.29/opt/minio/data2 http://172.16.3.29/opt/minio/data3, http://172.16.3.30/opt/minio/data1, http://172.16.3.30/opt/minio/data2 http://172.16.3.30/opt/minio/data3 \ > / dev/null &Copy the code
Setting permanent access permission is the same as before, except that it is set on one node. Access to other nodes will automatically jump to the access node that is set.
Add nginx load:
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 4096; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; Upstream minio {server 172.16.3.28:9000 fail_timeout=10s max_fails=2 weight=1; Server 172.16.3.29:9000 Fail_timeout =10s max_fails=2 weight=1; Server 172.16.3.30:9000 Fail_timeout =10s max_fails=2 weight=1; } upstream minio-console {server 172.16.3.28:10001 fail_timeout=10s max_fails=2 weight=1; Server 172.16.3.29:10001 Fail_timeout =10s max_fails=2 weight=1; Server 172.16.3.30:10001 Fail_timeout =10s max_fails=2 weight=1; } server { listen 10000; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { proxy_pass http://minio; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $remote_addr; } error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } server { listen 11000; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { proxy_pass http://minio-console; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $remote_addr; } error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } }Copy the code