StoryCode

Minio 란, 설치법(in Ubuntu), minio client (=mc) 사용법

Minio
반응형

참조) https://sarc.io/index.php/cloud/2174-minio

 

A) Minio 란 ?

Minio는 쿠버네티스 네이티브 오브젝트 스토리지 서버로서, 하이브리드 클라우드 환경의 요구사항에 부합하도록 설계되었다. 오픈소스로서 AWS S3 api와 호환되어 쉽게 사용할 수 있으며, go로 작성되어 가벼운 단일 바이너리로 배포 가능하다. mc라는 자체 클라이언트를 제공한다. 빠른 입출력 성능을 갖고 있어 고성능을 요구하 Spark, TensorFlow, Presto 등의 스토리지로 사용 가능하며 Hadoop HDFS를 대체할 수 있다. 

 

B) 설치법

  1) LinuxBrew ( HomeBrew ) 설치후 minio 설치

> sudo apt-get update
> sudo apt-get install build-essential curl file git
> sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
> vi ~/.bashrc
  # 아래 추가
  export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
  export MANPATH="/home/linuxbrew/.linuxbrew/share/man:$MANPATH"
  export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:$INFOPATH"
> source ~/.bashrc
# brew test
> brew isntall hello
  Hello, world .
  
  
  
  
    
  > cd ~
  > brew install minio/stable/minio
  > mkdir -p minio/data
  > cd minio
  > minio server ./data
    API     : http://local ip:9000, minioadmin/ minioadmin
    Console : http://local ip:44403, minioadmin/ minioadmin
    Command-line: https://docs.min.io/docs/minio-client-quickstart-guide
    $ mc alias set myminio http://192.168.202.131:9000 minioadmin minioadmin
    Document : https://doc.min.io

  2) minio client 의 설치

> brew install minio/stable/mc

# minio 상태 보기
> mc alias set minio http://127.0.0.1:9000 minioadmin minioadmin

# http://127.0.0.1:44403 로그인후, ADMIN > Bucket 에서 mytest 같은 빈 버킷하나 생성
# ( 버킷생성하면, "minio server ./data" 의 data 디렉토리에 mytest 가 생성된다 )
> mc ls minio
  /mytest # mytest 버킷이 보인다.
  
# 생성한 버킷은 .mc/config.json 에 저장되며, 이를 수정하면 바뀐다.

C) minio client (=mc) 사용법

https://docs.min.io/docs/minio-client-quickstart-guide.html

alias       set, remove and list aliases in configuration file
ls          list buckets and objects
mb          make a bucket
rb          remove a bucket
cp          copy objects
mirror      synchronize object(s) to a remote site
cat         display object contents
head        display first 'n' lines of an object
pipe        stream STDIN to an object
share       generate URL for temporary access to an object
find        search for objects
sql         run sql queries on objects
stat        show object metadata
mv          move objects
tree        list buckets and objects in a tree format
du          summarize disk usage recursively
retention   set retention for object(s)
legalhold   set legal hold for object(s)
diff        list differences in object name, size, and date between two buckets
rm          remove objects
encrypt    manage bucket encryption config
event       manage object notifications
watch       listen for object notification events
undo        undo PUT/DELETE operations
policy      manage anonymous access to buckets and objects
tag         manage tags for bucket(s) and object(s)
ilm         manage bucket lifecycle
version     manage bucket versioning
replicate   configure server side bucket replication
admin       manage MinIO servers
update      update mc to latest release

 

D) AWS S3 Bucket 을 minio 에 연결하기

  1) IAM 계정 필요

  2) IAM > 사용자 메뉴에서 계정 클릭하여, 보안자격증명 생성 ( ACCESSKEY 와 SECRETKEY 생성 )

  3) S3 에서 아무 버킷하나 ( myuniquebucket ) 생성. ( Bucket 명이 AWS S3 통틀어 Unique 해야 함. )

  4) minio 디렉토리에 .mc / config.json 에서 "s3" 부분에  ACCESSKEY 와 SECRETKEY 을 기록

  5) mc ls s3 하면 myuniquebucket AWS 버킷이 보임.

 

반응형