EC2 Flashcards

1
Q

You have been asked to deploy a clustered application on a small number of EC2 instances. The application must be placed across multiple Availability Zones, have high speed, low latency communication between each of the nodes, and should also minimize the chance of underlying hardware failure. How can we provide this solution?

A

Deploy the EC2 servers in a Spread Placement Group.
Spread Placement groups are recommended for applications that have a small number of critical instance which need to be kept separate from each other. Launching instances in a Spread Placement group reduces the risk of simultaneous failures that might occur when instances share the same underlying hardware. Spread Placement groups provide access to distinct hardware, and are therefore suitable for mixing instance types or launching instances over time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the 2 types of storage that can be attached to an EC2 instance?

A
  • EBS
  • There will be no data lost if the EC2 instance is stopped with a EBS volume attached
  • Are placed in a specific Availability Zone
  • Are automatically replicated to protect you from the failure of a single component
  • Instance Store
  • All data will be lost if the EC2 instance stops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the three Placement Groups for EC2?

A
  • Cluster
  • Packs instances close together inside a single AZ
  • This strategy enables workloads to achieve the low-latency network performance necessary for tightly-coupled node-to-node communication that is typical of HPC (High Performance Computing) applications.
  • Recommended when the majority of the network traffic is between the instances in the group
  • Partition
  • Spreads the instances of the Placement Group across logical partitions such that groups of instances in one partition do not share the underlaying hardware with groups of instances in different partitions.
  • This strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra, and Kafka.
  • The partitions of a Partition Placement Group can be in different AZs within the same Region
  • A Partition Placement Group can have a maximum of 7 partitions per AZ
  • The number of instances within a partitioned is only limited by the limits of your account
  • Spread
  • Strictly places a small group of instances across distinct underlaying hardware to reduce correlated failures.
  • Each instance is placed in its own rack
  • A Spread Placement Group can span over multiple AZ in the same region.
  • You can have maximum 7 running instances per AZ per group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can an EC2 instance belong to more than one Placement Group at the time?

A

No.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When are User data and Shell scripts run on a EC2?

A

By default, user data scripts and shell scripts are only run during the boot cycle when you first launch an instance.
- You can change the configuration to ensure that you user data scripts and cloud-init directives run every time you restart your instant.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Your Auto Scaling group terminates one of your EC2 instances, what could be the reason?

A

The Health Check status for the instance might have been marked as unhealthy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Is there anything in particular that you should think of when you launch EC2 instances to a Cluster Placement Group?

A
  • It is recommended that the instances is launched in the following way:
  • Use a single launch request to launch the number of instances that you need in the placement group
  • Use the same instance type for all instance in the placement group
  • If you try to add more instances to the placement group later, or if you try to launch more than one instance type in the placement group, you increase your changes of getting an insufficient capacity error.
  • If you stop an instance and then start it again, it still runs in the placement group.
  • If you receive a capacity error when launching an instance in a placement group that already has running instances, stop and start all of the instances in the placement group, and try to launch again. Starting the instances may migrate them to hardware that has capacity for all of the requested instances.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What pricing options exists for EC2?

A
  • On Demand
  • Allows you to pay a fixed rate by the hour (Windows) or second (Linux) with no commitment
  • Recommended for applications with short term, spiky, or unpredictable workloads that cannot be interrupted
  • Also good for new applications with unknow workload
  • Reserved
  • Provides you with a capacity reservation, and offer a significant discount on the hourly charge for an instance.
  • 1 or 3 year terms
  • For applications with steady state or predictable usage
  • Can be either Standard, Convertible (can change instance type), Scheduled (launched within a time window you reserve, good if you have a predictable recurring schedule)
  • Spot
  • Enables you to bid whatever price you want for instance capacity, providing for even greater savings if your application have flexible start and end times
  • Dedicated
  • Physical EC2 server dedicated for your use.
  • Can help you reduce cost by allowing you to use your existing server-bound software licenses.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which are the EC2 instance types?

A

FIGHT DR MC PX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List the different EBS Volume Types.

A
  • General Purpose SSD
  • Balances both price and performance
  • Up to 10.000 IOPS
  • Provisioned IOPS SSD
  • Designed for I/O intensive applications such as large relational or NoSQL databases
  • Use if you need more than 10.000 IOPS
  • Can provision up to 20.000 IOPS per volume
  • Throughput Optimized HDD
  • Low cost HDD volume designed for frequently accessed, throughput-intensive workloads
  • Big Data
  • Data Warehouses
  • Log processing
  • Cannot be a boot volume
  • Cold HDD
  • Lowest cost storage for infrequently accessed workloads
  • E.g. file server
  • Cannot be a boot volume
  • Magnetic
  • Can be a boot volume
  • Lowest cost per gigabyte of all bootable EBS volume types
  • Legacy
  • Ideal for workloads where data is accessed infrequently, and for applications where the lowest storage cost is important
  • E.g. use for your Test/Dev environment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

You have just added a new role to your EC2 instance, do you need to restart the instance for the role to start working?

A
  • No, the role will immediately start to work.
  • If you have any credentials stored at the instance (access key and secret access key) the instance will try to use them and fail. In that case you have to remove the credentials (go to “~/.aws” and remove “credentials” and “config”).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly