未加星标

Getting Started with Application Load Balancer

字体大小 | |
[开发(php) 所属分类 开发(php) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

An Application Load Balancer is a load balancing option for the Elastic Load Balancing service that operates at the application layer and allows you to define routing rules based on content across multiple services or containers running on one or more Amazon Elastic Compute Cloud (Amazon EC2) instances.

Follow the below simple steps for setting up an application load balancer. This blog post also shows how you can switch from a classic load balancer to an application load balancer.

Applications

We have two servers already setup with wordpress and drupal applications, respectively.

Wordpress Application on one server
Getting Started with Application Load Balancer
Drupal Application on another server
Getting Started with Application Load Balancer
Target Groups

Create Target Groups for each of the application.

Drupal Target Group:

Click on create target group.


Getting Started with Application Load Balancer

Give name to the group. Select VPC and Configure the health checks.


Getting Started with Application Load Balancer
Wordpress Target Group:

Similarly, create a target group for the wordpress application. Give a name. Select vpc and configure health checks.


Getting Started with Application Load Balancer

Now, we have two targets groups for drupal and wordpress applications, respectively.


Getting Started with Application Load Balancer

Register targets for each of the group.

Drupal

Go to Targets tab. Click Edit.


Getting Started with Application Load Balancer

Select the instance with drupal application running on it. Click Add to registered.


Getting Started with Application Load Balancer

The instance will show under the Registered Instances.


Getting Started with Application Load Balancer
Wordpress:

Similarly, for the wordpress target group, register the instance with wordpress aplication running on it.

Go to Targets tab. Click Edit.


Getting Started with Application Load Balancer

Select the wordpress server. Click Add to registered.


Getting Started with Application Load Balancer

Save. The instance will get added to the Registered Instances.


Getting Started with Application Load Balancer
Application Load Balancer

Create Load Balancer.


Getting Started with Application Load Balancer

Select Application Load Balancer.


Getting Started with Application Load Balancer

Configure the load balacer. Give a name. Choose subnets in each zone.


Getting Started with Application Load Balancer
Getting Started with Application Load Balancer

Select an existing one or create a new security group for the load balancer.


Getting Started with Application Load Balancer

Configure Routing. Create new or select an already existing target groups for the default route.


Getting Started with Application Load Balancer
Getting Started with Application Load Balancer

We have selected drupal target group.


Getting Started with Application Load Balancer

Since we have already registered the instance to the target group, the instance will automatically appear in Register Targets in the next screen.


Getting Started with Application Load Balancer

Click Next and Reviews the configurations.


Getting Started with Application Load Balancer

Create.

The Application Load Balancer will get started to provision.


Getting Started with Application Load Balancer

The State will get changed from provisioning to active once it becomes available.


Getting Started with Application Load Balancer

Now, add a rule to the listener so that whenever a path pattern for a rule is matched, ALB will route the traffic to the corresponding target group.

Go to Listeners tab, Click Add rule.


Getting Started with Application Load Balancer

Specify path pattern and select the target group.


Getting Started with Application Load Balancer

Similarly, create a rule set for wordpress.


Getting Started with Application Load Balancer

Now, Hit the ALB’s DNS name with the path pattern /drupal. The Application will load.


Getting Started with Application Load Balancer

Also, hit the ALB’s DNS name with path pattern /wordpress. The Application will load.


Getting Started with Application Load Balancer
Enable SSL

Let's enable SSL to our applications. Here, we are using ACM for the SSL certificates.

Add Listener.


Getting Started with Application Load Balancer

Add rule.


Getting Started with Application Load Balancer

Specify path patterns for both the applications.


Getting Started with Application Load Balancer
Switching Classic Load Balancer

If you want to migrate the classic load balancer to application load balancer, refer this link: https://github.com/aws/elastic-load-balancing-tools .

So, we have one classic load balancer as shown below:


Getting Started with Application Load Balancer

The elastic-load-balancing-tool will copy the configuration of this classic load balancer to create a new application load balancer with same configurations. The command to create the application load balancer is:

python copy_classic_load_balancer.py --name classic-load-balancer-name --region region-name
Getting Started with Application Load Balancer

So a new application load balancer will be ready with same configurations as of classic load balancer.


Getting Started with Application Load Balancer
Getting Started with Application Load Balancer

To register instances, use the command:

copy_classic_load_balancer.py --name my-load-balancer - region region-name --register-targets

and That's it..!! Happy Load Balancing across Applications..!! :)

本文开发(php)相关术语:php代码审计工具 php开发工程师 移动开发者大会 移动互联网开发 web开发工程师 软件开发流程 软件开发工程师

主题: Word
分页:12
转载请注明
本文标题:Getting Started with Application Load Balancer
本站链接:http://www.codesec.net/view/482844.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(php) | 评论(0) | 阅读(28)