«   2025/02   »
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
Recent Posts
Today
Total
02-26 14:41
300x250
관리 메뉴

변군이글루(Mirror)

aws ec2 인스턴스(Amazon Linux 2)에 goofys를 설치하고 S3 버킷을 마운트하는 방법 본문

퍼블릭 클라우드

aws ec2 인스턴스(Amazon Linux 2)에 goofys를 설치하고 S3 버킷을 마운트하는 방법

변군Dev 2023. 8. 11. 13:04
728x90

aws ec2 인스턴스(Amazon Linux 2)에 goofys를 설치하고 S3 버킷을 마운트하는 방법

테스트 환경

$ cat /etc/os-release | grep "PRETTY_NAME"
PRETTY_NAME="Amazon Linux 2"
  • FUSE 설치
    • Goofys는 FUSE를 기반으로 작동하므로 FUSE를 설치해야 합니다.
    • fuse 패키지 설치
sudo yum install -y fuse

Goofys 설치

Goofys를 Ubuntu 인스턴스에 설치합니다. Goofys는 Go 언어로 작성되었으며, Go 언어가 먼저 설치되어 있어야 합니다.

  • Go 언어를 설치
sudo yum install -y golang

Go 언어가 설치되었다면, Goofys를 소스 코드를 사용하여 빌드하고 설치합니다.

  • Goofys 다운로드 및 설치
cd /usr/local/src
wget https://github.com/kahing/goofys/releases/download/v0.24.0/goofys
sudo chmod +x goofys
sudo mv goofys /usr/local/bin/
goofys --version
$ goofys --version
goofys version 0.24.0-45b8d78375af1b24604439d2e60c567654bcdf88
728x90

S3 버킷 마운트

Goofys를 사용하여 S3 버킷을 마운트합니다.

  • 마운트할 디렉토리 생성(마운트 포인트 생성)
mkdir /awsS3
  • goofys를 사용하여 S3 버킷 마운트
sudo goofys my-bucket /awsS3
  • 마운트 해제
umount /awsS3
  • fstab 편집
vim /etc/fstab
#aws s3 buckets
goofys#es-data /awss3/es-data fuse _netdev,allow_other 0 0
  • uid, gid 설정하는 방법
goofys#s3://my-bucket /mnt/s3 fuse _netdev,allow_other,--uid=1000,--gid=1000 0 0
  • 마운트 실행
    • /etc/fstab 파일에 등록된 파일 시스템 정보를 확인하고, 설정되어 있는 파일 시스템을 순차적으로 마운트합니다.
mount -av

 

참고URL

- github : https://github.com/kahing/goofys

 

728x90