# 部分參考連接
## 1懊悯,關(guān)于ntp服務(wù)器的同步
https://www.modb.pro/db/380456
## 2,核心參考文檔
### (1),服務(wù)端
https://www.cnblogs.com/lvzhenjiang/p/14943939.html
### (2),服務(wù)端與客戶(hù)端
https://learnku.com/articles/57689
## 3梦皮,其他參考文檔-01
https://www.simaek.com/archives/196/
1炭分,服務(wù)部署
(1),run.sh
#!/bin/bash
export MINIO_ACCESS_KEY=Minio
export MINIO_SECRET_KEY=Test1234!
/home/install/minioNew/minio server --config-dir /home/install/minioNew/config \
http://192.168.73.159/data/minio/data \
http://192.168.73.160/data/minio/data > /home/install/minioNew/dev.log
(2)剑肯,添加到系統(tǒng)管理的服務(wù)
- 修改配置文件
# 添加到系統(tǒng)管理的服務(wù)
vim /usr/lib/systemd/system/minio.service
# 添加如下內(nèi)容
[Unit]
Description=Minio service
Documentation=https://docs.minio.io/
[Service]
WorkingDirectory=/home/install/minioNew/
ExecStart=/home/install/minioNew/run.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
- 通過(guò)系統(tǒng)管理的命令進(jìn)行操作
# 啟動(dòng)
systemctl start minio
# 關(guān)閉
systemctl stop minio
(3)捧毛,添加Nginx代理
安裝Nginx或者Openresty,在Nginx的配置文件夾下添加Nginx配置文件退子。
vi nginx_minio_cluster.conf
upstream minio_api {
ip_hash;
server 192.168.73.159:9090 max_fails=3 fail_timeout=5s;
server 192.168.73.160:9090 max_fails=3 fail_timeout=5s;
}
upstream minio_console {
ip_hash;
server 192.168.73.159:9091 max_fails=3 fail_timeout=5s;
server 192.168.73.160:9091 max_fails=3 fail_timeout=5s;
}
server {
listen 9000;
ignore_invalid_headers off;
client_max_body_size 0;
#proxy_buffering off;
proxy_request_buffering off;
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
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 $scheme;
proxy_connect_timeout 300;
# 以下支持websocket的配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 以上為支持websocket的配置
chunked_transfer_encoding off;
proxy_pass http://minio_api;
expires 0;
}
location ~^/files {
proxy_buffering off;
proxy_set_header Host $http_host;
rewrite ^/files/(.*)$ /$1 break;
proxy_pass http://minio_api;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 9001;
ignore_invalid_headers off;
client_max_body_size 0;
proxy_request_buffering off;
#charset koi8-r;
# access_log /home/log/minio/access.log main;
# error_log /home/log/minio/error.log warn;
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://minio_console;
expires 0;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~^/files {
proxy_buffering off;
proxy_set_header Host $http_host;
rewrite ^/files/(.*)$ /$1 break;
proxy_pass http://minio_console;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}