目录
问题原因:
需要设置静态port,不然访问不了。并且将静态端口开放
9000端口访问后会立即自动跳转到静态端口,这也是需要配置静态端口并开放防火墙的原因
如果不设静态端口不会报错,会有警告,但最终也会导致不能访问minio界面
解决办法:
端口修改
开放端口
firewall-cmd --zone=public --add-port=9000/tcp -permanent firewall-cmd --zone=public --add-port=9999/tcp -permanent firewall-cmd --reload
禁用端口
启动命令修改
单独部署
/opt/minio/minio server --console-address '0.0.0.0:9999' /opt/minio/data/
运行容器
docker run -p 9090:9000 --name minio \ -d --restart=always \ -e MINIO_ACCESS_KEY=minio \ -e MINIO_SECRET_KEY=minio@321 \ -v /data/docker/minio/data:/data \ -v /data/docker/minio/config:/root/.minio \ minio/minio server /data \ --console-address ":9000" --address ":9090"
容器编排(docker-compose)
version: '3.7' services: minio: image: minio/minio:RELEASE.2021-07-30T00-02-00Z container_name: minio ports: - "9000:9000" - "9009:9009" restart: always command: server /data --console-address ":9009" environment: MINIO_ROOT_USER: minioa MINIO_ROOT_PASSWORD: minio123 logging: options: max-size: "50M" # 最大文件上传限制 max-file: "10" driver: json-file volumes: - ${MINIO_DATA_DIR}:/data # 映射文件路径 - /etc/localtime:/etc/localtime:ro - /etc/timezone/timezone:/etc/timezone:ro healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] interval: 30s timeout: 20s retries: 3
参考链接:
https://docs.min.io/docs/deploy-minio-on-docker-compose.html