Note: This blog is for you to make your life easier.
Don't make your life complicated, just enjoy the blog. ^_^
Please pardon my simplicity of my own blog and look for the content.
To make it more easier for you just click one photos, follow then scroll. ⏩
Enjoy reading! ^_^
Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve fault tolerance in your applications by seamlessly providing the required amount of load balancing capacity needed to route application traffic.
Auto Scaling helps you maintain application availability and allows you to scale your Amazon EC2 capacity out or in automatically according to conditions you define. You can use Auto Scaling to help ensure that you are running your desired number of Amazon EC2 instances. Auto Scaling can also automatically increase the number of Amazon EC2 instances during demand spikes to maintain performance and decrease capacity during lulls to reduce costs. Auto Scaling is well suited to applications that have stable demand patterns or that experience hourly, daily, or weekly variability in usage.
First, Access your AWS Management Console.
Task 1: Create an AMI for Auto Scaling
In this task, you will create an AMI from the existing Web Server 1. This will save the contents of the boot disk so that new instances can be launched with identical content.
From Instances wait for the Status Checks for Web Server 1 then configure by clicking the Image & Create Image.
Task 2: Create a Load Balancer
In this task, you will create a load balancer that can balance traffic across multiple EC2 instances and Availability Zones.
From the Load Balancer, Create Load Balancer then configure the following:
- Name:
LabELB - VPC: Lab VPC (In the Availability Zones section)
- Availability Zones: Select both to see the available subnets.
- Select Public Subnet 1 and Public Subnet 2
This configures the load balancer to operate across multiple Availability Zones.
From Configure Routing name it as "LabGroup" then Create.
Task 3: Create a Launch Configuration and an Auto Scaling Group
In this task, you will create a launch configuration for your Auto Scaling group. A launch configuration is a template that an Auto Scaling group uses to launch EC2 instances. When you create a launch configuration, you specify information for the instances such as the AMI, the instance type, a key pair, security group and disks.
From the left navigation Panel of AWS you will find the Launch Configurations and click the "Create launch configuration" and proceed. When you reach the configuration settings name it as:
- Name:
LabConfig - Monitoring: Select Enable CloudWatch detailed monitoring
This allows Auto Scaling to react quickly to changing utilization.
And,
- Click Select an existing security group
- Select Web Security Group
- Click Review
Then "create launch configuration."
After creating launch configuration, configure the following settings:
Group name: Lab Auto Scaling Group and group size of 2. Choose Lab VPC from Network and Ignore the message regarding "No public IP address."
Note: Review the details of your Auto Scaling group, then click Create Auto Scaling group. If you encounter an error Failed to create Auto Scaling group, then click Retry Failed Tasks.
Task 4: Verify that Load Balancing is Working
In this task, you will verify that Load Balancing is working correctly.
Proceed with the Lab Instance then from the Target Groups check the status of both instances and the transitions to Health state.
Copy the DNS name of the load balancer, making sure to omit "(A Record)".
It should look similar to: LabELB-1998580470.us-west-2.elb.amazonaws.com
Then open a new web browser tab then paste the DNS Name you just copied.
Task 5: Test Auto Scaling
You created an Auto Scaling group with a minimum of two instances and a maximum of six instances. Currently two instances are running because the minimum size is two and the group is currently not under any load. You will now increase the load to cause Auto Scaling to add additional instances.
From the left navigation pane click Alarms then configure the following:
- On the Services menu, click EC2.
- In the left navigation pane, click Auto Scaling Groups and then click on Scaling Policies.
- Click Actions⌄ and Edit.
- Change the Target Value to
50. - Click Save.
- On the Services menu, click CloudWatch.
- In the left navigation pane, click Alarms (not ALARM) and verify you see two alarms.
Two alarms will be displayed. These were created automatically by the Auto Scaling group. They will automatically keep the average CPU load close to 60% while also staying within the limitation of having two to six instances.
Beside the AWS logo you can see the Load Test. This will cause the application to generate high loads. The browser page will automatically refresh so that all instances in the Auto Scaling group will generate load. Do not close this tab.
From CloudWatch console, the AlarmLow alarm should change to OK and the AlarmHigh alarm status should change to ALARM.
Task 6: Terminate Web Server 1
In this task, you will terminate Web Server 1. This instance was used to create the AMI used by your Auto Scaling group, but it is no longer needed.
Problems Encountered:
NONE.
Lesson Learned:
Registering your Auto Scaling group with an Elastic Load Balancing load balancer helps you set up a load-balanced application. Elastic Load Balancing works with Amazon EC2 Auto Scaling to load balance incoming traffic across your healthy Amazon EC2 instances. This increases the scalability and availability of your application. You can enable Elastic Load Balancing within a single Availability Zone or multiple Availability Zones to increase the fault tolerance of your applications.
References:
AWS Website.
Thanks for visiting my blog.
Email me at: aileen-pacia@live.nmit.ac.nz
“I can do all things through Christ who strengthens me.”
Philippians 4:13













No comments:
Post a Comment