云服务器 Flexus X 实例,Docker 集成搭建 MinIO
MinIO 是一款高性能、开源的分布式对象存储系统,专为云原生和容器化环境设计,基于 Go 语言编写,兼容 Amazon S3 API,能够无缝集成到现有的 S3 生态系统中,MinIO 使用分布式架构来存储和管理大规模的非结构化数据,如图片、视频、日志文件等,提供高可用性、可扩展性和数据持久性
华为云端口放行
• 服务器放行对应端口 9000,9001



Docker 安装并配置镜像加速
1、购买华为云 Flexus X 实例
Flexus云服务器X实例-华为云 (huaweicloud.com)
2、docker 安装
yum install -y docker-ce

3、验证 Docker 是否安装成功,启动 docker 服务并设置开机自启动,且查看 docker 状态
docker --versionsystemctl enable dockersystemctl start dockersystemctl status docker

4、docker-ce 下载
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo

5、路径/etc/yum.repos.d 修改配置文件
[docker-ce-stable]name=Docker CE Stable - $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/stableenabled=1gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-stable-debuginfo]name=Docker CE Stable - Debuginfo $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/stableenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-stable-source]name=Docker CE Stable - Sourcesbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/stableenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-test]name=Docker CE Test - $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/testenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-test-debuginfo]name=Docker CE Test - Debuginfo $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/testenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-test-source]name=Docker CE Test - Sourcesbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/testenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-nightly]name=Docker CE Nightly - $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/$basearch/nightlyenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-nightly-debuginfo]name=Docker CE Nightly - Debuginfo $basearchbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/debug-$basearch/nightlyenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg[docker-ce-nightly-source]name=Docker CE Nightly - Sourcesbaseurl=https://repo.huaweicloud.com/docker-ce/linux/centos/9.9/source/nightlyenabled=0gpgcheck=1gpgkey=https://repo.huaweicloud.com/docker-ce/linux/centos/gpg

6、清除和构建缓存
yum clean allyum makecache

7、docker 配置镜像加速(在华为云镜像中心可获取自己的镜像加速配置)

8、创建镜像加速配置文件
vim /etc/docker/daemon.json
{"registry-mirrors": [ "https://fd0cfec0ac0d446db7fd9d27e92d4a8e.mirror.swr.myhuaweicloud.com" ]}

9、重新加载配置文件,重新启动 docker,查看是否配置成功
systemctl daemon-reloadsystemctl restart docker.service

10、docker info 查看配置信息,是否配置成功镜像加速
docker info

搭建 MinIO
1、MinIO 镜像拉取
docker pull minio/minio

2、创建挂载目录和上传文件目录
mkdir -p /opt/minio/configmkdir -p /opt/minio/data

3、创建容器并运行
docker run -p 9000:9000 -p 9001:9001 --name minio -d --restart=always -e "MINIO_ACCESS_KEY=minio" -e "MINIO_SECRET_KEY=minio123" -v /opt/minio/data:/data -v /opt/minio/config:/root/.minio minio/minio server /data --console-address ":9001"

4、浏览器地址访问,登录即可,成功搭建

• 搭建 MinIO 之后,可以轻松地存储、管理和访问大规模的非结构化数据,如图片、视频、日志文件等,MinIO 支持分布式部署,能够提供高可用性和数据冗余,确保数据的安全性和持久性
总结

华为云服务器 Flexus X 实例,Docker 集成搭建 MinIO,搭建 MinIO 之后,可以轻松地存储、管理和访问大规模的非结构化数据,如果有用户跟我有一样需求,可以购买华为云服务器来搭建,目前华为云服务器正在优惠期间,性价比非常高!
评论