docker安装minio集群

docker安装minio集群

文章目录

    • docker安装minio集群
      • 1、所有节点配置主机名解析
      • 2、配置时间同步,关闭防火墙和selinux。
      • 3、所有节点安装docker
      • 4、部署minio集群,3个节点每个节点挂载2个目录
        • 10.20.138.52
        • 10.20.138.53
        • 10.20.138.54
      • 5、访问任意节点的9000端口测试

1、所有节点配置主机名解析

# cat >> /etc/hosts << EOF
10.20.138.52 minio-1
10.20.138.53 minio-2
10.20.138.54 minio-3
EOF

2、配置时间同步,关闭防火墙和selinux。

3、所有节点安装docker

# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# yum -y install docker-ce docker-compose -y
# systemctl enable --now docker

4、部署minio集群,3个节点每个节点挂载2个目录

10.20.138.52
# mkdir -p /apps/minio
# mkdir -p /data/minio/{data1,data2}
# cd /apps/minio/
# vi  docker-compose.yaml
version: "3"
services:
  minio:
    image: minio/minio
    network_mode: "host"
    restart: always
    entrypoint:
      - sh
      - -euc
      - |
        mkdir -p /data1 && \
        mkdir -p /data2 &&
        minio server --address 10.20.138.52:9000 http://minio-{1...3}/data{1...2}
    environment:
      - MINIO_ACCESS_KEY=admin
      - MINIO_SECRET_KEY=xx
      - MINIO_PROMETHEUS_AUTH_TYPE=public
      - MINIO_UPDATE=off
    #ports:
    #  - "9000:9000"
    volumes:
      - /data/minio/data1:/data1
      - /data/minio/data2:/data2
      - /etc/hosts:/etc/hosts:ro
      
# docker-compose  up -d
# docker-compose  ps
    Name                   Command               State   Ports
--------------------------------------------------------------
minio_minio_1   sh -euc mkdir -p /data1 && ...   Up
# docker logs -f minio_minio_1
WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
         Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance
Waiting for all MinIO sub-systems to be initialized.. lock acquired
Automatically configured API requests per node based on available memory on the system: 216
All MinIO sub-systems initialized successfully in 168.003057ms
MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 
Version: RELEASE.2022-12-12T19-27-27Z (go1.19.4 linux/amd64)

Status:         6 Online, 0 Offline.
API: http://10.20.138.54:9000
Console: http://10.20.138.54:36709 http://172.17.0.1:36709 http://127.0.0.1:36709

Documentation: https://min.io/docs/minio/linux/index.html
10.20.138.53
# mkdir -p /apps/minio
# mkdir -p /data/minio/{data1,data2}
# cd /apps/minio/
# vi  docker-compose.yaml
version: "3"
services:
  minio:
    image: minio/minio
    network_mode: "host"
    restart: always
    entrypoint:
      - sh
      - -euc
      - |
        mkdir -p /data1 && \
        mkdir -p /data2 &&
        minio server --address 10.20.138.53:9000 http://minio-{1...3}/data{1...2}
    environment:
      - MINIO_ACCESS_KEY=admin
      - MINIO_SECRET_KEY=xx
      - MINIO_PROMETHEUS_AUTH_TYPE=public
      - MINIO_UPDATE=off
    #ports:
    #  - "9000:9000"
    volumes:
      - /data/minio/data1:/data1
      - /data/minio/data2:/data2
      - /etc/hosts:/etc/hosts:ro
  
# docker-compose  up -d
# docker-compose  ps
    Name                   Command               State   Ports
--------------------------------------------------------------
minio_minio_1   sh -euc mkdir -p /data1 && ...   Up
# docker logs -f minio_minio_1
WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
         Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance
Waiting for all MinIO sub-systems to be initialized.. lock acquired
Automatically configured API requests per node based on available memory on the system: 216
All MinIO sub-systems initialized successfully in 168.003057ms
MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 
Version: RELEASE.2022-12-12T19-27-27Z (go1.19.4 linux/amd64)

Status:         6 Online, 0 Offline.
API: http://10.20.138.54:9000
Console: http://10.20.138.54:36709 http://172.17.0.1:36709 http://127.0.0.1:36709

Documentation: https://min.io/docs/minio/linux/index.html
10.20.138.54
# mkdir -p /apps/minio
# mkdir -p /data/minio/{data1,data2}
# cd /apps/minio/
# vi  docker-compose.yaml
version: "3"
services:
  minio:
    image: minio/minio
    network_mode: "host"
    restart: always
    entrypoint:
      - sh
      - -euc
      - |
        mkdir -p /data1 && \
        mkdir -p /data2 &&
        minio server --address 10.20.138.54:9000 http://minio-{1...3}/data{1...2}
    environment:
      - MINIO_ACCESS_KEY=admin
      - MINIO_SECRET_KEY=xx
      - MINIO_PROMETHEUS_AUTH_TYPE=public
      - MINIO_UPDATE=off
    #ports:
    #  - "9000:9000"
    volumes:
      - /data/minio/data1:/data1
      - /data/minio/data2:/data2
      - /etc/hosts:/etc/hosts:ro
      
# docker-compose  up -d
# docker-compose  ps
    Name                   Command               State   Ports
--------------------------------------------------------------
minio_minio_1   sh -euc mkdir -p /data1 && ...   Up

# docker logs -f minio_minio_1
WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
         Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance
Waiting for all MinIO sub-systems to be initialized.. lock acquired
Automatically configured API requests per node based on available memory on the system: 216
All MinIO sub-systems initialized successfully in 168.003057ms
MinIO Object Storage Server
Copyright: 2015-2022 MinIO, Inc.
License: GNU AGPLv3 
Version: RELEASE.2022-12-12T19-27-27Z (go1.19.4 linux/amd64)

Status:         6 Online, 0 Offline.
API: http://10.20.138.54:9000
Console: http://10.20.138.54:36709 http://172.17.0.1:36709 http://127.0.0.1:36709

Documentation: https://min.io/docs/minio/linux/index.html

5、访问任意节点的9000端口测试

输入:账户:admin / 密码:xx

docker安装minio集群_第1张图片

你可能感兴趣的:(运维,minIO)