Azure Application Gateway(二)对后端 VM 进行负载均衡
一,引言
上一节有讲到使用 Azure Application Gateway 为我们后端类型为 Web App 的 Demo 项目提供负载均衡,Azure Application Gateway 的后端池的目标类型可以是多中类型,如下图所示:

目标类型分别是:
1,IP address or FQDN
2,Virtual Machine
3,VMSS
4,App Services
这个我也不用多说了,今天我们将基础设施架构图中的App Services 换成 VM,重新添加Azure Application Gateway的后端池的目标类型
--------------------我是分割线--------------------

--------------------我是分割线--------------------
Azure Web App 和Azure VM 部署系列:
1,Azure Web App(一)发布你的Net Core Web 项目
2,Azure Web App(二)使用部署槽切换部署环境代码
3,Azure Web App(三)切换你的Net Core Web 项目的数据库连接字符串
4,Azure Traffic Manager(一) 为我们的Web项目提供负载均衡
5,Azure Traffic Manager(二) 基于权重与基于优先级的路由策略为我们的Web项目提供负载均衡
6,Azure Load Balance(一) 为我们的Web项目提供负载均衡
7,Azure Load Balancer(二) 基于内部的负载均衡来转发访问请求
8,Azure Application Gateway(一)对后端 Web App 进行负载均衡
9,Azure Application Gateway(二)对后端 VM 进行负载均衡
二,正文
1,创建应用程序网关,添加目标类型为VM的实例到后端池
Azure Portal 中点击 “Create a Resource”,搜索框中输入 “Application Gateway”,进行搜索/
Resource group 选择:“Web_Test_AG_RG”
Application gateway name:“cnbateblogweb_applicationgateway_vm”
Region 选择:East Asia
其他都是默认
Virtual network 点击创建一个新的

创建一个新的 Virtual network
Name :cnbateblogweb_NET,删除默认的 default 的子网,添加一个新的子网
Subnet name:cnbateblogwen_SubNET
Address range:10.0.1.0/24
点击 “ok”

点击 “Next:Frontends” 进而设置应用程序网关的前端 ip

接下来,关于应用程序网关的前端 ip
Frontend IP address type 选择:Public
Public IP address 选择创建一个新的Public IP
点击 “Next:Backends” 进行下一步设置应用程序网关的后端池

点击 “Add a Backend pool” 需要添加后端池

Name:“cnbateblogweb_applicationgateway_vm_backendpool”
Add backend pool without target 选择:“Yes”
点击 “Add”

点击 “Next:Configuration>” 配置路由信息

点击 "Add a routing rule" 添加路由信息

Rule name:“vm_rule”
Listener name:vm_http_listener
Frontend IP 选择刚创建好的 Frontends “Public IP”
然后点击 “Backend targets” 添加后端目标的路由规则 
Target type 选择 “Backend pool”
Backend target 选择 创建好的后端池 “cbbateblogweb_applicationgateway_vm_backendpool”
HTTP setting 点击 “Add new” 创建一个新的 HTTP Setting

Http settings name:“vm_http_setting”
Backend protocol 选择:"HTTP"
Backend port:“80”
点击 “Add” 跳转到 后端池路由设置页面

点击 “Add”,添加路由信息

然后我们点击 “Next:Tags >”,“Next:Review + create >” 进行创建预校验,等待校验完成后,我们点击 “Create” 进行创建 Azure Application Gateway
选择 “Settings=> Backend pools” 选择 之前创建好的 “cnbateblogweb_applicationway_vm_backendpool” 后端池,我们需要将之前创建好的两台 vm 添加进去(之前在讲Azure Load Balancer 时创建的cnbateblogweb01 和 cnbateblogweb02)

Target type 选择:"Virtual machine"
Target 选择之前创建好的vm
点击 “Save” 进行保存

接下来,我们需要设置健康检查,选择 “Settings=>Health probes”,点击 “Add” 按钮

Name:“cnbateblogweb_vm001_healthcheck”
Protocol 选择:“HTTP”
Host :选择 cnbateblogweb01 这台 vm 的 Public IP
Path:“/”(当前IP的根目录)
nterval(间隔时间) 从30 秒 我们改为 2 秒
Timeout(超时时间)从30 秒 我们改为 5 秒
Unhealthy threashod(不正常阈值) 从 3 次 我们改为1次
点击 “Add”,进行添加操作

我们使用同样的配置再次配置对cnbateblogweb02的检查检查,点击 “Add”

选择选择菜单的 “Monitoring=》Backend health” 我们可以查看一下后端池运行状态

最后,我们在浏览器中进行访问测试一下,如下图所示


