Minio分布式部署及遇到的报错
1.机器分布
192.168.10.66
192.168.10.22
192.168.10.33
2.机器配置
Minio-server服务器
品牌:lenovo
cpu:4核
内存:3G
硬盘容量:40G硬盘
IP:192.
⽹关 192.168.10.2
DNS1=8.8.8.8
3.下载相关⼯具
#下载minio服务端
#下载客户端
chmod +x minio
chmod +x mc
cp mc /bin/
cp minio /bin/
4.搭建minio(三个节点为⼀个集)
#创建⽬录(两个数据磁盘)
mkdir -p /data/minio{1,2}
mkdir /etc/minio
#编辑启动脚本
[root@localhost ~]# cat /opt/run.sh
#!/bin/bash
export MINIO_ACCESS_KEY=admin
export MINIO_SECRET_KEY=admin123
/usr/bin/minio server --config-dir /etc/minio \
192.168.10.66/data/minio1 192.168.10.66/data/minio2 \
192.168.10.22/data/minio1 192.168.10.22/data/minio2 \
192.168.10.33/data/minio1 192.168.10.33/data/minio2
#启动脚本加权限
chmod +x /opt/run.sh
# 配置systemd启动
[root@localhost ~]# cat /usr/lib/systemd/system/mi
microcode.service  minio.service
[root@localhost ~]# cat /usr/lib/systemd/system/mi
microcode.service  minio.service
[root@localhost ~]# cat /usr/lib/systemd/system/minio.service
[Unit]
Description=Minio service
Documentation=docs.minio.io/
[Service]
WorkingDirectory=/opt/
ExecStart=/opt/run.sh
# Let systemd restart this service on-failure
Restart=on-failure
RestartSec=5
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no
[Install]
WantedBy=multi-user.target
#系统启动脚本添加权限
chmod +x /usr/lib/systemd/system/minio.service
#启动minio服务
systemctl daemon-reload
systemctl is-enabled minio.service
systemctl start minio.service
systemctl status minio.service
#查看⽇志
tailf /var/log/message
Apr 24 14:45:23 localhost run.sh: Endpoint: 192.168.10.22:9000  172.17.0.1:9000  127.0.0.1:9000 Apr 24 14:45:23 localhost run.sh: Browser Access:
Apr 24 14:45:23 localhost run.sh: 192.168.10.22:9000  172.17.0.1:9000  127.0.0.1:9000
Apr 24 14:45:23 localhost run.sh: Object API (Amazon S3 compatible):
Apr 24 14:45:23 localhost run.sh: Go:        docs.min.io/docs/golang-client-quickstart-guide
Apr 24 14:45:23 localhost run.sh: Java:      docs.min.io/docs/java-client-quickstart-guide
Apr 24 14:45:23 localhost run.sh: Python:    docs.min.io/docs/python-client-quickstart-guide
Apr 24 14:45:23 localhost run.sh: JavaScript: docs.min.io/docs/javascript-client-quickstart-guide
Apr 24 14:45:23 localhost run.sh: .NET:      docs.min.io/docs/dotnet-client-quickstart-guide
Apr 24 14:45:23 localhost run.sh: IAM initialization complete
Apr 24 14:47:29 localhost chronyd[771]: Forward time jump detected!
Apr 24 14:49:39 localhost chronyd[771]: Source 119.28.206.193 replaced with 188.165.11.86
#三台⼀样操作,每台都要看⼀下⽇志是否输出结果⼀样。
5.minio访问效果
6.minio命令⾏上传⽂件及查看
#连接minio
mc config host add minio 192.168.10.66:9000 admin admin123
#新增⽬录
mc mb minio1/cert
#上传⽂件
mc cp ~/⽂件名字 minio/上传到minio指定命令
7.安装minio遇到的问题
#访问页⾯显⽰这个报错Server not initialized, please try again
#查看⽇志看到
[root@localhost data]# tailf /var/log/messages
Apr 24 14:40:53 localhost run.sh: Waiting for all other servers to be online to format the disks.
Apr 24 14:40:54 localhost run.sh: Unable to read 'format.json' from 192.168.10.22:9000/data/minio1: client time 2021-04-24 06:40:54 +0000 UTC is too apart with server time 2020-11-18 15:23:57.145857292 +0000 UTC Apr 24 14:40:54 localhost run.sh: Unable to read 'format.json' from 192.168.10.22:9000/data/minio2: client time 2021-04-24 06:40:54 +0000 UTC is too apart with server time 2020-11-18 15:23:57.145865387 +0000 UTC Apr 24 14:40:54 localhost run.sh: Waiting for all other servers to be online to format the disks.
Apr 24 14:40:54 localhost run.sh: Unable to read 'format.json' from 192.168.10.22:9000/data/mi
nio1: client time 2021-04-24 06:40:54 +0000 UTC is too apart with server time 2020-11-18 15:23:57.692449821 +0000 UTC Apr 24 14:40:54 localhost run.sh: Unable to read 'format.json' from 192.168.10.22:9000/data/minio2: client time 2021-04-24 06:40:54 +0000 UTC is too apart with server time 2020-11-18 15:23:57.692977041 +0000 UTC Apr 24 14:40:54 localhost run.sh: Waiting for all other servers to be online to format the disks.
#以上是错误信息
#解决⽅法
看你的机器是不是时间不对
再来查看你的磁盘空间是不是满了
然后将进程kill掉
在重新启动⼀下。
安装nginx
yum -y install nginx
#配置修改
[root@web-01 default.d]# egrep -v "^#|^$" /etc/f
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
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 2048;
include            /etc/pes;
default_type        application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See /en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/default.d/*.conf;
}
#代理配置
[root@web-01 default.d]# egrep -v "^#|^$" f
upstream mino{
server 192.168.10.66:9000;
server 192.168.10.22:9000;
server 192.168.10.33:9000;
}
server
{
listen 80;
server_name 192.168.10.88;
location / {
#include naxsi.rules;
#limit_conn  one  150;
#limit_conn perserver 1000;
#limit_req  zone=concurrent  burst=6  nodelay;
nginx和网关怎么配合使用
#proxy_pass 127.0.0.1:8082;
proxy_pass minio;
proxy_set_header  X-Real-IP  $remote_addr;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
proxy_buffer_size      16k;
proxy_buffers          4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404;        }
location ~ /\.
{
deny all;
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。