Chia-Hung Yeh 2023-08-25 17:48 采纳率: 0%
浏览 106
已结题

Docker容器部署第二个minio服务报错,提示端口被占用了

docker环境下部署minio分布式集群,在服务器上无法部署第二个minio,如果有了解这个的,麻烦帮忙解决一下,谢谢!

  • 第一个minio的部署命令
docker run -d -p 9000:9000 -p 9090:9090 \
--name=minio-1 \
--restart=always \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
-v /data/app/minio1/data1:/data1 \
-v /data/app/minio1/data2:/data2 \
-v /data/app/minio1/data3:/data3 \
-v /data/app/minio1/data4:/data4 \
-v /data/app/minio1/data5:/data5 \
-v /data/app/minio1/data6:/data6 \
-v /data/app/minio1/data7:/data7 \
-v /data/app/minio1/data8:/data8 \
-v /data/app/minio1/config:/root/.minio \
--network host \
--hostname "host1" \
minio/minio:latest server \
http://172.16.19.223:9000/data{1...8} \
http://172.16.19.223:9001/data{1...8} \
http://172.16.19.221:9000/data{1...8} \
http://172.16.19.221:9001/data{1...8} \
--console-address ":9090" 
  • 第二个minio的部署命令
docker run -d -p 9001:9001 -p 9091:9091 \
--name=minio-2 \
--restart=always \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
-v /data/app/minio2/data1:/data1 \
-v /data/app/minio2/data2:/data2 \
-v /data/app/minio2/data3:/data3 \
-v /data/app/minio2/data4:/data4 \
-v /data/app/minio2/data5:/data5 \
-v /data/app/minio2/data6:/data6 \
-v /data/app/minio2/data7:/data7 \
-v /data/app/minio2/data8:/data8 \
-v /data/app/minio2/config:/root/.minio \
--network host \
--hostname "host2" \
minio/minio:latest server \
http://172.16.19.223:9000/data{1...8} \
http://172.16.19.223:9001/data{1...8} \
http://172.16.19.221:9000/data{1...8} \
http://172.16.19.221:9001/data{1...8} \
--console-address ":9091"
  • 完成部署后第一个minio服务正常的,但是第二个就报错了

[root@server223 ~]# docker logs -f minio-2
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
ERROR Unable to start the server: Specified port is already in use
      > Please ensure no other program uses the same address/port
  • 查看端口被占用情况

