brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Feb 24. 2020

208. Storage Gateway 사용해보자

IDC 데이터를 Storage Gateway 사용해 S3에 올려보자

 Storage Gateway

<1> IDC에 있는 데이터를 Storage Gateway서비스를 이용해 AWS S3 에 올려보자.

<2>  Storage Gateway 생성

<3>  s3 생성

<4> 확인하기




<1> IDC에 있는 데이터를 Storage Gateway서비스를 이용해 AWS S3 에 올려보자.


다음은 리눅스 서버로 마운트해서 AWS S3와 동기화 하는 방법이다.


<2>  Storage Gateway 생성


1

Storage Gateway  >  시작하기


Amazon S3 File Gateway



2

Amazone EC2  하나 생성

> Lanunch Instance (인스턴스 실행)

m4.xlarge

서브넷 : public zone에 구축 

퍼블릭 IP자동할당 : 활성화

새볼륨 추가 : EBS 150G

새보안그룹 생성 : launch-wizard-1   /  ssh 위치무관 / http 위치무관 / NFS  위치무관   (중요)

새키 :  StorageGateway

공인IP 확인  >   서버에 접속해보기


Choose "Launch instance" button above to be directed to the Amazon EC2 console.

On "Choose an Instance Type" we recommend "m4.xlarge" instance type.

On "Configure Instance Details" set "Auto-assign Public IP" to "Enable" if your instance needs to be accessible from the Internet.

On "Add Storage" choose "Add New Volume" to create a local disk for cache.

On "Add Tags" optionally tag your instance.

On "Configure Security Group" add firewall rules to allow clients to connect to your instance.

 Storage Gateway

 Minimally this includes TCP 2049 for NFS.

Continue to review and then "Launch" your instance.

In "View Instances" note the IP address of the new instance.



3

Service endpoint  = 퍼블릭



4

게이트웨이 연결 

EC2 의 공인 IP 를 입력한다.


로그 그룹 생성



5

만들어 지는데 30분 걸린다.




6

스토리지 게이트웨이 접속

putty로 접속해본다.

login as : admin 

admin으로 접속 한다.







<3>  s3 생성


1

up11.serverchk.com 생성




2.  Storage Gateway >  파일 공유 생성


1) S3 버킷이름 :   up11.serverchk.com 


2) 허용된 클라이언트

특정 IP 블럭만 접속 하도록 설정 : 

172.31.0.0/16  10.0.0.0/8   에서만 접속 되도록 설정 가능하다. 




4.  리눅스 서버에 접속하여 마운트 하기 




root@ip]# ping  10.0.100.95


root@ip]# mkdir /root/nfs


[root@ip# mount  -t  nfs  -o  nolock,hard   10.0.100.95:/up13.serverchk.com   /root/nfs






<4> 확인하기


1) 마운트 디렉토리에 파일 생성해보기



2) S3 스토리지에 만든 파일이 자동으로 올라와 있다.

자동 동기화 된다.




6. 추가 정보  : 설정법

https://docs.aws.amazon.com/ko_kr/storagegateway/latest/userguide/create-gateway-file.html#ec2-gateway-file


https://docs.aws.amazon.com/storagegateway/latest/userguide/create-gateway-file.html


https://docs.aws.amazon.com/storagegateway/latest/userguide/CreatingAnNFSFileShare.html



7.   추가정보  : 프록시 설정

https://docs.aws.amazon.com/ko_kr/storagegateway/latest/userguide/gateway-private-link.html#GettingStartedBeginActivateGateway-file-vpc



8. 추가정보 :  Public이외   VPC 에서만 사용하는 경우 

S3 Endpoint를 잡아줘야 한다.

https://docs.aws.amazon.com/ko_kr/storagegateway/latest/userguide/gateway-private-link.html



https://docs.aws.amazon.com/storagegateway/latest/userguide/gateway-private-link.html#GettingStartedBeginActivateGateway-file-vpc



감사합니다.

매거진의 이전글 207. Landing zone 빠르게 알아보자.
작품 선택
키워드 선택 0 / 3 0
댓글여부
afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari