36
Cluster of Web-Servers with AWS Cloud Computing November, 2018 Mauricio Altamirano Silva Julia Johnson Sefer Ul

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

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

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

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

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

▸ 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

▸ 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

36

Thanks!