[root@server223 ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      11021/minio
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      757/rpcbind
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1495/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1138/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1137/cupsd
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      16218/sshd: root@pt
tcp6       0      0 :::10912                :::*                    LISTEN      1887/java
tcp6       0      0 :::9000                 :::*                    LISTEN      11021/minio
tcp6       0      0 ::1:9000                :::*                    LISTEN      11021/minio
tcp6       0      0 :::111                  :::*                    LISTEN      757/rpcbind
tcp6       0      0 :::9876                 :::*                    LISTEN      1855/java
tcp6       0      0 :::22                   :::*                    LISTEN      1138/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      1137/cupsd
tcp6       0      0 ::1:6010                :::*                    LISTEN      16218/sshd: root@pt
tcp6       0      0 :::10909                :::*                    LISTEN      1887/java
tcp6       0      0 :::10911                :::*                    LISTEN      1887/java

如果有了解这个的,麻烦帮忙解决一下,谢谢!

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-08-25 23:18
    关注

    【以下回答由 GPT 生成】

    由于第一个minio服务已经占用了9000和9090端口,导致第二个minio服务无法运行。解决这个问题的方法有两种:

    1. 更改第二个minio服务的端口:
      • 修改第二个minio服务的部署命令中的端口参数,将-p 9001:9001 -p 9091:9091修改为其他未被占用的端口,例如-p 9002:9000 -p 9092:9090
      • 修改第二个minio服务的部署命令,将http://172.16.19.223:9001http://172.16.19.221:9001中的端口号 9001 修改为新的端口号,例如 9002
      • 运行修改后的第二个minio容器部署命令。

    shell docker run -d -p 9002:9000 -p 9092:9090 \ --name=minio-2 \ --restart=always \ -e "MINIO_ROOT_USER=minioadmin" \ -e "MINIO_ROOT_PASSWORD=minioadmin" \ -v /data/app/minio2/data1:/data1 \ -v /data/app/minio2/data2:/data2 \ -v /data/app/minio2/data3:/data3 \ -v /data/app/minio2/data4:/data4 \ -v /data/app/minio2/data5:/data5 \ -v /data/app/minio2/data6:/data6 \ -v /data/app/minio2/data7:/data7 \ -v /data/app/minio2/data8:/data8 \ -v /data/app/minio2/config:/root/.minio \ --network host \ --hostname "host2" \ minio/minio:latest server \ http://172.16.19.223:9000/data{1...8} \ http://172.16.19.223:9002/data{1...8} \ http://172.16.19.221:9000/data{1...8} \ http://172.16.19.221:9002/data{1...8} \ --console-address ":9092"

    1. 使用docker-compose管理容器:
    2. 创建一个docker-compose.yml文件,写入以下内容:

    ```yaml version: '3'

    services: minio-1: image: minio/minio:latest container_name: minio-1 restart: always environment: - MINIO_ROOT_USER=minioadmin - MINIO_ROOT_PASSWORD=minioadmin volumes: - /data/app/minio1/data1:/data1 - /data/app/minio1/data2:/data2 - /data/app/minio1/data3:/data3 - /data/app/minio1/data4:/data4 - /data/app/minio1/data5:/data5 - /data/app/minio1/data6:/data6 - /data/app/minio1/data7:/data7 - /data/app/minio1/data8:/data8 - /data/app/minio1/config:/root/.minio networks: - minio-network command: server http://172.16.19.223:9000/data{1...8} http://172.16.19.223:9001/data{1...8} http://172.16.19.221:9000/data{1...8} http://172.16.19.221:9001/data{1...8} --console-address ":9090"

    minio-2:
      image: minio/minio:latest
      container_name: minio-2
      restart: always
      environment:
        - MINIO_ROOT_USER=minioadmin
        - MINIO_ROOT_PASSWORD=minioadmin
      volumes:
        - /data/app/minio2/data1:/data1
        - /data/app/minio2/data2:/data2
        - /data/app/minio2/data3:/data3
        - /data/app/minio2/data4:/data4
        - /data/app/minio2/data5:/data5
        - /data/app/minio2/data6:/data6
        - /data/app/minio2/data7:/data7
        - /data/app/minio2/data8:/data8
        - /data/app/minio2/config:/root/.minio
      networks:
        - minio-network
      command: server http://172.16.19.223:9000/data{1...8} http://172.16.19.223:9002/data{1...8} http://172.16.19.221:9000/data{1...8} http://172.16.19.221:9002/data{1...8} --console-address ":9091"
    

    networks: minio-network: `` - 运行docker-compose up -d`命令启动docker容器。



    【相关推荐】



    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 9月6日
  • 创建了问题 8月25日

悬赏问题

  • ¥15 angular项目错误
  • ¥20 需要帮我远程操控一下,运行一下我的那个代码,我觉得我无能为力了
  • ¥20 有偿:在ubuntu上安装arduino以及其常用库文件。
  • ¥15 请问用arcgis处理一些数据和图形,通常里面有一个根据点划泰森多边形的命令,直接划的弊端是只能执行一个完整的边界,但是我们有时候会用到需要在有很多边界内利用点来执行划泰森多边形的命令
  • ¥30 在wave2foam中执行setWaveField时遇到了如下的浮点异常问题,请问该如何解决呢?
  • ¥750 关于一道数论方面的问题,求解答!(关键词-数学方法)
  • ¥200 csgo2的viewmatrix值是否还有别的获取方式
  • ¥15 Stable Diffusion,用Ebsynth utility在视频选帧图重绘,第一步报错,蒙版和帧图没法生成,怎么处理啊
  • ¥15 请把下列每一行代码完整地读懂并注释出来
  • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件