Best Practices for NoSQL Workloads on Amazon EC2 and Amazon EBS - February 2017 Online Tech Talks
Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic...
Transcript of Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic...
![Page 1: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/1.jpg)
Cluster of Web-Servers with AWSCloud Computing
November, 2018
Mauricio Altamirano Silva
Julia Johnson
Sefer Ul
![Page 2: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/2.jpg)
Agenda
▸ AWS▸ Create EC2 (Elastic Compute Cloud)▸ Create EBS (Elastic Block Storage)▸ Cloning the EC2 & EBS ▸ Install and Configure NGINX ▸ Set up Let’s Encrypt with NGINX Server ▸ Create ELB (Elastic Load Balancer)▸ Configure Domain Name with ELB ▸ Monitoring the Web-Server Cluster - DEMO
2
![Page 3: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/3.jpg)
▸ Amazon Web Services provides on-demand cloud computing platforms to individuals, companies and governments, on a paid subscription basis.
3
AWS (Amazon Web Services)
![Page 4: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/4.jpg)
Create EC2 (Elastic Compute Cloud)
4
![Page 5: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/5.jpg)
5
Create EC2 (Elastic Compute Cloud)
![Page 6: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/6.jpg)
6
Create EC2 (Elastic Compute Cloud)
![Page 7: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/7.jpg)
7
Create EC2 (Elastic Compute Cloud)
▸ Step 5: Add Tags- No tag added
![Page 8: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/8.jpg)
Create EC2 (Elastic Compute Cloud)
8
![Page 9: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/9.jpg)
Create EC2 (Elastic Compute Cloud)
▸ Connect using ssh and certificate:▸ ssh -i 'lnx01.pem' [email protected]
9
![Page 10: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/10.jpg)
Create EBS (Elastic Block Storage)
10
![Page 11: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/11.jpg)
Create EBS (Elastic Block Storage)
11
![Page 12: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/12.jpg)
Create EBS (Elastic Block Storage)
▸ Use the lsblk command to view your available disk devices and their mount points (if applicable) to help you determine the correct device name to use.
▸ Use the sudo file -s device command to list special information, such as file system type.
▸ Create an ext4 file system on the volume
12
Making an Amazon EBS Volume Available for Use on Linux
![Page 13: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/13.jpg)
Create EBS (Elastic Block Storage)
13
Making an Amazon EBS Volume Available for Use on Linux
▸ Create mount point
▸ Use the following command to mount the volume at the created location
▸ Create a backup for your /etc/fstab file that you can use if you accidentally destroy ordelete this file while editing it
![Page 14: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/14.jpg)
Create EBS (Elastic Block Storage)
14
Making an Amazon EBS Volume Available for Use on Linux
▸ Get UUDI (Universally Unique Identifier)
▸ Add a new line to the end of the file for the volume using the following format
![Page 15: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/15.jpg)
Create EBS (Elastic Block Storage)
15
Making an Amazon EBS Volume Available for Use on Linux
▸ Check if the entry works
▸ Create symbolic link to ebs1
![Page 16: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/16.jpg)
Cloning the EC2 & EBS
16
![Page 17: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/17.jpg)
Cloning the EC2 & EBS
17
![Page 18: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/18.jpg)
Install and Configure NGINX
▸ Install Nginx:- sudo apt-get install nginx
▸ Configure:- sudo nano /etc/nginx/sites-available/default
18
![Page 19: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/19.jpg)
19
Install and Configure NGINX
![Page 20: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/20.jpg)
Set Up Let’s Encrypt with NGINX Server
20
▸ Install Nginx:- sudo apt-get install python-certbot-nginx
▸ Configure:- sudo nano /etc/nginx/sites-available/default
![Page 21: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/21.jpg)
Set Up Let’s Encrypt with NGINX Server
▸ Obtaining an SSL Certificate- sudo certbot --nginx -d example.com -d www.example.com
▸ This will change the Nginx configuration
▸ Verify the certificate
21
![Page 22: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/22.jpg)
Create Elastic Load Balancer (ELB)
22
![Page 23: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/23.jpg)
23
Create Elastic Load Balancer (ELB)
![Page 24: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/24.jpg)
24
Create Elastic Load Balancer (ELB)
![Page 25: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/25.jpg)
Create Elastic Load Balancer (ELB)
▸ To enable HTTPS in the Load Balancer we need to import the certificates created before using Certbot. ▸ Copy and paste the text in the next files into the Step2: Configure Security
Settings
25
![Page 26: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/26.jpg)
26
Create Elastic Load Balancer (ELB)
![Page 27: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/27.jpg)
27
Create Elastic Load Balancer (ELB)
![Page 28: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/28.jpg)
28
Create Elastic Load Balancer (ELB)
![Page 29: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/29.jpg)
Configure Domain Name with ELB
29
![Page 30: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/30.jpg)
30
ArchitectureMonitoring of the Web-Server Cluster
![Page 31: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/31.jpg)
31
Monitoring of the Web-Server Cluster
![Page 32: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/32.jpg)
32
Monitoring of the Web-Server Cluster
![Page 33: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/33.jpg)
33
AlarmsMonitoring of the Web-Server Cluster
![Page 34: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/34.jpg)
34
AWS Free limits
![Page 35: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/35.jpg)
▸ Reactive Scaling, users manually thresholds to the CPU usage in order to trigger new EC2 instances.
▸ Proactive Scaling, users manually schedule when new instances will be triggered.▸ Predictive Scaling, new instances will be trigger automatically when needed, based on
machine learning to predict the CPU usage of the instances.
35
AWS auto-scaling in EC2
![Page 36: Clusterof Web-Servers withAWS · Agenda AWS Create EC2 (Elastic Compute Cloud) Create EBS (Elastic Block Storage) Cloning the EC2 & EBS Install and Configure NGINX Set up Let’s](https://reader030.fdocuments.in/reader030/viewer/2022041011/5ebbfcbeecf22e535e350245/html5/thumbnails/36.jpg)
36
Thanks!