๐Ÿ™‚0614 [AWS]

๋ง์ง€ยท2022๋…„ 6์›” 14์ผ
0
post-custom-banner

๐Ÿ“Œ AWS - ์ด๋ก 

๐Ÿ“™ SNAPSHOT, IAM, RDS , AutoScaling


โœ”๏ธ + ํƒ€์ž„๋จธ์‹ ์˜ ๊ธฐ๋Šฅ


๐Ÿ“Œ AWS - ์‹ค์Šต

๐Ÿ“™ RDS

โœ”๏ธ 1. RDS - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ƒ์„ฑ - ํ‘œ์ค€ , MySQL - ์—๋””์…˜ : MySQL Community - ๋ฒ„์ „ : 5.7.22

โœ”๏ธ 2. ํ…œํ”Œ๋ฆฟ : ํ”„๋ฆฌํ‹ฐ์–ด - ์‹๋ณ„์ž : database-1 - ๋งˆ์Šคํ„ฐ ์‚ฌ์šฉ์ž ์ด๋ฆ„ : lovemj - ๋งˆ์Šคํ„ฐ ์•”ํ˜ธ, ์•”ํ˜ธ ํ™•์ธ ์ž…๋ ฅ

โœ”๏ธ 3. ์ธ์Šคํ„ด์Šค ๊ตฌ์„ฑ : db.t2.micro - ์Šคํ† ๋ฆฌ์ง€ ์œ ํ˜• : ๋ฒ”์šฉ SSD(gp2) - ํ• ๋‹น๋œ ์Šคํ† ๋ฆฌ์ง€ : 20 GiB - ์Šคํ† ๋ฆฌ์ง€ ์ž๋™ ์กฐ์ • ํ™œ์„ฑํ™” - ์ตœ๋Œ€ ์Šคํ† ๋ฆฌ์ง€ ์ž„๊ณ„๊ฐ’ : 1000GiB

โœ”๏ธ 4. VPC : MY-VPC - ์„œ๋ธŒ๋„ท ๊ทธ๋ฃน : ์ƒˆ ์„œ๋ธŒ๋„ท ๊ทธ๋ฃน ์ƒ์„ฑ - ํผ๋ธ”๋ฆญ์•ก์„ธ์Šค : ์•„๋‹ˆ์š” - VPC ๋ณด์•ˆ๊ทธ๋ฃน : ๊ธฐ์กด; SG-DB -๊ฐ€์šฉ์˜์—ญ : 2b

โœ”๏ธ 5. ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ธ์ฆ ์˜ต์…˜ : ์•”ํ˜ธ ์ธ์ฆ - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์˜ต์…˜ : wordpress - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ƒ์„ฑ ํด๋ฆญ

๐Ÿ“™ ์›น์„œ๋ฒ„ ์ƒ์„ฑ

โœ”๏ธ 1. EC2 - ์ธ์Šคํ„ด์Šค - ์ธ์Šคํ„ด์Šค ์‹œ์ž‘ - ์ด๋ฆ„ : WEBSERVER - ์ด๋ฏธ์ง€ : Amazon Linux 2 Kernel 5.10 AMI 2.0.20220426.0 x86_64 HVM gp2 - ์ธ์Šคํ„ด์Šค ์œ ํ˜• : t2.micro - ํ‚ค ํŽ˜์–ด : aws-key - ๋„คํŠธ์›Œํฌ ์„ค์ • ํŽธ์ง‘ ; VPC : MY-VPC - ์„œ๋ธŒ๋„ท : MY-PUBLIC-SUBNET-2A - ํผ๋ธ”๋ฆญ IP ์ž๋™ ํ• ๋‹น : ํ™œ์„ฑํ™” - ๋ฐฉํ™”๋ฒฝ ๊ธฐ์กด ๋ณด์•ˆ ๊ทธ๋ฃน ์„ ํƒ : SG-WEB - ๊ณ ๊ธ‰ ์„ธ๋ถ€ ์ •๋ณด ; ์‚ฌ์šฉ์ž๋ฐ์ดํ„ฐ :

