티스토리 뷰

MinIO는 고가용성을 확보하기 위해 Distributed mode를 지원한다. 그래서 운영환경에서 MinIO를 사용하기 위해서는 Distributed mode가 필요하다. 이를 구성하기 위해 별다른 복잡한 기술이 필요한게 아니라 기존에 설정했던것에 매개변수 정도 추가하면 간단히 구성이 가능하다. 

 

minio distributed mode architecture

MinIO의 distributed mode architecture 이다. 파일이 들어오면 이것을 여러개의 서버에 분산해서 저장을 하는 것이다. 이로인해 이 서버중 한대가 장애가 난다 하더라도 계속해서 이용을 할 수가 있다. 물론 서버와 disk의 투자가 필요하다. 


구성방법

Distributed mode 구성에 앞서 지난번에 포스팅한 MinIO 실행 스크립트를 한번 살펴보자. 실수를 방지하기 위해서 그냥 실행명령을 사용하는것보다는 실행 스크립트를 만들고 이를 실행시키는것이 좋다. 

 

MinIO startup.sh

#!/bin/bash

LOG_FILE="$PWD/logs/minio.log"

export MINIO_ACCESS_KEY=minioadmin
export MINIO_SECRET_KEY=minioadmin

./minio server --address :9000 /app/minio/sample/data >> $LOG_FILE 2>&1 &

MINIO_PID=$!

if [ ! -z $MINIO_PID ] ; then
    echo "$MINIO_PID" > minio.pid
fi

이중 가장 핵심인 부분은 ./minio server 로 시작하는 MinIO 실행 부분이다. 이 부분만 변경을 해주면 된다.

 

MinIO startup.sh (Distributed mode 적용)

#!/bin/bash

LOG_FILE="$PWD/logs/minio.log"

export MINIO_ACCESS_KEY=minioadmin
export MINIO_SECRET_KEY=minioadmin

./minio server --address :9000 http://xxx.xxx.xxx.11/app/minio/sample/data http://xxx.xxx.xxx.12/app/minio/sample/data http://xxx.xxx.xxx.13/app/minio/sample/data http://xxx.xxx.xxx.14/app/minio/sample/data >> $LOG_FILE

MINIO_PID=$!

if [ ! -z $MINIO_PID ] ; then
    echo "$MINIO_PID" > minio.pid
fi

위와 같이 http://xxx.xxx.xxx.11, http://xxx.xxx.xxx.12, http://xxx.xxx.xxx.13, http://xxx.xxx.xxx.14 이런식으로 Clustering할 서버의 목록을 추가해준다. 이게 끝이다. 

 

각 서버에 모두 동일하게 MinIO를 설치하고 위와 같이 설정을 한다.  아래 주의사항에도 나와있지만 이렇게 구성을 할때 MINIO_ACCESS_KEY, MINIO_SECRET_KEY는 모두 동일하게 설정해줘야 한다. 또한 당연한 얘기지만 모든 노드는 동일한 운영체제, 동일한 디스크의 수, 네트워크 상호 연결이 동종인것이 좋다. 

 

이렇게 모든 준비가 끝났다면 한대씩 기동을 해보자. 운영서버이므로 기동은 Service에 등록을 해서 사용을 하도록 하자. 실수도 줄여주고 OS가 재시작할 경우 자동 재시작을 위해서다. Service에 등록을 하는 방법은 여기를 참고하도록 하자. 

 

minio waiting for a minimum of 2 disks to come online

로그파일을 살펴보면 minio waiting for a minimum of 2 disks to come online 이런 메세지가 나오고 있다. 이것은 오류가 난것이 아니고 연결할 다른 disk를 기다리고 있는 것이다. 필자의 경우는 4개의 노드에 분산을 했는데 모든 노드에서 시작이 완료 되었다면 마지막 서버에는 다음과 같은 로그가 출력이 된다. 

 

minio sub-systems initialized

MinIO Distributed mode 가 성공적으로 구성이 되었고 Endpoint를 통해서 접근을 해서 이용을 할 수 있다. 

 

주의할점

  • All the nodes running distributed MinIO need to have same access key and secret key for the nodes to connect. To achieve this, it is recommended to export access key and secret key as environment variables, MINIO_ACCESS_KEY and MINIO_SECRET_KEY, on all the nodes before executing MinIO server command.
  • MinIO creates erasure-coding sets of 4 to 16 drives per set. The number of drives you provide in total must be a multiple of one of those numbers.
  • __MinIO chooses the largest EC set size which divides into the total number of drives or total number of nodes given - making sure to keep the uniform distribution i.e each node participates equal number of drives per set.
  • Each object is written to a single EC set, and therefore is spread over no more than 16 drives.
  • All the nodes running distributed MinIO setup are recommended to be homogeneous, i.e. same operating system, same number of disks and same network interconnects.
  • MinIO distributed mode requires fresh directories. If required, the drives can be shared with other applications. You can do this by using a sub-directory exclusive to MinIO. For example, if you have mounted your volume under /export, pass /export/data as arguments to MinIO server.
  • The IP addresses and drive paths below are for demonstration purposes only, you need to replace these with the actual IP addresses and drive paths/folders.
  • Servers running distributed MinIO instances should be less than 15 minutes apart. You can enable NTP service as a best practice to ensure same times across servers.
  • MINIO_DOMAIN environment variable should be defined and exported for bucket DNS style support.
  • Running Distributed MinIO on Windows operating system is experimental. Please proceed with caution.

 

참고 : docs.min.io/docs/distributed-minio-quickstart-guide.html

 

MinIO | Learn more about Deploying MinIO in Distributed Mode

Distributed MinIO Quickstart Guide MinIO in distributed mode lets you pool multiple drives (even on different machines) into a single object storage server. As drives are distributed across several nodes, distributed MinIO can withstand multiple node failu

docs.min.io

끝!

 

댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30