-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathloadbalancer
97 lines (84 loc) · 2.82 KB
/
loadbalancer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
=> Round robin method
123456*8910
<html>
<head></head>
<body style="background-color:red">
<h1>Linux Machine</h1>
</body>
</html>
<html>
<head></head>
<body style="background-color:teal">
<h1>Window Machine</h1>
</body>
</html>
=> Must have min 2 Ec2 instance
=> Make index.html up & running
=> Ec2 console
=> Load balancer
=> Create load balancer
=> Select classic load balancer
=> Provide LB name and select VPC
=> Enable advanced VPC configuration === Checked
=> Please select at least two Subnets in different Availability
Zones to provide higher availability for your load balancer.
=> Select your subnet
Loadbalancerport Load Balancer Port Instance Protocol Instance Port
Http 80 Http 80
=> Configure health Check
Ping Protocol == Http
Ping Port === 80
Ping Path == index.html
Response Timeout === 5 seconds
Interval ====30 seconds
Unhealthy threshold == 2
Healthy threshold ==10
=> Add Ec2 instance
=> Add Tag
=>Review & launch
> add inbound rule as http 80
/**************************
Auto scale
**************************/
Scale in and scale out
=> Launch Configure = Instance Type, AMI, SG, Storage
=> Scaling Policy = Scale In and scale out
connect ec2=>
bash
=> stress
=> remove stress
prequest
==> You must have one AMI
=>Step
=> create auto scale group
=> Select AMI
=>Configuration Detail
name
myautoscale
=>Advanced Details
=>User data
Add bootstrap
"#!/bin/bash
sudo yum install stress -y
"
=>Create Launch Configuration
Add http
=>Create Auto Scaling Group
=>Groupname
=>Number of instance =1
=> Select alteast 3 subnet
=>check Load Balancing
=>Add loadBlacancer
=>Use scaling policies to adjust the capacity of this group
=>Scale the Auto Scaling group using step or simple scaling policies
=>Add Alarm (for both scaleup and scale down)
=>whenever=>CPu
=>is lessthan or greater = provide %
=>Add Tags
/**************************
Strees Testing ******HW
**************************/
=> Connect with launched Ec2
=>Open terminal
=>type "stress"
=>type "remove stress"