Object Stroage Client Tool - s3fs

 

s3fs 설치하기


 # Ubutnu 18.04 

1. 필수 패키지 및 awscli 설치

sudo apt-get update && apt-get install awscli

sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config

 

 


2. s3fs 다운로드 및 컴파일

github 파일 다운로드

git clone https://github.com/s3fs-fuse/s3fs-fuse.git

 

s3fs 빌드

cd s3fs-fuse

./autogen.sh

./configure

make

 

바이너리 설치

sudo make install

 

 

 

 

3. 보안 자격 증명 생성

보안 자격 증명 생성하기  

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs

*   

권한변경

chmod 600 /etc/passwd-s3fs 

 

 

 

4.  버킷 마운트 

마운트 대상 디렉토리 생성

sudo mkdir ~/s3fs

 

버킷 마운트 
s3fs [myS3Bucket] ~/s3fs -o passwd_file=/etc/passwd-s3fs -o use_path_request_style -o url=https://kr.object.iwinv.kr

* ~/s3fst 는 메뉴얼상의 마운트 포인트로 해당 위치에 원하는 마운트를 원하는  디렉토리를 입력하시면 됩니다. 

마운트 확인 

df -Th

 

그림과 같이 s3fs로 마운트 된것을 확인 할 수 있습니다. 

 

 

4.  기본 사용법

 ## 기본 사용법은 Ubuntu , CentOS 모두 동일합니다. 

 

# 리스트 확인

ls -al  [S3Uri]

 

# 업로드 

cp   [LocalPath]  [S3Uri]

 

 

# 다운로드 

cp  [S3Uri]  [LocalPath]

 

# 삭제 

rm   [S3Uri] 

 

  

 

 

 # CentOS 7.X

1. 필수 패키지설치

yum install epel-release

yum install automake git gcc gcc-c++ libxml2-devel libcurl-devel fuse-devel libssh2-devel

 

 


2. s3fs 다운로드 및 컴파일

github 파일 다운로드

git clone https://github.com/s3fs-fuse/s3fs-fuse.git

 

s3fs 빌드

cd s3fs-fuse

./autogen.sh

./configure

make

 

바이너리 설치

sudo make install

 

 

 

 

3. 보안 자격 증명 생성

보안 자격 증명 생성하기  

echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > /etc/passwd-s3fs

*   

권한변경

chmod 600 /etc/passwd-s3fs 

 

 

 

4.  버킷 마운트 

마운트 대상 디렉토리 생성

sudo mkdir ~/s3fs

 

버킷 마운트 
/usr/bin/s3fs [myS3Bucket] ~/s3fs -o passwd_file=/etc/passwd-s3fs -o use_path_request_style -o url=https://kr.object.iwinv.kr

~/s3fs 는 메뉴얼상의 마운트 포인트로 해당 위치에 원하는 마운트를 원하는  디렉토리를 입력하시면 됩니다

마운트 확인 

df -Th

그림과 같이 s3fs로 마운트 된것을 확인 할 수 있습니다. 

 

 

====================================== s3fs mount command ====================================== 

rsudo s3fs 버킷명 /마운트디렉토리 \ 

-o passwd_file=$HOME/.passwd-s3fs \ 

-o url=https://네임스페이스.compat.objectstorage.a...

-o allow_other  \ 

-o nomultipart 

-o use_path_request_style 


======================================== /etc/fstab 등록 양식 ======================================== 

s3fs#TEST /object fuse _netdev,allow_other,passwd_file=/home/opc/.passwd-s3fs,use_path_request_style,url=https://Your_NameSpace.compat.objectstorage.ap-seoul-1.oraclecloud.com/ 0 0 


===================================== umount =============================================================

fusermount -u /object


chown -R nginx:nginx s3fs
0
0
이 글을 페이스북으로 퍼가기 이 글을 트위터로 퍼가기 이 글을 카카오스토리로 퍼가기 이 글을 밴드로 퍼가기

Cloud

번호 제목 글쓴이 날짜 조회수
2 Object Stroage Client Tool - s3fs 관리자 05-14 95
1 PHP S3 EXAMPLES 관리자 05-09 121