[ 1. EBS : Elastic Block Store ]

EC2 는 제거될 때 root volume 이 함께 제거된다.

EBS 는 명칭만 다를뿐 NAS 와 유사

- An EC2 machine loses its root volume (main drive) when it is manually terminated.

- Unexpected terminations might happen from time to time (AWS would email you)

- Sometimes, you need a way to store your instance data somewhere

- An EBS Volume is a network drive you can attach to your instances while they run

- It allows your instances to persist data

 

[ EBS Volume ]

내장 물리디스크가 아닌 네트워크 드라이브

서버 러닝중에도 제거/추가가 가능

AZ간 이동시 snapshot 생성을 통해 이동이 가능

- It's a network drive (not a physical drive)

  -- It uses the network to communicate the instance, which means there might be a bit of latency

  -- It can be detached from an EC2 instance and attached to another one quickly

- It's locked to an AZ

  -- To move a volume across, you first need to snapshot it

- Have a provisioned capacity (size in GBs, and IOPS(I/O Ops Per Sec))

  -- You get billed for all the provisioned capacity

 

[ EBS Volume Types ]

EBS Volume 은 세가지 유형이 존재

- EBS Volumes are characterized in Size/Throughput/IOPS (I/O Ops Per Sec)

- Only GP2 and IO1 can be used as boot volumes

1) IO1 (SSD)

고성능 SSD volume

Highest-performance SSD volume for mission-critical low-latency or high-throughput workloads

- Critical business applications that require sustained IOPS performance, or more than 16000 IOPS per volume (GP2 limit)

- for Large database workloads (eg. MongoDB, Oracle, MySql)

  * GB range : 4GB ~ 16TB

  * MIN IOPS : 100

  * MAX IOPS : 64000 (for Nitro instances) or 32000 (other instances)

  * GB per IOPS : 50 IOPS per GB

 

2) GP2 (SSD)

일반 용도의 SSD Volume

General Purpose SSD volume that balances price and performance for a wide variety of workloads

- Recommended for most workloads

- System boot volumes

- Virtual desktops

- Low-latency interactive apps

- Development and test environments

  * GB range : 1GB ~ 16TB (Small GP2 volumes can burst IOPS to 3000)

  * MAX IOPS : 16000 

  * GB per IOPS : 3IOPS per GB (means at 5334GB are at the max IOPS)

 

3) ST1 (HDD)

저가형 HDD Volume

Low cost HDD volume designed for frequently accessed, throughput-intensive workloads

- Streaming workloads requiring consistent, fast throughput at a low price

- Big Data, Data warehouses, Log processing

- Apache Kafka

- Cannot be a boot volume

  * GB range : 500GB ~ 16TB

  * MIN IOPS : 500

  * MAX throughput : 500MB/s (can burst)

 

4) SC1 (HDD)

최저가형 HDD Volume

Lowest cost HDD volume designed for less frequently accessed workloads

- Throughput-oriented storage for large volumes of data that is infrequently accessed

- Scenarios where the lowest storage cost is important

- Cannot be a boot volume

  * GB range : 500GB ~ 16TB

  * MIN IOPS : 250

  * MAX throughput : 250MB/s (can burst)

 

[ # Hands-On ]

1. How to mount

1) EBS volume 생성 : EC2 Instance 생성시 Step 4 Add Storage 에서 EBS 설정이 가능

2) 마운트 상태 확인

> lsblk 

3) 드라이브에 파일시스템 존재여부 확인

> sudo file -s /dev/{drivename}

4) 파일시스템 생성

> sudo mkfs -t ext4 /dev/{drivename}

5) 경로 생성

> sudo mkdir /data

6) 마운트 시키기

> sudo mount /dev/xvdb /data

7) 마운트 확인

> lsblk

8) 마운트 된 경로에 마운트 테스트용 파일 생성

> sudo touch /data/hello.txt

9) fstab 수정

> sudo nano /etc/fstab 

/dev/{drivename} /data ext4 defaults,nofail 0 2     (현재 마운트 정보 입력 참고)

* fstab : 파일시스템 테이블. 시스템이 리부팅되어도 이곳에 마운트 정보가 남아있어 자동으로 부팅시 마운트됨. 

10) 파일시스템 확인

> sudo file -s /dev/{drivename}

 

2. unmount

> sudo umount /data

 

3. fstab 이 설정 된 이후 mount

> sudo mount -a

반응형

+ Recent posts