#!/bin/bash
yum install -y httpd git
systemctl enable --now httpd
cd /tmp
git clone https://github.com/hali-linux/html.git
cp -r /tmp/html/* /var/www/html/

โœ”๏ธ 1-1. ์ธ์Šคํ„ด์Šค ์‹œ์ž‘ ํด๋ฆญ

๐Ÿ“™ ์•Œ๋ฆฌ๋ฐ”๋ฐ” DNS์ด์šฉํ•˜๊ธฐ

โœ”๏ธ 1. ์•Œ๋ฆฌ๋ฐ”๋ฐ” ์ฝ˜์†” - alibaba cloud DNS - ์ด๋ฏธ ๋“ฑ๋กํ•ด๋‘์—ˆ๋˜ ๋„๋ฉ”์ธ ๋„ค์ž„ ํด๋ฆญ

โœ”๏ธ 2. Add Record - Host(์„œ๋ธŒ๋„๋ฉ”์ธ):blog - Value: AWS์—์„œ ๋งŒ๋“  ์›น์„œ๋ฒ„ ํผ๋ธ”๋ฆญ IP- Confirm

โœ”๏ธ 3. ๋„๋ฉ”์ธ์œผ๋กœ ์›นํŽ˜์ด์ง€ ์ ‘์† ๊ฐ€๋Šฅ

๐Ÿ“™ WEBSERVER wordpress ์„ค์น˜ ๋ฐ ์—ฐ๊ฒฐ

โœ”๏ธ 0. mobaxterm์œผ๋กœ WEBSERVER์ง„์ž…

โœ”๏ธ 1. ์•„๋ž˜ ๋ช…๋ น์–ด ์ž…๋ ฅ

# wget https://ko.wordpress.org/wordpress-4.8.2-ko_KR.zip
# sudo yum install -y httpd php php-mysql php-gd php-mbstring wget unzip
# cd /var/www/html
# sudo unzip /home/ec2-user/wordpress-4.8.2-ko_KR.zip
# sudo mv ./wordpress/* .
# sudo chown -R apache:apache /var/www/*
# sudo systemctl restart httpd
# sudo systemctl enable httpd
์›น๋ธŒ๋ผ์šฐ์ € http://blog.lovemj.shop/

โœ”๏ธ 2. aws database ์—”๋“œํฌ์ธํŠธ ๋ณต์‚ฌํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํ˜ธ์ŠคํŠธ์— ๋„ฃ์–ด์ฃผ๊ณ , ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ƒ์„ฑ์‹œ ๋งŒ๋“  ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฆ„, ์‚ฌ์šฉ์ž ์ด๋ฆ„, ์•”ํ˜ธ ์ž…๋ ฅํ•ด์ฃผ๊ณ  ์„ค์น˜.

๐Ÿ“™ DB์ง„์ž…ํ•˜๊ธฐ

โœ”๏ธ 0. RDS - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค - database-1 - ์ˆ˜์ • - ์ถ”๊ฐ€ ๊ตฌ์„ฑ : ํผ๋ธ”๋ฆญ ์•ก์„ธ์Šค ๊ฐ€๋Šฅ ์ฒดํฌ - ๊ณ„์† - DB์ธ์Šคํ„ด์Šค ์ˆ˜์ •

โœ”๏ธ 1. RDS - ์„œ๋ธŒ๋„ท ๊ทธ๋ฃน - DB์„œ๋ธŒ๋„ท ๊ทธ๋ฃน ์ƒ์„ฑ - ์ด๋ฆ„ : MY-RDS-SUBNET - ์„ค๋ช… :MY-RDS-SUBNET - VPC : MY-VPC - ๊ฐ€์šฉ์˜์—ญ : a,b,c,d ๋ชจ๋‘์„ ์ฑ… - ๊ฐ ๊ฐ€์šฉ์˜์—ญ๋งˆ๋‹ค public๊ณผ ์—ฐ๊ฒฐ๋œ ์„œ๋ธŒ๋„ท ์„ ํƒ - ์ƒ์„ฑ

โœ”๏ธ 2. RDS - ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค - database-1 - ์ˆ˜์ • - ์„œ๋ธŒ๋„ท ๊ทธ๋ฃน : my-rds-subnet - ๊ณ„์† - DB์ธ์Šคํ„ด์Šค ์ˆ˜์ • ํด๋ฆญ

=> ์‹คํŒจ,,,์ƒ์„ฑ ์ „์— ์ด๋ ‡๊ฒŒ ํ–ˆ์–ด์•ผ ํ•จ.

๐Ÿ“™ WEB02 ์ƒ์„ฑ

โœ”๏ธ ์ด์ „์— ๋งŒ๋“  WEBSERVER์™€ ๋ชจ๋‘ ๊ฐ™๊ณ , ๊ฐ€์šฉ์˜์—ญ๋งŒ C๋กœ ํ•ด์ฃผ๊ธฐ.

๐Ÿ“™ WEBSERVER๋ผ๋ฆฌ ๋ชจ๋“  ํฌํŠธ ํ†ต์‹  ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๋Š” ๋ณด์•ˆ๊ทธ๋ฃน

โœ”๏ธ ๋ณด์•ˆ๊ทธ๋ฃน - sg-web - ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ ํŽธ์ง‘ - icmp, http ์‚ญ์ œ - ๊ทœ์น™ ์ถ”๊ฐ€

โœ”๏ธ ์œ ํ˜• : ๋ชจ๋“  ํŠธ๋ž˜ํ”ฝ - ์†Œ์Šค ์œ ํ˜• : ์‚ฌ์šฉ์ž ์ง€์ • - ์†Œ์Šค : SG-WEB - ๊ทœ์น™ ์ €์žฅ

๐Ÿ“™ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ (NLB)

โœ”๏ธ 1. EC2 - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ - NLB ์ƒ์„ฑ -์ด๋ฆ„ : ELB-NLB - ์ฒด๊ณ„ : ์ธํ„ฐ๋„ท ๊ฒฝ๊ฒŒ - IP ์ฃผ์†Œ ์œ ํ˜• : IPv4 - VPC : MY-VPC - ๋งคํ•‘ : 2a,2c - ์„œ๋ธŒ๋„ท : ํผ๋ธ”๋ฆญ์œผ๋กœ ์„ ํƒ - ๋Œ€์ƒ๊ทธ๋ฃน ์ƒ์„ฑ

โœ”๏ธ 2. ๋Œ€์ƒ ์œ ํ˜• : ์ธ์Šคํ„ด์Šค - ๋Œ€์ƒ ๊ทธ๋ฃน ์ด๋ฆ„ : TG-NLB - VPC : MY-VPC - ๋‹ค์Œ

โœ”๏ธ 2-1. ์ธ์Šคํ„ด์Šค๋“ค์„ ์•„๋ž˜์— ๋ณด๋ฅ˜ ์ค‘์ธ ๊ฒƒ์œผ๋กœ ํฌํ•จ - ๋Œ€์ƒ ๊ทธ๋ฃน ์ƒ์„ฑ

โœ”๏ธ 3. ๋‹ค์‹œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ ํƒญ์œผ๋กœ ๋Œ์•„์™€์„œ , ๋Œ€์ƒ๊ทธ๋ฃน ์˜†์— ์ƒˆ๋กœ๊ณ ์นจ ๋ฒ„ํŠผ ๋ˆ„๋ฅด๊ณ  ๊ธฐ๋ณธ ์ž‘์—… ๋Œ€์ƒ ๊ทธ๋ฃน TG-NLB ์„ ํƒ ํ›„ ๋กœ๋“œ ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ

โœ”๏ธ 4. SG-WEB ๋ณด์•ˆ๊ทธ๋ฃน ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ HTTP ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ.

โœ”๏ธ 5. ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ - ํ•ด๋‹น ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ์˜ ๊ธฐ๋ณธ๊ตฌ์„ฑ์— ์žˆ๋Š” DNS์ด๋ฆ„์œผ๋กœ ๋กœ๋“œ๋ฐธ๋Ÿฐ์‹ฑ ๋œ ์›นํŽ˜์ด์ง€ ์ ‘์† ๊ฐ€๋Šฅ

โœ”๏ธ 6. DNS์ด๋ฆ„์ด ๋ณต์žกํ•˜๊ณ  ๊ธธ๊ธฐ๋•Œ๋ฌธ์—, ์•Œ๋ฆฌ๋ฐ”๋ฐ”์—์„œ ์ˆ˜์ •ํ•ด์•ผํ•จ - Alibaba Cloud DNS/Manage DNS/DNS Settings (๋„๋ฉ”์ธ ์…‹ํŒ… ์ฐฝ ) - Add Record - type : CNAME - host: nlb - Value: nlb DNS์ด๋ฆ„ -confirm

๐Ÿ“™ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ (ALB)

โœ”๏ธ 1. EC2 - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ - ALB ์ƒ์„ฑ -์ด๋ฆ„ : ELB-ALB - ์ฒด๊ณ„ : ์ธํ„ฐ๋„ท ๊ฒฝ๊ฒŒ - IP ์ฃผ์†Œ ์œ ํ˜• : IPv4 - VPC : MY-VPC - ๋งคํ•‘ : 2a,2c - ์„œ๋ธŒ๋„ท : ํผ๋ธ”๋ฆญ์œผ๋กœ ์„ ํƒ - ์ƒˆ ๋ณด์•ˆ๊ทธ๋ฃน ์ƒ์„ฑ

โœ”๏ธ 2. ๋ณด์•ˆ๊ทธ๋ฃน ์ด๋ฆ„ : SG-ALB - ์„ค๋ช… : SG-ALB - VPC : MY-VPC (ํƒœ๊ทธ ์•ˆ๋ณด์ด๋ฉด X๋กœ ์ง€์šด ํ›„ ๋‹ค์‹œ ์„ ํƒ) - ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™; ์œ ํ˜• : HTTP - ์†Œ์Šค ์œ ํ˜• : Anywtere-IPv4 - ๋ณด์•ˆ ๊ทธ๋ฃน ์ƒ์„ฑ

โœ”๏ธ 3. ๋‹ค์‹œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ ํ™”๋ฉด(ํƒญ)์œผ๋กœ ๋Œ์•„์™€์„œ, ๋ณด์•ˆ๊ทธ๋ฃน ์˜† ์ƒˆ๋กœ๊ณ ์นจ ๋ˆ„๋ฅธ ๋‹ค์Œ ๋“œ๋ž๋‹ค์šด ๋‚ด๋ ค์„œ SG-ALB ์„ ํƒ - ๋ฆฌ์Šค๋„ˆ ๋ฐ ๋ผ์šฐํŒ…; ํ”„๋กœํ† ์ฝœ ; HTTP ; ๋Œ€์ƒ๊ทธ๋ฃน ์ƒ์„ฑ

โœ”๏ธ 4. ๋Œ€์ƒ ์œ ํ˜• ์„ ํƒ : ์ธ์Šคํ„ด์Šค - ๋Œ€์ƒ ๊ทธ๋ฃน ์ด๋ฆ„ : TG-ALB - ๋‹ค์Œ - ๋‘ ์ธ์Šคํ„ด์Šค ๋ชจ๋‘ ์„ ํƒํ•ด์„œ '์•„๋ž˜์— ๋ณด๋ฅ˜ ์ค‘์ธ ๊ฒƒ์œผ๋กœ ํฌํ•จ'ํด๋ฆญ - ๋Œ€์ƒ ๊ทธ๋ฃน ์ƒ์„ฑ ํด๋ฆญ

โœ”๏ธ 5. ๋‹ค์‹œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ ํ™”๋ฉด(ํƒญ)์œผ๋กœ ๋Œ์•„์™€์„œ, ๋Œ€์ƒ ๊ทธ๋ฃน TG-ALB ์„ ํƒ - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ์ƒ์„ฑ ํด๋ฆญ - ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ ๋ณด๊ธฐ , ์ƒ์„ฑ๋˜๋ฉด ๋Œ€์ƒ๊ทธ๋ฃน - ๋Œ€์ƒ์—์„œ healthy check ํ™•์ธ.

โœ”๏ธ 6. ์•Œ๋ฆฌ๋ฐ”๋ฐ” DNS AddRecordํ†ตํ•ด์„œ CNAME์œผ๋กœ ๋ ˆ์ฝ”๋“œ ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ. ; host : alb - Value : TG-ALB์˜ DNS ์ด๋ฆ„ - confirm

โœ”๏ธ 7. ์›น๋ธŒ๋ผ์šฐ์ €์—์„œ alb.lovemj.shop์œผ๋กœ ์ง„์ž…ํ•ด์„œ ๋กœ๋“œ๋ฐธ๋Ÿฐ์‹ฑ ํ™•์ธํ•˜๊ธฐ. ( ๋ผ์šด๋“œ ๋กœ๋นˆ)

โœ”๏ธ 8. ๋ณด์•ˆ๊ทธ๋ฃน - SG-WEB ID ํด๋ฆญ - ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ ํŽธ์ง‘ - HTTP ์‚ญ์ œ - ๊ทœ์น™ ์ถ”๊ฐ€ - ์œ ํ˜• : HTTP - ์†Œ์Šค ์œ ํ˜• : ์‚ฌ์šฉ์ž ์ง€์ • - ์†Œ์Šค : SG-ALB - ์ €์žฅ

=> ALB ๋„๋ฉ”์ธ ํ†ตํ•ด์„œ๋งŒ ์ง„์ž…๊ฐ€๋Šฅ ํ•œ ๊ฒƒ ํ™•์ธํ•˜๊ณ  ๋‹ค์‹œ ์›๋ณต. HTTP 0.0.0.0/0

๐Ÿ“™ ์•„์›ƒ๋ฐ”์šด๋“œ (๋ณด๋ฅ˜)

โœ”๏ธ 1. web01 mobaxterm์ด์šฉํ•ด์„œ web02 ์ง„์ž…ํ•˜๊ธฐ.

[ec2-user@ip-10-14-5-253 ~]$ ls
wordpress-4.8.2-ko_KR.zip
## ํƒ์ƒ‰์ฐฝ ์ด์šฉํ•ด์„œ ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— key๋„ฃ์–ด๋‘๊ธฐ
[ec2-user@ip-10-14-5-253 ~]$ ls
aws-key.pem  wordpress-4.8.2-ko_KR.zip

[ec2-user@ip-10-14-5-253 ~]$ chmod 400 aws-key.pem

[ec2-user@ip-10-14-5-253 ~]$ ssh -i aws-key.pem ec2-user@10.14.36.232

The authenticity of host '10.14.36.232 (10.14.36.232)' can't be established.
ECDSA key fingerprint is SHA256:FMZ0uwyXLy2ytOKGRfv1prspDWrrmQS7sc8PU605Ieg.
ECDSA key fingerprint is MD5:42:14:34:da:25:f1:17:9e:60:3a:1f:99:27:e1:62:ae.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.14.36.232' (ECDSA) to the list of known hosts.
Last login: Tue Jun 14 02:39:08 2022 from 123.142.252.25

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
16 package(s) needed for security, out of 26 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-14-36-232 ~]$

๐Ÿ“™ ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ(ALB) ๋ฐฑ์—”๋“œ ๊ด€๋ฆฌ (L7์„ค์ • - Content Switching)

โœ”๏ธ 0. ๋Œ€์ƒ๊ทธ๋ฃน - ๋Œ€์ƒ๊ทธ๋ฃน ์ƒ์„ฑ - ์ด๋ฆ„ : TG-CACTUS - VPC : MY-VPC - ๋‹ค์Œ - web01๋งŒ ์„ ํƒ ํ•˜์—ฌ '์•„๋ž˜ ๋ณด๋ฅ˜ ์ค‘์ธ ๊ฒƒ์œผ๋กœ ํฌํ•จ' - ๋Œ€์ƒ ๊ทธ๋ฃน ์ƒ์„ฑ ํด๋ฆญ

โœ”๏ธ 1. ๋Œ€์ƒ ๊ทธ๋ฃน ์ƒ์„ฑ - ์ด๋ฆ„ : TG-RABBITS -
VPC : MY-VPC - ๋‹ค์Œ - web02๋งŒ ์„ ํƒ ํ•˜์—ฌ '์•„๋ž˜ ๋ณด๋ฅ˜ ์ค‘์ธ ๊ฒƒ์œผ๋กœ ํฌํ•จ ' - ๋Œ€์ƒ ๊ทธ๋ฃน ์ƒ์„ฑ ํด๋ฆญ

โœ”๏ธ 2. ๋กœ๋“œ๋ฐธ๋Ÿฐ์„œ - ๋ฆฌ์Šค๋„ˆ - ๊ทœ์น™ ๋ณด๊ธฐ/ ํŽธ์ง‘

โœ”๏ธ 2-1. ๊ทœ์น™ ์˜† + ๋ฒ„ํŠผ ํด๋ฆญ - ๊ทœ์น™ ์‚ฝ์ž… - ์กฐ๊ฑด์ถ”๊ฐ€ ๋“œ๋ž๋‹ค์šด : HTTP ํ—ค๋” : User-Agent - ํ™•์žฅํ•˜๋Š” ๋ฐ ๊ฐ’ : *Mobile* -์ „๋‹ฌ ๋Œ€์ƒ : ๋Œ€์ƒ๊ทธ๋ฃน : TG-CACTUS - ์ €์žฅ

โœ”๏ธ 2-2. ๊ทœ์น™ ์‚ฝ์ž… - ์กฐ๊ฑด์ถ”๊ฐ€ ๋“œ๋ž๋‹ค์šด : HTTP ํ—ค๋” : User-Agent - ํ™•์žฅํ•˜๋Š” ๋ฐ ๊ฐ’ : *Chrome* - ์ „๋‹ฌ๋Œ€์ƒ : ๋Œ€์ƒ ๊ทธ๋ฃน : TG-RABBITS - ์ €์žฅ

โœ”๏ธ 2-3. ๊ทœ์น™ ์žฌ์ •๋ ฌ - Mobile ์œ„๋กœ ์˜ฌ๋ผ๊ฐ€๊ฒŒ ํด๋ฆญ - ์ €์žฅ

๐Ÿ“™ AutoScaling

web01 ์‚ญ์ œ ํ›„ web02(ํ† ๋ผ ํŽ˜์ด์ง€) ์ด๋ฆ„์„ origin์œผ๋กœ ๋ฐ”๊ฟ”์„œ ์ง„ํ–‰

โœ”๏ธ 0. alibaba DNS์—์„œ ๋„๋ฉ”์ธ Add Record - Type : A , host : www , value : origin ํผ๋ธ”๋ฆญ IP - confirm

โœ”๏ธ 1. food.tar ์›น์‚ฌ์ดํŠธ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ํŒŒ์ผmobaxtermํ†ตํ•ด origin์„œ๋ฒ„ ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์— ๋„ฃ์–ด์„œ ์•„๋ž˜ ๋ช…๋ ์–ด ์ง„ํ–‰. [์›นํŽ˜์ด์ง€ ๊พธ๋ฏธ๊ธฐ]

[ec2-user@ip-10-14-36-232 ~]$ sudo tar -xvf food.tar -C /var/www/html/

โœ”๏ธ 2. ec2-์ธ์Šคํ„ด์Šค - origin ์ฒดํฌ - ์ž‘์—… - ์ด๋ฏธ์ง€ ๋ฐ ํ…œํ”Œ๋ฆฟ - ์ด๋ฏธ์ง€ ์ƒ์„ฑ

โœ”๏ธ 2-1. ์ด๋ฏธ์ง€ ์ด๋ฆ„ : MT-AMI - ์žฌ๋ถ€ํŒ… ์•ˆํ•จ : ํ™œ์„ฑํ™” - ์ด๋ฏธ์ง€ ์ƒ์„ฑ

โœ”๏ธ 3. ์Šค๋ƒ…์ƒท๊ณผ ์ด๋ฏธ์ง€ ์ƒ์„ฑ ์™„๋ฃŒ ๋˜๋ฉด, ec2 - ์‹œ์ž‘ ํ…œํ”Œ๋ฆฟ - ์‹œ์ž‘ ํ…œํ”Œ๋ฆฟ ์ƒ์„ฑ - ์ด๋ฆ„ : MY-TEMP - ํ…œํ”Œ๋ฆฟ ๋ฒ„์ „ ์„ค๋ช… : MY-TEMP - auto scaling ์ง€์นจ : ์ฒดํฌ

๐Ÿ“™โœ”๏ธโœ๏ธ๐Ÿ“ขโญ๏ธ๐Ÿ“Œ

๐Ÿ“Œ ๊ธฐํƒ€

โญ๏ธ ๊ฐœ๋ฐœ์—์„œ ๋Ÿฐ์นญ๊นŒ์ง€ ์ˆœ์„œ

โœ”๏ธ ๊ฐœ๋ฐœ(dev) -> ํ…Œ์ŠคํŠธ(QA;ํ’ˆ์งˆ๋ณด์ฆ;ํ’ˆ๋ณด) -> ์Šคํ…Œ์ด์ง• -> ํ”„๋กœ๋•์…˜(Ops)

โญ๏ธ RDS ์ƒ์„ฑ - ๊ฐ€์šฉ์„ฑ ๋ฐ ๋‚ด๊ตฌ์„ฑ

โœ”๏ธ ๋‹ค๋ฅธ ๊ฐ€์šฉ์˜์—ญ์— ์ธ์Šคํ„ด์Šค ์ƒ์„ฑํ•ด์„œ ํ•˜๋‚˜๊ฐ€ ์†์ƒ๋˜๋”๋ผ๋„ ๋น ๋ฅด๊ฒŒ ๋ณต๊ตฌํ•˜๊ณ  ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋‹ค์ค‘ AZ ๋ฐฐํฌ ์‚ฌ์šฉ - ์‹ค์Šต ํ”„๋ฆฌํ‹ฐ์–ด์—์„œ๋Š” ์‚ฌ์šฉํ•˜์ง€ ์•Š์Œ. ์‹ค๋ฌด์—์„œ๋Š” ์‚ฌ์šฉํ•  ๊ฒƒ.

โญ๏ธ ๋‹จ์ผ์žฅ์• ์ง€์ (SPOF;Single Point Of Failure)

โœ”๏ธ ํ•˜๋‚˜์˜ ์„œ๋ฒ„๋กœ๋งŒ ์šด์˜ํ•˜๋Š” ๊ฒƒ.(ex. ์‡ผํ•‘๋ชฐ ํŽ˜์ด์ง€ ์›น์„œ๋ฒ„ 1๊ฐœ๋งŒ ๋‘๋Š” ๊ฒƒ.) => ๋‹จ์ผ์žฅ์• ์ง€์ ์€ ํ”ผํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Œ. ์„œ๋ฒ„ 2๊ฐœ ์ด์ƒ์€ ์žˆ๋Š”๊ฒŒ ์ข‹๋‹ค.

โญ๏ธ ์ด๋ฏธ์ง€๋Š” ๊ป๋ฐ๊ธฐ ๋‚ด์šฉ๋ฌผ์€ ์Šค๋ƒ…์ƒท์ด๋‹ค.

์ด๋ฏธ์ง€ ๋งŒ๋“ค๋ฉด ์Šค๋ƒ…์ƒท๋„ ๋งŒ๋“ค์–ด์ง. ์ด๋ฏธ์ง€ ๋‹จ๋…์œผ๋กœ ์กด์žฌํ•  ์ˆ˜ ์—†๋‹ค. ์Šค๋ƒ…์ƒท์ด ๋‹ค ๋งŒ๋“ค์–ด์ ธ์•ผ ์ด๋ฏธ์ง€๋„ ๋งŒ๋“ค์–ด์ง.

profile
๊พธ์ค€ํžˆ, ์ฐจ๊ทผ์ฐจ๊ทผ
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€