amazon web service aws
TRANSCRIPT
By: AHMED GAMIL ABBASS
2014
AMAZON AWS FOUNDATION
Amazon AWS Foundation
1 Contents | By Ahmed Gamil ال تنسونا من صالح دعائكم
هو اجتهاد شخصي ايمانا بمبدأ نقل العلمهذا الكتاب
الذي ال يعلم منا الكثير عنه amazon web services مبادئ ويتحدث هذا الكتاب عن
Amazon documentsوبعض من CBT Nuggetsبعض الفيديوهات الخاصه بـ لوهو محصلة
النظرية بالواقع ربط المعلومات تسهيل الحفاظ علي المصطلحات االجنبية وذلك ل مشروحة باللغة العربية مع الفهم والتطبيق تيسيرمن الصور ل كما يحتوي علي الكثير. العملي
علي رضاكم اتمني ان يحوز الشرح واالسلوب
وال تنسونا من صالح دعائكم
Amazon AWS Foundation
2 Contents | By Ahmed Gamil ال تنسونا من صالح دعائكم
Contents
Contents .................................................................................................................................................. 2
What is AWS ? ........................................................................................................................................ 5
Scaling types ....................................................................................................................................... 6
Vertical scaling ............................................................................................................................... 6
Horizontal scaling .......................................................................................................................... 6
Amazon services ..................................................................................................................................... 7
Create AWS account ............................................................................................................................. 11
Create EC2 instance ..............................................................................................................................14
Instance Types .................................................................................................................................. 18
Virtualization Types ......................................................................................................................... 19
How to use Key Pair ......................................................................................................................... 20
what if you lost your key? ............................................................................................................ 22
AWS IP addressing ............................................................................................................................... 22
Private Addresses and Internal DNS Hostnames .......................................................................... 24
Public IP Addresses and External DNS Hostnames ...................................................................... 25
Differences Between EC2-Classic and EC2-VPC ........................................................................... 27
Security group (SG) .............................................................................................................................. 28
Creating a Security Group ............................................................................................................... 30
Create EC2-classic security group ............................................................................................... 30
Create EC2-VPC security group .................................................................................................. 30
Adding Rules to a Security Group................................................................................................ 31
Deleting Rules from a Security Group ......................................................................................... 31
Deleting a Security Group ........................................................................................................... 32
Elastic IP Addresses (EIP) .................................................................................................................... 32
Elastic IP Addresses in EC2-Classic ................................................................................................ 32
Elastic IP Addresses in a VPC .......................................................................................................... 33
Differences Between EC2-Classic and EC2-VPC ........................................................................... 33
Amazon AWS Foundation
3 Contents | By Ahmed Gamil ال تنسونا من صالح دعائكم
Allocating an Elastic IP Address ..................................................................................................... 33
Associating an Elastic IP Address with a Running Instance ........................................................ 34
Releasing an Elastic IP Address....................................................................................................... 35
Elastic Load Balance (ELB) .................................................................................................................. 36
What Is Elastic Load Balancing? ..................................................................................................... 36
How Elastic Load Balancing Works ................................................................................................ 36
Create an Elastic Load Balancer .......................................................................................................... 37
Create a Basic Load Balancer in EC2-Classic ................................................................................. 37
Create a Basic Load Balancer in EC2-VPC ......................................................................................41
Create a Basic Load Balancer in Default VPC ................................................................................ 45
ELB Configuration properties ......................................................................................................... 48
ELB Health Check ........................................................................................................................ 48
Cross-zone load balancing ........................................................................................................... 49
Connection Draining.................................................................................................................... 49
Sticky Sessions (session affinity) ................................................................................................. 50
Create Sticky Sessions ................................................................................................................... 51
HTTP Methods ............................................................................................................................. 53
HTTPS Support ............................................................................................................................. 54
Virtual Private Cloud (VPC) ................................................................................................................ 55
VPC concepts .................................................................................................................................... 56
Scenarios for Amazon VPC .............................................................................................................. 56
Scenario 1: VPC with a Public Subnet Only ............................................................................... 57
Scenario 2: VPC with Public and Private Subnets ..................................................................... 57
Scenario 3: VPC with Public and Private Subnets and Hardware VPN Access ...................... 57
Scenario 4: VPC with a Private Subnet Only and Hardware VPN Access .............................. 58
Routing Table ....................................................................................................................................... 58
Create NAT instance ........................................................................................................................ 59
Amazon Simple Storage Service (S3 ) ................................................................................................. 60
Create S3 ............................................................................................................................................ 61
Amazon AWS Foundation
4 Contents | By Ahmed Gamil ال تنسونا من صالح دعائكم
create a bucket .............................................................................................................................. 61
Bucket properties ......................................................................................................................... 62
Add an Object to a Bucket ............................................................................................................... 64
AWS cloudfront .................................................................................................................................... 65
Route 53 DNS ........................................................................................................................................ 67
Features ............................................................................................................................................. 67
Using Route 53 .................................................................................................................................. 67
Amazon AWS Foundation
5 What is AWS ? | By Ahmed Gamil ال تنسونا من صالح دعائكم
WHAT IS AWS ?
؟ AWS الـ ما هو
AWS هو اختصارAmazon web services الـ وهي public cloud بـ ةالخاصAmazon
الـ instances الـ بك او بشركتك و الخاص datacenter الـ ازمة لعمل الـ ادوات الـ توفر لك حيث IaaSتعتبر AWS الـ و
مناسبة لك
AWS الـ وتوفر ، virtual machineمن بدال cloud الـ مستخدم في لـ اهو instanceذكر ان مصطلح الـ جدير بالـ ومن
تابعة لهاالـ family الـ و مواصفاتها من حيثتختلف Instances الـ انواع عديدة من
في amazonة بـ الخاص data centers (availability zones) الـ عديد من الـ علي وجود AWS الـ وتعتمد فكرة عمل
regions الـ بحيث تستطيع عمل مختلفة datacenter ة بك في اي الخاصregion وفي ايavailability zone تختارها او
amazonيختارها لك
ة بهاالخاص data centers الـ amazonم تضع فيه الـ عالـ هي منطقة في مكان معين في region الـ و
zoneواكثر من regionاكثر من ة بك في الخاص datacenter الـ كما تستطيع عمل
Amazon AWS Foundation
6 What is AWS ? | By Ahmed Gamil ال تنسونا من صالح دعائكم
:توجد في amazonة بـ الخاص regions الـ يا فان الوح
:خاصة بك بعدة خطوات ال datacenter الـ اذا وبكل بساطة تستطيع عمل
region الـ اختيار -1
availability zone الـ اختيار -2
Instance الـ ة بك وتحديد نوع الخاص servers الـ انشاء -3
data center scaling الـ بك عن طريق زيادة الخاص data center الـ كما يمكن تحسين اداء
Scaling types
scaling الـ سيرفرات وهناك نوعين من الـ وكفاءة datacenter الـ حجم الـ هو زيادة scaling الـ
Vertical scaling
hardware capacity الـ و hardware الـ عدد زيادة لـ من خال server performance الـ زيادةوهو
Horizontal scaling
Amazon AWS Foundation
7 Amazon services | By Ahmed Gamil ال تنسونا من صالح دعائكم
shared capacity الـ و servers (instances) الـ عن طريق زيادة عدد datacenter الـ وهو زيادة كفاءة
؟ ة بكالخاص datacenter الـ لكي تستطيع عمل amazonتوفرها التي tools الـ اذا فما هي
:مثل amazonتقدمها التيخدمات الـ وهي AWS servicesتسمي tools الـ هذه
1- compute and networking
2- Storage & Content Delivery
3- Database
4- Deployment & Management
5- Analytics
6- App Services
services الـ لنتكلم باختصار عن اهم
AMAZON SERVICES
Elastic Compute Cloudهو اختصار
Virtual machineللـ هي مصطلح بديل instance الـ جديده، وكما ذكرنا ف instancesنقوم بعمل هالـ ومن خال
instancesللـ templateوهي تعتبر Amazon Machine Image (AMI)نقوم بعمل ها ايضا لـ ومن خال
Amazon AWS Foundation
8 Amazon services | By Ahmed Gamil ال تنسونا من صالح دعائكم
لكي يستخدمها اي شخص اخر community AMIs الـ ووضعها في AMIالى Instanceيمكن تحويل اي
Simple Storage Serviceهو اختصار
عليها AMIs الـ لتخزين amazonيستخدمها التي storage الـ تعتبر من اهم انواع وهي
الـ طلح خاص بهو مص buckets الـ ، و buckets الـ في objects الـ وتقوم بتخزين هذه objectsكانها data الـ تعتبر S3 الـ
S3 الـ يقابله partitions C,D الـ في HDD عاديالـ
لها permissionsواضافة filesللـ uploadتعامل معها وعمل الـ ه لـ نستطيع من خال web interfaceلها S3 الـ
ن ناجحة اذا لم تتم تخزيالـ ة مختلفين وال تعتبر عملي S3 units 2في fileحيث يتم تخزين اي redundant storage وه S3 الـ
همابشكل كامل في
تخزينيه كبيرةالـ ومساحتها stable هاان S3 الـ مميزات من
.من عليها AMIs الـ من عيوبها انها بطيئة لذلك ال يتم تشغيل
؟ AMIs الـ من instanceعمل لكن كيف يتم
elasticاو ephemeral storageالى S3 الـ من AMIللـ copyجديدة يتم عمل instanceلعمل AMI الـ عند تشغيل
block storage (EBS)
Instance الـ عند انهاء data الـ ال تفقد ، حيث انها dataللـ permanent storeتستخدم لعمل block storageهي
S3 الـ اسرع من
instance الـ في deviceلها كـ mountيمكن عمل
دفع مقابل ماديالى ها قد تحتاج الستخدام
لكي يستخدمها في amazon servers الـ تتصل بdirectly attached) ليست و) physically attached storageهي
SSD او rotating disk قد تكون ، و instances الـ بعض انواع تخزين
micro instances الـ ات مع الـ حالـ تستخدم في معظم
Amazon AWS Foundation
9 Amazon services | By Ahmed Gamil ال تنسونا من صالح دعائكم
EBS الـ افضل من Performanceلها
The latency of ephemeral storage is considerably lower than EBS
لها terminationاذا تم عمل instance الـ ال تحتفظ ب
يمكن استخدامها بدون مقابل مادي
http://www.datastax.com/dev/blog/what-is-the-story-with-aws-storage
memory usage الـ و free space الـ تقوم بمتابعة ، فهي amazon servicesللـ Monitoringتقوم بعمل serviceهي
كل فترة زمنية معينه
و fastكما انها قليل جدا Latencyاداء ولها الـ ية الـ ع NoSQL databaseوهي ، amazon databaseهي احد انواع
very stable
Amazon AWS Foundation
10 Amazon services | By Ahmed Gamil ال تنسونا من صالح دعائكم
https://www.youtube.com/watch?v=oz-7wJJ9HZ0
DNSتستخدم كـ
Virtual private cloudهي اختصار
IPs, subnets, VPN, permissions الـ مسئولة عن الـ ، فهي Network Part الـ وهي تمثل
موجودةالـ Instances الـ علي load الـ زيادة حالةفي Instances الـ تقوم بزيادة serviceهي
جديدة instance بإضافةم تقو auto scaling service الـ مثال فان % 08عن web server الـ علي Load الـ فمثال اذا زاد
تلقائيا
لها updateو Manageوعمل web servers, DB serversمثل serversللـ templatesتقوم بعمل
Amazon AWS Foundation
11 Create AWS account | By Ahmed Gamil ال تنسونا من صالح دعائكم
identity and access managementهي اختصار
system الـ للدخول علي create credentialsها لحيث نستطيع من خال
token, user/pass, keys, key chainعملها هي IAM الـ يستطيع التي credentials الـ من انواع
amazonبـ الخاص Load balancer الـ وهي ELBواختصارها
CREATE AWS ACCOUNT
:آتيالـ نتبع AWS accountلعمل
Amazon AWS Foundation
12 Create AWS account | By Ahmed Gamil ال تنسونا من صالح دعائكم
/http://aws.amazon.comلينك الـ دخول علي ن .1
AWS Management Consoleنقوم باختيار .2
sign upثم نقوم بعمل .3
account الـ نقوم بكتابة بيانات .4
Amazon AWS Foundation
13 Create AWS account | By Ahmed Gamil ال تنسونا من صالح دعائكم
دفعالـ ثم نقوم بتحديد طريقة .5
customer الـ فقط وذلك للتأكد من جدية $ 1يتطلب دفع مبلغ AWS الـ علي registrationلعمل
بعمل amazonشاشة ثم تقوم الـ علي verification codeعن طريق عرض user الـ تأكد من الـ ب amazonتقوم .6
account الـ شاشة فيتم تفعيل الـ ظاهر امامك علي الـ verification code الـ تليفوني بك تطلب منك ادخل الـ اتص
Amazon AWS Foundation
14 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
هل سيكون مجاني ام مدفوع support الـ وهذا يحدد نوعية support plan الـ ثم نختار .7
AWS الـ لنا علي instanceفي عمل اول اآلنولنبدأ AWS accountوبذلك نكون قد انتهينا من عمل
CREATE EC2 INSTANCE
https://console.aws.amazon.comلينك الـ عن طريق AWS consoleالى ندخل .1
EC2الى نذهب .2
Amazon AWS Foundation
15 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
region الـ نختار .3
جديدة instanceفي عمل اآلننبدأ .4
منها Instanceسنقوم بعمل التي AMI الـ نختار .5
Amazon AWS Foundation
16 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
redhat, amazon linux, Microsoftمثل available AMIs الـ يتكون من wizard الصورةونجد في هذه
: Tabs الـ مجموعة من wizard الـ ونجد علي يسار
a. My AMIs
قام بعملها التيو User الـ ة بصالخا AMIs الـ وهي
b. AWS Marketplace
AWS market الـ موجودة في الـ AMI الـ وهي
c. Community AMIs
الـ اخرون من الـ لكي يتمكن community الى الـ بعملها واضافتها users الـ قام التي AMIs الـ وهي
استفادة منها
مراد عملهاالـ instance type الـ نختار .6
اي انه يمكن ان نستخدمها مجانا بدون مقابل ”Free tier eligible“اسفلها عبارة توجد micro instance الـ و
حسب احتياجاتنا وسوف نتحدث عنها الحقا instanceللـ configuration الـ نقوم بعمل .7
Amazon AWS Foundation
17 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
SSDوالحظ ان نوعها instance الـ ستستخدمها التي storage الـ نختار .0
instance الـ اسم تمثلوهي instance الـ لهذه tagنقوم بوضع .9
تي يمكن اضافتها المعلومات الوغيرها من Description, creation dayمثل tagويمكن اضافة اكثر من
و ، اInstance الـ ستطبق علي التي firewall rules الـ وهي مثل Instanceللـ security groupنقوم بعمل .18
default security group الـ اختيار تستطيع
تي تم عملها ، ثم نضغط ال configuration الـ تي توضح الو Instance الـ ة بالخاص review الـ تظهر شاشة .11
launch
Amazon AWS Foundation
18 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
Instance الـ علي الدخولموجوده مسبقا وذلك حتي نستطيع keyاو اختيار instanceللـ Keyنقوم بعمل .12
key الـ وهذا ”Download Key Pair“ضغط علي الـ و key الـ جديد فكل ما علينا فعله هو كتابه اسم keyاردنا عمل اذا
Instance الـ سوف نستخدمه الحقا للدخول علي
public/private key cryptographyويعتبر pem fileهو key pair الـ وهذا
Launch Instanceثم نضغط .13
Instance Types
type الـ حسب storage الـ و CPU الـ و memory الـ حيث تختلف HW specs الـ باختالف instance الـ نوع يختلف
Instance Family Instance Types Purpose
General purpose m1.small | m1.medium | m1.large | m1.xlarge | m3.medium | m3.large | m3.xlarge | m3.2xlarge
Good choice for many applications, Small and mid-size databases, data processing
Amazon AWS Foundation
19 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
Compute optimized
c1.medium | c1.xlarge | c3.large | c3.xlarge |c3.2xlarge | c3.4xlarge | c3.8xlarge | cc2.8xlarge
Highest performing processors for High web-servers, batch processing, distributed analytics, and high performance science and engineering applications
Memory optimized m2.xlarge | m2.2xlarge | m2.4xlarge | r3.large | r3.xlarge | r3.2xlarge | r3.4xlarge | r3.8xlarge | cr1.8xlarge
For memory-intensive applications
Storage optimized hi1.4xlarge | hs1.8xlarge | i2.xlarge | i2.2xlarge | i2.4xlarge | i2.8xlarge
For very high random I/O performance (like DB)
Micro instances t1.micro For Low traffic websites or blogs, small administrative applications
GPU instances cg1.4xlarge | g2.2xlarge For graphics and GPU applications
http://aws.amazon.com/ec2/instance-types/
حيث ان type الـ تختلف حسب The maximum transmission unit (MTU) الـ والحظ ان
MTU Instance
900 CC2, C3, R3, CG1, CR1, G2, HS1, HI1, I2, and M3
1500 c1.medium | c1.xlarge, m1.small , m1.medium , m1.large , m1.xlarge, m2.xlarge | m2.2xlarge | m2.4xlarge, t1.micro
shared resourcesفهم NW الـ و I/O الـ بينما shared resourcesليست CPU الـ و memory الـ يجب مالحظة ان و
Virtualization Types
Amazon تستخدمcustomized version الـ من Xen virtualization وهم:
Paravirtual (PV)
Hardware virtual machine (HVM)
real servers الـ يقترب من دائهاحيث ان أ high performance الـ ب xen virtualization الـ ز وتتمي
Virtualization type Specifications
Paravirtual (PV) Stability/Performance is close to the real servers Overhead is very low Implementation is tough. Supports Linux only Can’t compile and install a custom kernel Hypervisor is installed on the hardware.
Hardware virtual machine (HVM)
Can run Linux and Windows Complete secure hardware isolation Greater stability Low performance, because of the overheads at the hardware level
فقط HVM الـ تدعم windows instances الـ بينما virtualization الـ نوعين من الـ كال linux instances الـ تدعم و
Amazon AWS Foundation
20 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
How to use Key Pair
instance الى الـ الدخولفي key pair الـ عن كيفية استخدام اآلنسنتحدث
EC2ونختار services tab الى الـ نذهب -1
instancesثم نختار -2
connectعليها ثم نضغط الدخولنريد التي instance الـ نقوم باختيار -3
: instance الـ علي الدخولتظهر لنا طرق
a) باستخدامssh client مثلputty
Amazon AWS Foundation
21 Create EC2 instance | By Ahmed Gamil ال تنسونا من صالح دعائكم
الـ نقوم بتغيير key permission مر االوذلك عن طريق 400الى
chmod 400 Key.pem
الى الـ الدخولنقوم ب instance الـ عن طريق ssh الـ باستخدام key file
ssh -i Key.pem root@IP
الـ اعتبار ان الـ اخذ في الـ يجب default user الـ في redhat dist. هوec2-user
الـ بينما في Ubuntu هوUbuntu
command الـ علي كيفية كتابة الية هي مجرد مثالتالصورة ال
b) باستخدامjava ssh client الـ من browser وذلك يتطلب وجود مباشرةjava
Amazon AWS Foundation
22 AWS IP addressing | By Ahmed Gamil ال تنسونا من صالح دعائكم
بنفسه Key name الـ تعرف علي الب java ssh client الـ ة يقوم الحالوفي هذه
WHAT IF YOU LOST YOUR KEY?
instance الـ علي الدخولفلن تستطيع key الـ ال يجب عليك ابدا فقدان
:تي االمشكلة عن طريق التغلب على هذه التستطيع حرجة الت االحالولكن في
Instance الـ من هذه AIMقم بعمل -1
جديد keyجديدة ، وبذلك سيطلب منك عمل instanceمرة اخري في عمل AIM الـ ثم استخدم هذه -2
AWS IP ADDRESSING
-EC2هل هي Instance الـ نوع وذلك بناء علي instanceلكل DNS hostnameو IP address بإعطاء amazonتقوم
classic امEC2-VPC
: Instances الـ هناك نوعين من
1- EC2 classic
2- EC2-VPC
وهذه clientل كل virtual network بتخصيصبعمل تقوم Amazonفـ virtual private cloudهي اختصار VPC الـ و
AWS cloud الـ عن logically isolatedتكون Virtual Network الـ
IPs الـ وتوزيع subnetsالى تقسيمها يستطيع حيثحسب احتياجه virtual network الـ تحكم في هذه الب client الـ ويقوم
وغيرها
Amazon AWS Foundation
23 AWS IP addressing | By Ahmed Gamil ال تنسونا من صالح دعائكم
تأخذ instance، وعليه فان كل instancesللـ لكنها تخصص clients للـال تخصص IPs الـ ف EC2 -classic الـ بينما في
IP الـمن pool الـ ب الخاص EC2-classic الـ وليس من VPC
: IPs الـ انواع من 3هناك
1- EC2 Private IP Address
فقط EC2 cloud الـ ، ويستخدم داخل instanceللـ internal addressهو
2- classic Public IP Address-EC2
خاص بها ، IP poolولها اإلنترنتالى ويستخدم للخروج به instanceللـ public internet addressهو
ال تحتفظ public IP الـ ، وهذا private IP الى الـ قادم ال trafficللـ NATTINGيتم عمل IP الـ وباستخدام هذا
(home ADSL الـ مثل )لها terminationاذا تم عمل instance الـ به
3- VPC Public IP Address-EC2
خاص بها IP poolولها VPC instanceللـ public internet addressهو
4- EC2 Elastic IP Address
الـ ايضا في عمل NATTING الـ بعينها وتستخدم instance ـوليس ل EC2 accountللـ مخصص IP addressهو
mapping الـ مع private IP addresses الـ ولكن هذا IP للـ يظل مخصصاaccount حتي بعد عمل
termination للـInstance ( الـ مثل home ADSL with static IP )وسنتحدث عنه الحقا
https://aws.amazon.com/articles/1346
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html
Amazon AWS Foundation
24 AWS IP addressing | By Ahmed Gamil ال تنسونا من صالح دعائكم
PRIVATE ADDRESSES AND INTERNAL DNS HOSTNAMES
، سواء Network الـ في نفس instances الـ تواصل بين الـ في DNS hostname الـ و Private IP الـ يمكنك استخدام
EC2-VPCاو EC2-classicنوعها Instances الـكانت هذه
defaultلها EC2-VPC instances الـ ، وDHCP الـ من private IPفاها تحصل علي Instance الـ عندما تقوم بتشغيل
NIC الـ وهذا default NIC لهprimary private IP
: الىتالك NICللـ secondary private IP addressويمكن اضافة
1-
2-
3-
Amazon AWS Foundation
25 AWS IP addressing | By Ahmed Gamil ال تنسونا من صالح دعائكم
secondary IPحصلت علي NIC الـ مرة اخري نجد ان Instance tabالى عودة الـ وب -4
primary private IP الـ وذلك عكي instanceمرة اخري الي secondary private IPللـ reassignويمكن عمل
فقط اي انك لن تجده network الـ من داخل له resolveتستطيع عمل internal DNS hostnameلها instanceوكل
يحب ان DNS hostname الـ لهذا resolutionلكي تتمكن من عمل ،و firewallاذا كان لديك ، ولكن network الـ خارج
الـ علي amazon DNS serverمن inbound traffic الـ سماح بالـ وذلك عن طريق DNS query response الـ تسمح ب
port 53
instance الـ من داخل command الـ يمكن ان تستخدم هذا amazon DNS IPوللحصول علي
grep nameserver /etc/resolv.conf
terminateاو stopاذا قمت بعمل private IP الـ تفقد instances الـ فان EC2-classic الـ في
حالةولكن تفقدها في restartاو stopحتي اذا قمت بعمل private IP الـ فظ تحت instances الـ فان EC2-VPC الـ بينما في
termination الـ
PUBLIC IP ADDRESSES AND EXTERNAL DNS HOSTNAMES
خري اال aws services الـ ترنت والى اآلنوصول الفي External DNS hostame الـ او public IP address الـ تستخدم
وغيرها storage (S3) الـ مثل
Amazon AWS Foundation
26 AWS IP addressing | By Ahmed Gamil ال تنسونا من صالح دعائكم
الـ من Instance الـ حيث تحصل عليه accountللـ وليس instanceللـ يخصص IPهو public IP address الـ و
Public IP pool يتم عمل الي انrestart اوtermination للـInstance
eth0 network interface (the primary network interface) يوضع في public IP الـ و
تحكم الفتستطيع EC2-VPCبشكل تلقائي ، بينما عند تشغيل public IPفانها تحصل علي EC2-classic instanceعند تشغيل
ام ال Public IPفيما اذا كنت تريد
non default subnetو default subnetفيوجد VPC instances الـ ة الوفي ح
subnetبشكل تلقائي، اما اذا كانت تستخدم public IPفانها تحصل على default subnet الـ تستخدم instance الـ اذا كانت
:الى تالتحكم في ذلك كالو subnet الـ تلقائيا ولكن يمكن تغيير اعدادات Public IP الـ اخري فانها ال تحصل علي
1-
2-
Amazon AWS Foundation
27 Security group (SG) | By Ahmed Gamil ال تنسونا من صالح دعائكم
: public IP الـ خاصه بالهامة المعلومات الهناك بعض
فقط وليس بعد االنتهاء من عمل ال جديدة Instanceاثناء عمل instance الى الـ public IP يتم تخصيص -1
instance
public ipللـ disassociateاو associateال تستطيع عمل -2
او اي tartresالي سبب سواء public IPللـ releaseوحدث NICاكثر من تحتوي علي instance الـ اذا كانت -3
جديد public IPعلي Instance الـ شيء اخر فلن تحصل
public IP الـ ب DNS hostname الـ لهذا resolveويمكن عمل public IPلكل external DNS hostnameيتم اعطاء
networkالـ من خارج
DIFFERENCES BETWEEN EC2-CLASSIC AND EC2-VPC
Characteristic EC2-Classic EC2-VPC Default Subnet EC2-VPC Nondefault Subnet
Public IP address (from Amazon's public IP address pool)
Your instance receives a public IP address.
Your instance launched in a default subnet receives a public IP address by default, unless you specify otherwise during launch, or you modify the subnet's public IP address attribute.
Your instance doesn't receive a public IP address by default, unless you specify otherwise during launch, or you modify the subnet's public IP address attribute.
Private IP address Your instance receives a private IP address from the EC2-Classic range each time it's started.
Your instance receives a static private IP address from the address range of your default VPC.
Your instance receives a static private IP address from the address range of your VPC.
Multiple IP addresses
We select a single private IP address for your instance; multiple IP addresses are not supported.
You can assign multiple private IP addresses to your instance.
You can assign multiple private IP addresses to your instance.
Network interfaces
IP addresses are associated with the instance; network interfaces aren't supported.
IP addresses are associated with a network interface. Each instance has one or more network interfaces.
IP addresses are associated with a network interface. Each instance has one or more network interfaces.
Elastic IP address An EIP is disassociated from your instance when you stop it.
An EIP remains associated with your instance when you stop it.
An EIP remains associated with your instance when you stop it.
DNS hostnames DNS hostnames are enabled by default.
DNS hostnames are enabled by default.
DNS hostnames are disabled by default.
Amazon AWS Foundation
28 Security group (SG) | By Ahmed Gamil ال تنسونا من صالح دعائكم
SECURITY GROUP (SG)
الـ و protocols الـ نختار و instances لـ ابين traffic الـ في لتحكم يستخدم ل virtual firewallهو security group الـ
Ports الـ التي سيستخدمها firewall الـ لتعامل مع في ا instances
تعديل الاو default security group الـ او اختيار instanceوربطها مع اكثر من security groupويمكن عمل اكثر من
عليها
حاجهالحسب security group الى الـ rules الـ ويتم اضافة
default security groupللـ صورة الوهذه
ICMP الـ و UDP rule الـ و TCP rule الـ مثل rules الـ تحتوي علي بعض default SG الـ صورة ان الوكما نرى في هذه
rule الـ ان فيها الحظ ن التيو source port الـ و dist. port الـ ك الن وذل( 1-)قيمتهم بـ ICMP ليس لهPort no.
تعامل معهااللتسهيل most common protocol الـ علي قائمة ب SG الـ وتحتوي
: instanceباختالف نوع الـ security groups الـ وتختلف
1- Security Groups for EC2-Classic
region الـ في نفس ستستخدمها التي instance الـ و security group الـ يجب ان تكون -
، وسوف فقط rules الـ تعديل علي الباخرى ولكن يمكن SG الـ فال يمكن تغيير instanceمع SGاذا استخدمت -
SG الـ تستخدم هذه التي Instances الـ تعديالت علي جميع التطبق هذه
rules 100تحتوي علي SGوكل SG 500تستطيع استخدام EC2-classic الـ في -
Amazon AWS Foundation
29 Security group (SG) | By Ahmed Gamil ال تنسونا من صالح دعائكم
2- Security Groups for EC2-VPC
باخرى SG الـ فيمكن تغيير instanceمع SGاذا استخدمت -
rules 50تحتوي علي SGوكل network interface الـ مع SG 5تستطيع استخدام -
تفصيلالـ بعد ذلك بمزيد من VPC الـ وسنتحدث عن
Default VPC الـ و EC2-Classic الـ وهذه مقارنة شاملة بين
Characteristic EC2-Classic Default VPC
Public IP address (from Amazon's public IP address pool)
Your instance receives a public IP address.
Your instance launched in a default subnet receives a public IP address by default, unless you specify otherwise during launch, or you modify the subnet's public IP address attribute.
Private IP address Your instance receives a private IP address from the EC2-Classic range each time it's started.
Your instance receives a static private IP address from the address range of your default VPC.
Multiple private IP addresses
We select a single private IP address for your instance; multiple IP addresses are not supported.
You can assign multiple private IP addresses to your instance.
Elastic IP address An EIP is disassociated from your instance when you stop it.
An EIP remains associated with your instance when you stop it.
DNS hostnames DNS hostnames are enabled by default.
DNS hostnames are enabled by default.
Security group A security group can reference security groups that belong to other AWS accounts. You can create up to 500 security groups in each region.
A security group can reference security groups for your VPC only. You can create up to 100 security groups per VPC.
Security group association You can assign an unlimited number of security groups to an instance when you launch it. You can't change the security groups of your running instance. You can either modify the rules of the assigned security groups, or replace the instance with a new one (create an AMI from the instance, launch a new instance from this AMI with the security groups that you need, disassociate any Elastic IP address from the original instance and associate it with the new instance, and then terminate the original instance).
You can assign up to 5 security groups to an instance. You can assign security groups to your instance when you launch it and while it's running.
Security group rules You can add rules for inbound traffic only. You can add up to 100 rules to a security group.
You can add rules for inbound and outbound traffic. You can add up to 50 rules to a security group.
Amazon AWS Foundation
30 Security group (SG) | By Ahmed Gamil ال تنسونا من صالح دعائكم
Tenancy Your instance runs on shared hardware.
You can run your instance on shared hardware or single-tenant hardware.
CREATING A SECURITY GROUP
CREATE EC2-CLASSIC SECURITY GROUP
1- Open the Amazon EC2 console
2- click Security Groups
3- Create Security Group (choose “No VPC”)
CREATE EC2-VPC SECURITY GROUP
Same 1, 2 steps as previous
3- Choose VPC
Amazon AWS Foundation
31 Security group (SG) | By Ahmed Gamil ال تنسونا من صالح دعائكم
ADDING RULES TO A SECURITY GROUP
DELETING RULES FROM A SECURITY GROUP
1- go to the required security group
2- press “Edit” tab in the required inbound/outbound rules
3- delete the required rule
Amazon AWS Foundation
32 Elastic IP Addresses (EIP) | By Ahmed Gamil ال تنسونا من صالح دعائكم
DELETING A SECURITY GROUP
ELASTIC IP ADDRESSES (EIP)
Elastic IP الـ يجب ان نعرفها عن التيمبادء الـ هناك بعض
Instancesللـ تكون مخصصه التي normal IPs الـ وذلك بخالف accountللـ مخصص static IPهو EIP الـ -1
له releaseحتي يقوم بعمل user accountللـ مخصصه EIP الـ تضل -2
VPC instancesللـ اخري الـ و EC2-classicللـ احدهما EIP pools 2هناك -3
ELASTIC IP ADDRESSES IN EC2-CLASSIC
mappedيكونوا IPs الـ وهذين IPs (Private, public) 2تخصص لها amazonجديده فان Instanceعندما تقوم بعمل
بعضالـ مع بعضهم
EC2-classic instancesللـ public IP pool لـ associateبعمل ب amazonوتقوم
وال تستطيع amazon IP poolيعود مرة اخرى ل public IP الـ فان instanceللـ terminationعندما تقوم بعمل
استخدامه مرة اخري
instance الـ لهذه termination، فاذا اردت عمل published siteيستضيف web serverوخطورة ذلك انك اذا كان لديك
فسوف تحدث مشكلة مع الى تالرة اخرى وبم IP الـ حصول علي نفس الاخري فلن تستطيع instanceعلي web server الـ ونقل
published services الـ و .production ENV الـ وخاصه في EIP الـ مهم استخدام اللذلك فمن web site الـ مستخدمي
واذا قمت تلقائيا ، EIP الـ ه بالواستبد public IPللـ releaseفسوف يتم عمل Instanceللـ EIP ـ ل associateبعمل واذا قمت
IP pool الـ جديد من public IPتحصل علي instance الـ فان EIPللـ releaseبعمل
Amazon AWS Foundation
33 Elastic IP Addresses (EIP) | By Ahmed Gamil ال تنسونا من صالح دعائكم
ELASTIC IP ADDRESSES IN A VPC
,IPs (private 2تحصل علي default VPC الـ تستخدم Instanceكثيرا ، حيث ان كل EIP EC2-classic الـ تشبه
public) الـ بينما instance تستخدم التيnon default VPC ال تحصل عليpublic IP اذا قمت بطلبه اثناء االبشكل تلقائي
instance الـ عمل هذه
فقط لها private IPتخصص amazonفان instance الـ اثناء عمل public IPة عدم طلب الوفي ح
، instanceذه الـ له EIP لـ associateعمل ، لذلك يجب ترنت نالى االخروح الة علي رغير قاد Instance الـ ولكن ستظل هذه
Elastic network interface (ENI)للـ EIP فنقوم بتخصيص VPC instance ـل EIP للـ associateعمل لو
NIC الـ لهذا EIP للـ associateبعمل لذلك يجب public IPفلن تحصل علي VPC instanceالى NICاذا قمت باضافة
بذلك بنفسه admin الـ اذا قام اال releaseلها ولن يحدث له restartحتي بعد عمل EIP الـ ب instance الـ وتحتفظ
DIFFERENCES BETWEEN EC2-CLASSIC AND EC2-VPC
Characteristic EC2-Classic EC2-VPC
Allocation When you allocate an EIP, it's for use only in EC2-Classic.
When you allocate an EIP, it's for use only in a VPC.
Association You associate an EIP with an instance.
An EIP is a property of an elastic network interface (ENI). You can associate an EIP with an instance by updating the ENI attached to the instance. For more information, see Elastic Network Interfaces (ENI).
Reassociation If you try to associate an EIP that's already associated with another instance, the address is automatically associated with the new instance.
If you try to associate an EIP that's already associated with another instance, it succeeds only if you allowed reassociation.
Instance stop If you stop an instance, its EIP is disassociated, and you must re-associate the EIP when you restart the instance.
If you stop an instance, its EIP remains associated.
Multiple IP Instances support only a single private IP address and a corresponding EIP.
Instances support multiple IP addresses, and each one can have a corresponding EIP. For more information,
ALLOCATING AN ELASTIC IP ADDRESS
1-
Amazon AWS Foundation
34 Elastic IP Addresses (EIP) | By Ahmed Gamil ال تنسونا من صالح دعائكم
2-
3-
ASSOCIATING AN ELASTIC IP ADDRESS WITH A RUNNING INSTANCE
1- press “Associate Address”
Amazon AWS Foundation
35 Elastic IP Addresses (EIP) | By Ahmed Gamil ال تنسونا من صالح دعائكم
2- choose the instance or NIC that you want to associate the EIP
RELEASING AN ELASTIC IP ADDRESS
1-
2-
Load الـ استخدام حالةفي IPs الـ فقط ، لذلك يفضل استخدام 5EIPsله aws accountكل : ملحوظة هامة
balancing الـ واستخدام DNS hostnames الـ بين nodes وبعضها
:السببوشرح form الـ مزيد عن طريق هذه الـفيمكن طلب EIPs 5اكثر من الى يحتاج architectureاما اذا كان لديك
https://aws.amazon.com/support/createCase?type=service_limit_increase&serviceLimitIncreas
eType=elastic-ips
Amazon AWS Foundation
36 Elastic Load Balance (ELB) | By Ahmed Gamil ال تنسونا من صالح دعائكم
ELASTIC LOAD BALANCE (ELB)
WHAT IS ELASTIC LOAD BALANCING?
الـ الحد failure، واذا حدث instances الـ علي requests الـ لكي تقوم بتوزيع amazonتقدمها serviceهو ELB الـ
Instances الـ فان ELB الـ توجيه يقوم ب traffic الى الـ instances اخرىالـ
فقط بينما يقوم load balancer الـ يتعامل مع client الـ ويقصد به ان client single point of contactوهذا ما يعرف بـ
مناسبال server الى الـ request الـ وتوصيل servers الـ تعامل مع الب load balancer الـ
هاكنجالضد first line of defense الـ هو load balancer الـ يعتبر كما
ELB الـ مرت عبر GBحساب كل ساعه او جزء منها او كل البمقابل مادي حيث يتم يكون ELB الـ استخدام
http://aws.amazon.com/elasticloadbalancing/pricing/
The free tier includes 750 hours per month of Amazon EC2 Micro Instance usage, and 750 hours per
month of Elastic Load Balancing, plus 15 GB of data processing
HOW ELASTIC LOAD BALANCING WORKS
:من ELB الـ يتكون
1- load balancer
2- control server
لها monitoringترنت وعمل اآلنتأتي له من التي traffic الـ تعامل مع الـ ب Load balancer الـ يقوم
LB الـ واضافة وحذف load balancerللـ Monitoringبعمل controller server الـ بينما يقوم
تأكد الب controller الـ ، ويقوم instances الى الـ ويرسلها incoming requests الـ تأكد من انه يقبل الفيحب LBعند عمل
عملية بنجاحاليقوم بهذه LB الـ من ان
unique Domainبعمل ELB الـ ثم يقوم IP الـ يه عن طريق ال instances الـ (register)نقوم باضافة LB الـ بعد عمل
Name System لكلinstance الـ تتصل ب load balancer ه لويتعامل معها من خال
amazonفيقوم instance DNS nameاو LB DNS name الـ باستخدام requestبعمل اي clientوعندما يقوم اي
DNS server الـ رد علي الب client الـ ب LB IP الـ فيقوم client الـ البارس request الـ لهذا IP
Healthy الى الـ ذهبت فعال routed requests الـ ويتأكد من ان registered instance health الـ LB الـ ويتابع
instances
لها requests الـ فانه يتوقف عن توجيه unhealthyاصبحت registered instanceاي LB الـ واذا وجد
Amazon AWS Foundation
37 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
availability zoneدث اي مشكلة في ، فاذا ح LB الـ نفس الى مختلفة availability zonesفي Instanceويمكن اضافة
وال zones الـ بين IPs الـ يستطيع ان يوزع LB الـ ، ف اخريالـ zone الى الـ requests الـ بتوجيه LB الـ معينه فيقوم
regions الـ يستطيع توزيعها بين
3عن healthy instances الـ قلت مثال بحيث اذا conditionsووضع LB الـ مع auto scaling الـ يفضل استخدام
instances الـ فيقوم بتشغيل بعض Instances اخرى الـ
اخرى الـ Instances الـ فيقوم بتشغيل بعض .sec 3عن LB latency الـ او اذا زاد
CREATE AN ELASTIC LOAD BALANCER
CREATE A BASIC LOAD BALANCER IN EC2-CLASSIC
1- Go to Load Balancers Tab
Amazon AWS Foundation
38 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
2- Configure Listeners for Your Load Balancer
3- Configure Health Check for Your Amazon EC2 Instances
Amazon AWS Foundation
39 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
4- Register Amazon EC2 Instances
5- Review Settings and Create Your Load Balancer
Amazon AWS Foundation
40 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
6- Verify the Creation of Your Load Balancer
Amazon AWS Foundation
41 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
CREATE A BASIC LOAD BALANCER IN EC2-VPC
1- Go to Load Balancers Tab
2- Configure Listeners for Your Load Balancer
3- Configure Health Check for Your Amazon EC2 Instances
Amazon AWS Foundation
42 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
4- Select a Subnet for Your Back-end Instance
5- Assign a Security Group to Your Load Balancer
Amazon AWS Foundation
43 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
6- Register Your Amazon EC2 Instances
7- Review Settings and Create Your Load Balancer
Amazon AWS Foundation
44 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
8- Verify Creation of Your Load Balancer
Amazon AWS Foundation
45 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
CREATE A BASIC LOAD BALANCER IN DEFAULT VPC
1- Go to Load Balancers Tab
2- Configure Listeners for Your Load Balancer
3- Configure Health Check for Your Amazon EC2 Instances
Amazon AWS Foundation
46 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
4- Assign a Security Group to Your Load Balancer
5- Register Your Amazon EC2 Instances
Amazon AWS Foundation
47 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
6- Review Settings and Create Your Load Balancer
Amazon AWS Foundation
48 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
7- Verify Creation of Your Load Balancer
ELB CONFIGURATION PROPERTIES
ELB HEALTH CHECK
تعمل بشكل Instances الـ للتأكد من ان registered instances الـ علي health checkبعمل Load balancer الـ قوم ي
طبيعي
URL الـ او Port الـ او protocol الـ بعده طرق مثل Health check الـ بعمل ELB الـ ويقوم
Amazon AWS Foundation
49 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
5كل http://node_IP:80/index.htmlالى request الـ م بارسبحيث يقو LBللـ configurationتستطيع عمل : مثال
sec 30وينتظر sec الـ الـ الستقب reply الـ فسوف يعيد االو request الـ مرتين وبعد ذلك فسيعتبر instance انها
unhealthy
مرة اخرى healthyانها اصبحت instance الـ فسيعتبر replies 10فاذا جاءه request الـ الوبعد ذلك يستمر في ارس
CROSS-ZONE LOAD BALANCING
availability zoneفي اكثر من instancesان يتعامل مع LB الـ يستطيع
CONNECTION DRAINING
ولكن مباشرة terminatedلن تصبح instance الـ ة الفان ح registered instanceلـ terminationعندما تقوم بعمل
terminatedتها الـ تقوم انت بتحديدها وبعد ذلك تصبح ح timeoutلفترة زمنية معينه Inserviceتها الستصبح ح
الـ هذه الى فقط existing requests الـ الـ في ارس LB الـ ، يظل inservice الـ حالةفي instance الـ واثناء دخول
Instance الـ حتي تنتهي requests الـ او ينتهي timeout الـ ، وال يقوم LB البارس new requests يهاال
ACTIVATE CONNECTION DRAINING DURING LB INSTALLATION
Amazon AWS Foundation
50 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
EDIT CONNECTION DRAINING
STICKY SESSIONS (SESSION AFFINITY)
وقد requests الـ تعامل مع هذه التستطيع instanceافضل الى user requestsلـ ل routeيقوم بعمل LB الـ معروف ان المن
اذا ظهر من هو افضل منها Instance الـ تتغير هذه
Amazon AWS Foundation
51 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
الـ معينه ب Instanceبحيث تقوم instance الـ ب user الـ بربط LB الـ فيقوم sticky sessions feature الـ ولكن بتفعيل
فقط User الـتعامل مع هذه
، ويمكن اضافة requests الـ يه الذي سيرسل ال Instance الـ باسم User الى الـ cookies الويتم ذلك عن طريق ارس
expiration date للـcookie
CREATE STICKY SESSIONS
، ثم يستخدمه client الـ يه من اليأتي responseفي اول cookie الـ بوضع application الـ او load balancer الـ يقوم
اخريالـ sub requests الـ في باقي client الـ
الـ ذي ستظل الـ duration الـ وما هو client الى الـ يرسلها التي cookie الـ تحكم في الـ ب LB الـ كيف يقوم ولكن
instance الـ تتعامل فيه مع client ؟
DURATION-BASED SESSION STICKINESS
فيه cookie الـ تأكد من وجود الب LB الـ يقوم request البارس client الـ عندما يقوم
request الـ تتعامل مع هذا التي Instance الـ فاذا كان موجود فانه يبحث بداخله عن -
يحتوي علي request لـ ال خبدا cookieثم يضع instances الـ اما اذا لم تكن موجوده فانه يقوم باختيار افضل -
cookie الـ لهذا expiration date الـ و client الـ ستتعامل مع هذا التي instance الـ بيانات
ENABLE DURATION-BASED STICKY SESSIONS
1- EC2 Dashboard pane, under NETWORK & SECURITY, click Load Balancers.
2- Port Configuration
Amazon AWS Foundation
52 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
APPLICATION-CONTROLLED SESSION STICKINESS
expiration الـ فقط هي ان يتأكد من LB الـ ووظيفة request الـ خاص به علي ال cookie الـ بوضع application الـ يقوم
date
ENABLE APPLICATION-CONTROLLED SESSION STICKINESS
Amazon AWS Foundation
53 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
HTTP METHODS
methods الـ من مجموعة من http rquest الـ يتكون
get, post, putمثل http request الـ يه الـ عندما يأتي instance الـ ذي سيأخذها الـ action الـ هي methods الـ و
nonstandard methodsو standard methods الـ ان يتعامل مع LB الـ يستطيع
- Standard methods : GET, POST, PUT, HEAD, and OPTIONS
- Nonstandard methods: PATCH, REPORT, MKCOL, PROPFIND, MOVE, and
LOCK.
: HTTP requestللـ بعمل اختبارين LB الـ يقوم
1- malformed requests : الـ وهو request غير مفهوم نتيجة اي الـdistortion اوencoding problems
2- Method length : الـ ا تزيد الـ يجب Method length 127عن characters
instanceللـ request الـ البارس LB الـ اختبارين فيقوم الـ فاذا نجح هذين
HTTP 400: BAD_REQUESTة الرس البارس LB الـ فيقوم (malformed request)ول االختبار االاما اذا فشل في
Amazon AWS Foundation
54 Create an Elastic Load Balancer | By Ahmed Gamil ال تنسونا من صالح دعائكم
HTTP 405: METHOD_NOT_ALLOWEDة الرس الفيقوم بارس (Method length)ثاني الختبار االاما اذا فشل في
HTTPS SUPPORT
Clients الـ بينه وبين encrypted connections (SSL offload)وعمل SSL/TLSباستخدام LBللـ تسمح featureهي
الـ الثم استقب instances الى الـ ه الوارسله decryptبعمل LB الـ يقوم https request البارس client الـ فعندما يقوم
response الـ من Instance وعملencrypt الى الـ ه الوارس له client مرة اخرى
accountللـ SSL certificates 10، ويسمح بـ LB الى الـ certificateاضافة فيجب https الـ وعند استخدام
cert.html-server-http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl
ثم request clientللـ decryptيقوم بعمل ELB الـ فان HTTPs الـ يستخدم ELB الـ و instance الـ ة ان كل من الفي ح
، لذلك فمن ELB الـ علي الى ع overheadعمل الى ، وهذا يؤدي instance الى الـ ه المرة اخري له وارس encryptم بعمل يقو
httpsبدال من TCPهو ELB protocol الـ فضل ان نجعل اال
الى الـ ها الوارس client requestللـ decryptيقوم بعمل ELB الـ فقط فان HTTPيستخدم instance الـ اما اذا كان
instance
ELB الـ يستخدمها التي certificate الـ و cypher الـ تعديل علي الويمكن
Edit Cipher
Amazon AWS Foundation
55 Virtual Private Cloud (VPC) | By Ahmed Gamil ال تنسونا من صالح دعائكم
Edit SSL certificate
VIRTUAL PRIVATE CLOUD (VPC)
Amazon AWS Foundation
56 Virtual Private Cloud (VPC) | By Ahmed Gamil ال تنسونا من صالح دعائكم
؟ VPC الـ ما هي
عادية networkوتستطيع استخدامها كأنها real network الـ حد كبير الى وهي تشبه virtual networkهي VPC الـ
IPsوتضع لها subnetsى الوتقسمها
VPC CONCEPTS
VPCs and Subnets
اخرى VPCعن اي logicallyوهي مفصوله accountللـ مخصصه virtual networkهي VPC الـ
ACLواضافة subnetsعمل استخدامها في تستطيع
EIP integrated
VPC الـ تستخدم التي instancesللـ EIP ستطيع اعطاءت
private IP الـ و Public الـ بين mappingتقوم بعمل
EC2-classic الـ لها وهذا ال يمكن في creationبعد عمل instancesللـ assigned الـ security group الـ تستطيع تغيير
instance
EC2-classic instance الـ اثنين ، بينما الـ فقط او public IPفقط او private IPتستطيع ان تعطي لها VPC instance الـ
نوعين الـ تأخد كال
VPC instance الـ في NICلكل EIPتستطيع اعطاء
Provide site-to-site VPN to your AWS ENV.
inbound trafficللـ manageتستطيع عمل
AWS الـ وبين your companyبين VPNتستطيع عمل
..…,ping, file sharingتستطيع عمل
SCENARIOS FOR AMAZON VPC
Amazon AWS Foundation
57 Virtual Private Cloud (VPC) | By Ahmed Gamil ال تنسونا من صالح دعائكم
SCENARIO 1: VPC WITH A PUBLIC SUBNET ONLY
EIPs الـ و single private subnet بين mappingهو
EIPعادية ليس لها subnetانها private subnet الـ يقصد ب
publicفتصبح EIP الـ ب mappedولكنها private subnetانها public subnet الـ يقصد ب
blog or simple web siteمثل
SCENARIO 2: VPC WITH PUBLIC AND PRIVATE SUBNETS
الـ subnet الـ ، و EIPمع mapped، واحدهما NAT deviceبينهم private subnets 2هي عبارة عن
mapped الـ مع EIP تعتبرpublic subnet
SCENARIO 3: VPC WITH PUBLIC AND PRIVATE SUBNETS AND
HARDWARE VPN ACCESS
Amazon AWS Foundation
58 Routing Table | By Ahmed Gamil ال تنسونا من صالح دعائكم
حتي VPNبـ private subnet الـ ، وتتصل privateاخري الـ و publicاحدهما subnets 2عبارة عن
يهمالى ال real data center الـ اخري في serversاضافة اي admin الـ يستطيع
خارجالـ من visitors الـ يدخل عليها web applicationة وجود التستخدم في ح public subnet الـ و
SCENARIO 4: VPC WITH A PRIVATE SUBNET ONLY AND HARDWARE
VPN ACCESS
public NWسابقة ولكن بدون وجود المثل
ROUTING TABLE
traffic الـ تحدد مسار التي rules الـ عباره عن مجموعة من routing table الـ
يمكن تعديله main routing tableيوجد بداخله router الـ ا وهذ routerيحتوي علي VPC الـ و
بعضالبعضها الى وصول الب instancesللـ تسمح local routing tableهي default routing table الـ وهذا
خاصه routing tableلها VPCوكل
Amazon AWS Foundation
59 Routing Table | By Ahmed Gamil ال تنسونا من صالح دعائكم
default subnet الـ ا فسوف تأخد الـ و subnetلكل routing tableويجب تخصيص
الـ قادم هذا request، بحيث يتم توجيه اي targetو destinationيجب ان يكون معرف بـ table الـ في routeوكل
Target الـ هذا الى destination
خارجالى اليتم توجيهه NAT instance الى الـ قادم requestصورة نجد ان اي الوفي
CREATE NAT INSTANCE
جديدة Instanceقم بعمل -1
لها EIPقم بتخصيص -2
3- disable source/dist. check
Amazon AWS Foundation
60 Amazon Simple Storage Service (S3 ) | By Ahmed Gamil ال تنسونا من صالح دعائكم
الى تصل packetالي dropتقوم بعمل instance الـ حيث يجعل enabled by defaultيكون option الـ وهذا
خطأالـ بطريق instance الـ
AMAZON SIMPLE STORAGE SERVICE (S3 )
amazonتستخدمها التي storage ـ الهي نوع من انواع S3 الـ
PCخاص بأي العادي ال HDD الـ تعامل معه كالتستطيع web accessله big hard driveوهي عبارة عن
dynamic الـ وال تستطيع وضع … ,text files, PIC الـ مثل static web contents الـ ع عليه ضكما تستطيع ان ت
contents ـ ال، كما انها تدعم RIST &SOAP API ويمكن عمل ،website الـ يستخدم S3 مثلdropbox ذي يستخدم فعليا الـ
S3 الـ
sitesللـ on the fly development الـ كما انه يدعم
TB 5بمساحة fileويستطيع تخزين objectsكانها files الـ مع S3 الـ يتعامل
مخزنه بداخله objects 10000لكل object 1د انه يمكن ان يفقالى تصل S3 الـ كفائه
5GBتستطيع استخدام free account الـ و transfer rate الـ يستخدمها و التي storage الـ عميل حسب حجم الـيتم حساب
storage 15و GB transfers/month
Amazon AWS Foundation
61 Amazon Simple Storage Service (S3 ) | By Ahmed Gamil ال تنسونا من صالح دعائكم
units 2 الـ اذا انتهي بشكل كامل علي االتخزين قد تم بشكل صحيح الوال يعتبر S3 units 2علي data الـ يتم نسخ
بان يخزن ملفاته customerللـ وهي خاصية تسمح reduce redundancy storage (RRS)وهي S3للـ هناك خاصية هامه
تكلفة الـ تقليل customer الـ او مرتين ، وبذلك يستطيع units 2وليس علي (on one S3 unit)مرة واحده فقط S2 الـ علي
Important filesطريقة عند تخزين الو ال تفضل هذه
RRSللـ كبديل HDD 2باستخدام unit الـ مرتين علي نفس data الـ ولكن يمكن تخزين
raid 5 or raid 6تكون unitفي كل HDD الـ
وهذه changed data لـ ااو data الـ من versionحيث تستطيع تخزين اكثر من versioning الـ خاصية S3 الـ تدعم
وهي مجانيه developersللـ ية هامه الخاص
remote S3علي Data الـ ، حيث تستطيع تخزين disaster backup الـ و normal backup الـ في S3 الـ يمكن استخدام
الى لها transmitثم compressثم dataللـ encrypt، ويقوم بذلك بعد عمل Availability zoneاو regionفي اي
remote region
CREATE S3
S3 الـ للتعامل مع block diagram الـ هذا هو
CREATE A BUCKET
للـ و لها permissionsنسنطيع ان نضع بداخله اي ملفات ووضع .. ,C, D الـ مثل partitionهو عبارة عن bucket الـ
bucket نفسها
لها cnameالنه سيتم وضع uniqueون اسمها يجب ان يك bucket الـ وهذه
1-
Amazon AWS Foundation
62 Amazon Simple Storage Service (S3 ) | By Ahmed Gamil ال تنسونا من صالح دعائكم
2-
http://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html
BUCKET PROPERTIES
Amazon AWS Foundation
63 Amazon Simple Storage Service (S3 ) | By Ahmed Gamil ال تنسونا من صالح دعائكم
PERMISSIONS
وعمل bucket الـ الستعراض محتويات listمثل عمل aws userلكل bucket permissions الـ في نستطيع ان نتحكم
upload/download للـfiles الـ وغيرها من permissions اخرىالـ
permissions الـ ستطيق عليهم هذه التي groups الـ تحكم في الـ ويمكن
authenticated user هوaws users only
Amazon AWS Foundation
64 Amazon Simple Storage Service (S3 ) | By Ahmed Gamil ال تنسونا من صالح دعائكم
log delevary هيgroup الـ تستخدم لكتابه server access logs الـ علي bucket الـ وذلك عند استخدام bucket ك
server access logs storage
http://docs.aws.amazon.com/AmazonS3/latest/UG/EditingBucketPermissions.html
STATIC WEBSITE HOSTING
website hostingـ الـ في bucket الـ عندما تريد استخدام property الـ تستخدم هذه
websiteالي recordويمكن اضافته ك Cname الـ وهو Endpont URLوالحظ وجود
enable website hostingه اختيار الـ في ح
اذا ما واجه اي مشاكل visitorللـ Guideك error documentويمكن ان تضع index file الـ فيجب ان تضع
bucket الـ يجب ان يكونوا موجودين بداخل error document الـ و index.html الـ و
التالية الصورةاخر كما في URLالي redirectكما يمكن عمل
http://docs.aws.amazon.com/AmazonS3/latest/UG/ConfiguringBucketWebsite.html
ADD AN OBJECT TO A BUCKET
1-
Amazon AWS Foundation
65 AWS cloudfront | By Ahmed Gamil ال تنسونا من صالح دعائكم
2-
http://docs.aws.amazon.com/AmazonS3/latest/gsg/PuttingAnObjectInABucket.html
AWS CLOUDFRONT
عليه hosted الـ websites الى الـ الوصوللتسريع amazonيستخدمها serviceهي cloudfront الـ
في amazon servers الـ علي كل website info الـ لتوزيع amazonستخدمها ي distribution serviceوهي عبارة عن
لفترة زمنية معينه cloud front cash الـ في Info الـ م وتخزين هذه العالجميع انحاء
Amazon AWS Foundation
66 AWS cloudfront | By Ahmed Gamil ال تنسونا من صالح دعائكم
cloudfront الـ ولتفعيل استخدام
1-
2-
3-
distribution الـ نوعين من وهنا نجد
web : الـ اذا كان cloud front سيقوم بعملdistribution لـnormal web site
Amazon AWS Foundation
67 Route 53 DNS | By Ahmed Gamil ال تنسونا من صالح دعائكم
RTMP : الـ اذا كان cloud front سيقوم بعملdistribution لـvedio straming ولكن يجب عملweb distribution
web site الـ اوال لهذا
4-
ROUTE 53 DNS
AWS based on DNSيقصد به
port 53 udp الـ م يستخد DNS الـ وكما نعلم ان
لها configuration الـ اذا قمنا باضافة بعض route 53 الـ في recordوضع Instance الـ تستطيع
FEATURES
Latency Based Routing
ELBوجود حالةوذلك في requests الـ ترسل التي region الـ اعتمادا علي load balancer الـ ب الخاص latency الـ يقيس
region الـ في
DNS Failover
visitor location الـ في failureوجود حالةاخر في Locationالى visitor requestللـ redirectيقوم بعمل
Weighted Round Robin (WRR)
user requestsللـ DNS responce الـ تقيس معدل
http://aws.amazon.com/route53/
USING ROUTE 53
Amazon AWS Foundation
68 Route 53 DNS | By Ahmed Gamil ال تنسونا من صالح دعائكم
records الـ وللتعديل علي
Amazon AWS Foundation
69 Route 53 DNS | By Ahmed Gamil ال تنسونا من صالح دعائكم