1.所有节点配置主机名解析:(为了节点相互可以找到)
cat >> /etc/hosts << EOF 10.10.63.71 minio1 10.10.63.72 minio2 10.10.63.73 minio3 10.10.63.74 minio4 EOF
2.部署minio集群,4个节点每个节点挂载2个目录(注意:MINIO集群挂载目录不能使用根目录,这里使用docker卷作为挂载点)
minio1
docker run -d --name minio \ --restart=always --net=host \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio123 \ -v minio-data1:/data1 \ -v minio-data2:/data2 \ minio/minio server \ --address 10.10.63.71:9000 \ http://minio{1...4}/data{1...2}
minio2
docker run -d --name minio \ --restart=always --net=host \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio123 \ -v minio-data1:/data1 \ -v minio-data2:/data2 \ minio/minio server \ --address 10.10.63.72:9000 \ http://minio{1...4}/data{1...2}
minio3
docker run -d --name minio \ --restart=always --net=host \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio123 \ -v minio-data1:/data1 \ -v minio-data2:/data2 \ minio/minio server \ --address 10.10.63.73:9000 \ http://minio{1...4}/data{1...2}
minio4
docker run -d --name minio \ --restart=always --net=host \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio123 \ -v minio-data1:/data1 \ -v minio-data2:/data2 \ minio/minio server \ --address 10.10.63.74:9000 \ http://minio{1...4}/data{1...2}
3.启动日志
Console: http://10.10.63.71:38556 http://172.17.0.1:38556 http://127.0.0.1:38556 Documentation: https://docs.min.io WARNING: Console endpoint is listening on a dynamic port (38556), please use --console-address ":PORT" to choose a static port. Exiting on signal: TERMINATED WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated. Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD Waiting for all MinIO sub-systems to be initialized.. lock acquired Verifying if 1 bucket is consistent across drives... Automatically configured API requests per node based on available memory on the system: 69 All MinIO sub-systems initialized successfully Waiting for all MinIO IAM sub-system to be initialized.. lock acquired Status: 8 Online, 0 Offline. API: http://10.10.63.71:9000
4.启动成功后访问4个节点中的任何节点都可以进入管理后台,并且在任何节点上传文件MINIO集群会自动同步数据,但是只有在线节点数量>n/2+1是,MINIO集群才能正常使用。
原文链接:https://blog.csdn.net/z_xiaozhuo/article/details/122368000
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/7529