0%

EC2 Storage

EC2 placement Groups and ENI

EC2 Instance Placement Groups

  • Cluster: cluster instances into a low-latency group in a single availability Zone, in same rack. Great network, big data job that needs to complete fast, high network throughput, one rack fails , all instances fails at the same time
  • Spread: Spreads instances across underlying different hardwares, for critical applications. reduced risk of simultianeous failure becasue intances on different physical hardware limited to 7 instances per AZ per placement group
    • application needs to max high availability
    • Critical applications where each instance must be isolated from failure from each other
  • Partition: partition instances across many different partitions
    • each partition is a rack
    • partitions share different hardwares so failure will not affect in between
    • e.g. HDFS, HBase, Cassangra, Kafka

Elastic Network Interfaces (ENI)

  • Logical component, Virtual network card, use for instances to access network
  • attributes
    • primary private IPv4, one or more secondary IPv4
    • one Elastic IP per private IPv4
    • one Public IPv4
    • one or more security groups
    • A MAC address
  • Bound to a specifica avilability zone (AZ)

EC2 Hibernate

  • Hibernation is a process of after stopping instances, the RAM will be stored in root EBS volume (encrypted). And this makes next time re/starting the instance can still get back the RAM state. not over 60 days.
  • it support on-demand, spot and reserved instances
  • To enable EC2 Hibernate, the EC2 Instance Root Volume type must be an EBS volume and must be encrypted to ensure the protection of sensitive content.
  • Use cases:
    • Long-running processing
    • Saving the RAM state
    • service need time to initiate

Commandline:

  • command uptime gives how long since the instances start

EBS Volume

  • EBS Volume : by default the root EBS volume is deleted
  • exam scenario: if you want to preserve the EBS volume what you should do : disbale the DElete on Termination

EBS Snapshots

  • a backup for EBS volume

AMIs Amazon Machine Image

  • are built for a specific AWS Region, they’re unique for each AWS Region. You can’t launch an EC2 instance using an AMI in another AWS Region, but you can copy the AMI to the target AWS Region and then use it to create your EC2 instances.

EC2 Instances Store

  • good for buffer/cache/temporary content
  • will lose if instance stopped

Types of EBS Volume

  • has six types
  • only g2/g3 io1/ io2 block express can be used as boot volumes.
  • g2/g3 general purpose ssd, 1gib-16TiB, max 16,00 IOPS
  • io1/io2 greater for database, 4gib -16gib, max piops 64,00. io2 block express is four times more than io1. support EBS multi-attach
  • hard disk drives, st1 and sc1: frequency data for st1, infrequently sc1. But both are for big data.
    -Any other EBS volume types will not be deleted as its “Delete On Termination” attribute disabled by default.

EBS Multi-Attach io1/io2 family

  • attach the same EBS volume to multiple EC2 instances in the same AZ, each EC2 instance has full read/write permissions.
  • up to 16 EC2 Instances at a time
  • must a use a file system that’s cluster-aware

EBS Encryption

  • do it!
  • in actual use you need to enable encryption

Amazon EFS Elastic file system

  • Throughput mode
    • Bursting: 1 TB
    • Elastic: automatically decide depends on the workload
    • Provisioned: de-correlated the throughput and the storage size
  • EFS is a network file system (NFS) that allows you to mount the same file system on EC2 instances that are in different AZs.

EBS and EFS and instance store

EBS

  • EBS attach to one instances a time (except multi attach) locked at AZ level
  • Migrate an EBS to another AZ use snapshot
  • Root EBS volumns terminiated by default unless disabled

EFS

  • EFS only for linux

instance store

  • EC2 Instance Store provides the best disk I/O performance.
1
2
3
4
5

Q: You would like to encrypt an unencrypted EBS volume attached to your EC2 instance. What should you do?

A: Create an EBS snapshot of your EBS volume, COpu the snapshot and tick the option to encrypt the copied snamshot. Then, use the encrypted snapshot to create a new EBS volume.