解决minio启动和上传接口错误:Unable to initializi server、Non-XML response from server

前言

MinIO 是在 GNU Affero 通用公共许可证 v3.0 下发布的高性能对象存储。 它是与 Amazon S3 云存储服务兼容的 API。 使用 MinIO 为机器学习、分析和应用程序数据工作负载构建高性能基础架构。

需求背景

公司搞来了几台新的服务器,需要重新部署项目,公司使用minio做为文件存储服务。

问题发现

部署minio启动时报错:
在这里插入图片描述

启动后,通过调用api接口方式上传文件报错:io.minio.errors.InvalidResponseException: Non-XML response from server,以为是版本问题,重装多个版本也未解决,现将解决办法记录。
在这里插入图片描述

解决指南

minio启动报:Unable to initialize server switching into safe-mode: Unable to initialize sub-systems: Credentials missing

项目启动时,会有一个data目录

./minio server /usr/local/minio_new/data

实际上就是这个文件已经存在了,无法在进行初始了,只要把这个目录的文件删了就行。

minio上传报:io.minio.errors.InvalidResponseException: Non-XML response from server

由于minio默认端口为9000,但项目中端口已被占用,所以改为指定端口去启动的,通过后台方式启动命令如下:

nohup /usr/local/minio_new/minio server /usr/local/minio_new/data --address 0.0.0.0:60053 --console-address ":22122" > /usr/local/minio_new/data/minio.log 2>&1 &

启动后,发现api有个单独的端口,恍然大悟,发现请求路径的host端口是9000,改为指定端口60053即可,如图:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_39940674/article/details/119992401