视频来源:B站《AWS 认证解决方案架构师 助理级 SAA-C03》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:AWS助理架构师认证培训 | 汇总_热爱编程的通信人的博客-CSDN博客
Private vs Public vs Elastic IP
Private vs Public IP (IPv4)
- Networking has two sorts of IPs. IPv4 and IPv6:IPv4: 1.160.10.240IPv6: 3ffe:1900:4545:3:200:f8ff:fe21:67cf
- In this course, we will only be using IPv4
- IPv4 is still the most common format used online
- IPv6 is newer and solves problems for the Internet of Things (loT)
- IPv4 allows for 3.7 billion different addresses in the public space
- IPv4: [0-255].[0-255].[0-255].[0-255]
Private vs Public IP (IPv4) Example
Private vs Public IP (IPv4) Fundamental Differences
- Public IP:Public IP means the machine can be identified on the internet (WWW)Must be unique across the whole web (not two machines can have the same public IP)Can be geo-located easily
- Private IP:Private IP means the machine can only be identified on a private network only The IP must be unique across the private network BUT two different private networks (two companies) can have the same IPsMachines connect to WWW using an internet gateway (a proxy)Only a specified range of IPs can be used as private IP
Elastic IPs
- When you stop and then start an EC2 instance, it can change its public IP
- lf you need to have a fixed public IP for your instance, you need an Elastic IP
- An Elastic IP is a public IPv4 IP you own as long as you don't delete it
- You can attach it to one instance at a time
Elastic IP
- With an Elastic IPaddress, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account
- You can only have 5 Elastic IP in your account( (you can ask AWS to increase that)
- Overall, try to avoid using Elastic IP:They often reflect poor architectural decisionsInstead, use a random public IP and register a DNS name to itOr, as we'll see later, use a Load Balancer and don't use a public IP
Private vs Public IP (IPv4) In AWS EC2 - Hands On
- By default, your EC2 machine comes with:A private IP for the internal AWS Network A public IP, for the WWW
- When we are doing SSH into our EC2 machines:We can't use a private IP, because we are not in the same networkWe can only use the public IP
- If your machine is stopped and then started, the public IP can change
EC2 Placement Groups
Placement Groups
- Sometimes you want control over the EC2 Instance placement strategy
- That strategy can be defined using placement groups
- When you create a placement group, you specify one of the following strategies for the group:Cluster - clusters instances into a low-latency group in a single Availability Zone Spread - spreads instances across underlying hardware (max 7 instances per group per AZ) - critical applicationsPartition - spreads instances across many different partitions (which rely on different sets of racks) within an AZ. Scales to 100 of EC2 instances per group (Hadoop, Cassandra, Kafka)
Placement Groups Cluster
- Pros: Great network (10Gbps bandwidth between instances)
- Cons: lf the rack fails, all instances fails at the sametime
- Use case:Big Data job that needs to complete fastApplication that needs extremely low latency and high network throughput
Placement Groups Spread
- Pros:Can span across Availability Zones (AZ)Reduced risk is simultaneous failureEC2 Instances are on different physical hardware
- Cons:Limited to 7 instances per AZ per placement group
- Use case:Application that needs to maximize high availabilityCritical Applications where each instance must be isolated from failure from each other
Placements Groups Partition
- Up to 7 partitions per AZ
- Can span across multiple AZs in the same region
- Up to 100s of EC2 instances
- The instances in a partition do not share racks with the instances in the other partitions
- A partition failure can affect many EC2 but won't affect other partitions
- EC2 instances get access to the partition information as metadata
- Use cases: HDFS, HBase, Cassandra, Kafka
Elastic Netowrk Interfaces (ENI) - Overview
Elastic Network Interfaces (ENI)
- Logical component in a VPC that represents a virtual network card
- The ENI can have the following attributes:Primary private IPv4, one or more secondary IPv4One Elastic IP (IPv4) per private IPv4One Public IPv4One or more security groupsA MAC address
- You can create ENl independently and attach them on the fly (move them) on EC2 instances for failover
- Bound to a specific availability zone (AZ)
EC2 Hibernate
EC2 Hibernate
- We know we can stop, terminate instances Stop - the data on disk (EBS) is kept intact in the next start Terminate - any EBS volumes (root) also set-up to be destroyed is lost
- On start, the following happens:First start: the OS boots & the EC2 User Data script is run Following starts: the OS boots up Then your application starts, caches get warmed up, and that can take time!
- Introducing EC2 Hibernate:The in-memory (RAM) state is preserved The instance boot is much faster! (the OS is not stopped / restarted)Under the hood: the RAM state is written to a file in the root EBS volumeThe root EBS volume must be encrypted
- Use cases:Long-running processingSaving the RAM stateServices that take time to initialize
EC2 Hibernate - Good to know
- Supported Instance Families - C3, C4, C5, I3, M3, M4, R3, R4, T2, T,3, ...
- Instance RAM Size - must be less than 150GB
- Instance Size - not supported for bare metal instances
- AMI - Amazon Linux 2, Linux AMI, Ubuntu, RHEL, CentOS & Windows...
- Root Volume - must be EBS, encrypted, not instance store, and large
- Available for On-Demand, Reserved and Spot Instances
- An instance can NOT be hibernated more than 60 days