ok,成功,撒花
三,结尾
今天我们简单演示了一下我们将架构图中的 Web App 替换成 VM ,通过创建Application Gateway,添加后端池,包含两台 vm,对后端 vm上挂载的项目网站进行负载均衡,在此示例中,我们创建了一个新的Azure Application gateway,并且创建空的后端池,然后将后端目标(两台之前创建好的vm)添加到后端池。
作者:Allen
版权:转载请在文章明显位置注明作者及出处。如发现错误,欢迎批评指正。
Azure Application Gateway(二)对后端 VM 进行负载均衡的更多相关文章
- Azure Front Door(二)对后端 VM 进行负载均衡
一,引言 上一篇我们讲到通过 Azure Front Door 为我们的 Azure App Service 提供流量转发,而整个 Azure Front Door 在添加后端池的时候可选的后端类型是 ...
- Azure Application Gateway(一)对后端 Web App 进行负载均衡
一,引言 今天,我们学习一个新的知识点-----Azure Application Gateway,通过Azure 应用程序网关为我么后端的服务提供负载均衡的功能.我们再文章头中大概先了解一下什么是应 ...
- Azure Application Gateway (5) Application Gateway SSL Offload配置
<Windows Azure Platform 系列文章目录> 之前有个客户提出了一个需求,他们的互联网访问的架构分为两种: 1.第一层是使用Azure Application Gatew ...
- Azure Application Gateway (3) 设置URL路由
<Windows Azure Platform 系列文章目录> 在之前的文章中,笔者介绍了Azure Web App可以设置URL路由.如下图: 在这里笔者简单介绍一下,首先我们还是创建以 ...
- Azure Application Gateway (1) 入门
<Windows Azure Platform 系列文章目录> 请读者注意,Azure Application Gateway在ASM模式下,只能通过PowerShell创建 具体可以参考 ...
- Azure Application Gateway (4) 设置URL路由 - PowerShell
<Windows Azure Platform 系列文章目录> 本文将介绍如果使用Azure PowerShell,创建Azure Application Gateway URL Rout ...
- Azure Load Balancer(二) 基于内部的负载均衡来转发为访问请求
一,引言 上一节,我们使用 Azure Load Balancer 类型为外部的,来转发我们的 Web 服务.今天我们看看另一种类型为 “Internal” 的 Azure Load Balancer ...
- Ocelot(二)- 请求聚合与负载均衡
Ocelot(二)- 请求聚合与负载均衡 作者:markjiang7m2 原文地址:https://www.cnblogs.com/markjiang7m2/p/10865511.html 源码地址: ...
- Azure Application Gateway (2) 面向公网的Application Gateway
<Windows Azure Platform 系列文章目录> 本章将介绍如何创建面向公网的Application Gateway,我们需要准备以下工作: 1.创建新的Azure Reso ...
随机推荐
- Git的自定义和特殊文件配置
目录 备注: 知识点 自定义Git 忽略特殊文件 .gitignore忽略文件 忽略文件的原则是: 忽略文件示例 .gitignore文件查看和强制添加 备注: 本文参考于廖雪峰老师的博客Git教程. ...
- 基于Vue的UI框架element el-table表格的自定义排序
html部分: <el-table-column prop="phoneCache" label="手机缓存包编号" align="center ...
- python爬虫入门(1)----- requests
介绍 requests是python实现的简单易用的HTTP库,使用起来比urllib简洁很多 基本使用 requests.get("http://www.baidu.com") ...
- .net core 拦截socket
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net ...
- Spring bean初始化
- web自动化 -- 切换 iframe
先看源码 switch_to_frame() frame() 具体用法
- phpMyAdmin历史漏洞复现
简介 phpMyAdmin是一个非常受欢迎的基于web的MySQL数据库管理工具.它能够创建和删除数据库,创建/删除/修改表格,删除/编辑/新增字段,执行SQL脚本等 复现三个古老漏洞 phpMyAd ...
- Python学习手册(第4版)PDF高清完整版免费下载|百度云盘
Python学习手册(第4版)PDF高清完整版免费下载|百度云盘 提取码:z6il 内容简介 Google和YouTube由于Python的高可适应性.易于维护以及适合于快速开发而采用它.如果你想要编 ...
- Apache常用配置详解
Apache配置文件:conf/httpd.conf.(注意:表示路径时使用‘/’而不使用‘\’,注释使用‘#’) 1. ServerRoot:服务器根目录,也就是Apache的安装目录,其他的目录配 ...
- Raid0,1,5,10,50
raid0 就是把多个硬盘合并成1个逻辑盘使用,数据读写时对各硬盘同时操作,不同硬盘写入不同数据,速度快. **最少需要2块硬盘 raid1 同时对2个硬盘读写(同样的数据).强调数据的安全性.损坏一 ...