azure 使用_Cloud Power:如何使用Traffic Manager在全球范围内扩展Azure网站

news/2024/5/14 18:29:01/文章来源:https://blog.csdn.net/cunfuxiao7305/article/details/109053514
azure 使用

azure 使用

The "cloud" is one of those things that I totally get and totally intellectualize, but it still consistently blows me away. And I work on a cloud, too, which is a little ironic that I should be impressed.

“云”是我完全了解并完全智能化的事物之一,但仍然让我震惊。 而且我也在云上工作,这有点讽刺,应该给我留下深刻的印象。

I guess part of it is historical context. Today's engineers get mad if a deployment takes 10 minutes or if a scale-out operation has them waiting five. I used to have multi-hour builds and a scale out operation involved a drive over to PC Micro Center. Worse yet, having a Cisco engineer fly in to configure a load balancer. Certainly engineers in the generation before mine could lose hours with a single punch card mistake.

我想其中一部分是历史背景。 如果部署需要10分钟或横向扩展操作使他们等待5分钟,那么今天的工程师就会发疯。 我曾经进行过多个小时的构建,并且横向扩展操作涉及将驱动器移至PC Micro Center。 更糟糕的是,让思科工程师介入以配置负载均衡器。 当然,我的那一代工程师可能会因为一次打Kong卡错误而浪费数小时。

这就是给我留下深刻印象的力量。 (It's the power that impresses me.)

And I don't mean CPU power, I mean the power to build, to create, to achieve, in minutes, globally. My that's a lot of comma faults.

我的意思不是说CPU能力,而是指在几分钟内在全球范围内构建,创建和实现的能力。 我的那是很多逗号错误。

Someone told me once that the average middle class person is more powerful than a 15th century king. You eat on a regular basis, can fly across the country in a few hours, you have antibiotics and probably won't die from a scratch.

曾经有人告诉我,普通的中产阶级人比15世纪的国王更有力量。 您定期进食,可以在几个小时内飞遍全国,您拥有抗生素,并且可能不会从零开始死亡。

Cloud power is that. Here's what I did last weekend that blew me away.

云的力量就是这样。 这是我上周末做的让我震惊的事情。

I just took a website, bought a wildcard SSL cert, deployed to Asia, Europe, and US, and geo-load-balanced the secure traffic in 45 min. O_O

— Scott Hanselman (@shanselman)

我刚浏览了一个网站,购买了通配符SSL证书,并部署到了亚洲,欧洲和美国,并在45分钟内实现了安全流量的地理负载均衡。 O_O

— Scott Hanselman(@shanselman) May 3, 20142014年5月3日

Here's how I did it.

这是我的方法。

在几分钟内在全球范围内扩展Azure网站,并添加SSL (Scaling an Azure Website globally in minutes, plus adding SSL)

I'm working on a little startup with my friend Greg, and I recently deploy our backend service to a small Azure website in "North Central US." I bought a domain name for $8 and setup a CNAME to point to this new Azure website. Setting up custom DNS takes just minutes of course.

我正在与朋友Greg一起开办一家小型创业公司,最近我将后端服务部署到“美国中北部”的一个小型Azure网站。 我以$ 8的价格购买了一个域名,并设置了一个CNAME指向这个新的Azure网站。 设置自定义DNS只需几分钟。

CNAME Hub DNS

将SSL添加到Azure网站 (Adding SSL to Azure Websites)

I want to run my service traffic over SSL, so I headed over to DNSimple where I host my DNS and bought a wildcard SSL for *.mydomain.com for only $100!

我想通过SSL运行我的服务流量,因此我前往DNSimple托管我的DNS,并以100美元的价格为* .mydomain.com购买了通配符SSL !

Active SSL Certs

Adding the SSL certificate to Azure is easy, you upload it from the Configure tab on Azure Websites, then binding it to your site.

将SSL证书添加到Azure很容易,您可以从Azure网站上的“配置”选项卡上载SSL证书,然后将其绑定到您的站点。

SSL Bindings

Most SSL certificates are issued as a *.crt file, but Azure and IIS prefer *.pfx. I just downloaded OpenSSL for Windows and ran:

大多数SSL证书以* .crt文件发布,但是Azure和IIS更喜欢* .pfx。 我刚刚下载了Windows的OpenSSL并运行:

openssl pkcs12 -export -out mysslcert.pfx -inkey myprivate.key -in myoriginalcert.crt

Then I upload mysslcert.pfx to Azure. If you have intermediaries then you might need to include those as well.

然后,将mysslcert.pfx上传到Azure。 如果您有中介,那么您可能还需要包括这些中介。

This gets me a secure connection to my single webserver, but I need multiple ones as my beta testers in Asia and Europe have complained that my service is slow for them.

这使我可以安全地连接到单个Web服务器,但是我需要多个Web服务器,因为我在亚洲和欧洲的Beta测试人员抱怨我的服务对他们而言很慢。

添加多个全球Azure网站位置 (Adding multiple global Azure Website locations)

It's easy to add more websites, so I made two more, spreading them out a bit.

添加更多网站很容易,所以我又创建了两个网站,将它们扩展了一些。

Multiple locations

I use Git deployment for my websites, so I added two extra named remotes in Git. That way I can deploy like this:

我将Git部署用于我的网站,因此在Git中添加了两个额外的命名远程对象。 这样,我可以像这样部署:

>git push azure-NorthCentral master
>git push azure-SoutheastAsia master
>git push azure-WestEurope master

At this point, I've got three web sites in three locations but they aren't associated together in any way.

至此,我在三个位置拥有三个网站,但它们没有以任何方式关联在一起。

I also added a "Location" configuration name/value pair for each website so I could put the location at the bottom of the site to confirm when global load balancing is working just by pulling it out like this:

我还为每个网站添加了一个“位置”配置名称/值对,因此我可以将位置放在网站的底部以确认全局负载平衡何时起作用,只需将其拉出,如下所示:

location = ConfigurationManager.AppSettings["Location"];

I could also potentially glean my location by exploring the Environment variables like WEBSITE_SITE_NAME for my application name, which I made match my site's location.

我还可以通过浏览环境变量(例如WEBSITE_SITE_NAME)作为我的应用程序名称来潜在地收集我的位置,该变量与我的站点位置相匹配。

Now I bring these all together by setting up a Traffic Manager in Azure.

现在,我通过在Azure中设置流量管理器来将所有这些整合在一起。

Traffic Manager

I change my DNS CNAME to point to the Traffic Manager, NOT the original website. Then I make sure the traffic manager knows about each of the Azure Website endpoints.

我将DNS CNAME更改为指向流量管理器,而不是原始网站。 然后,确保流量管理器了解每个Azure网站终结点。

Then I make sure that my main CNAME is setup in my Azure Website, along with the Traffic Manager domain. Here's my DNSimple record:

然后,请确保在我的Azure网站中设置了我的主要CNAME,以及Traffic Manager域。 这是我的DNSimple记录:

image

And here's my Azure website configuration:

这是我的Azure网站配置:

Azure Website Configuration

Important Note: You may be thinking, hang on, I though there was already load balancing built in to Azure Websites? It's important to remember that there's the load balancing that selects which data center, and there's the load balancing that selects an actual web server within a data center.  Also, you can choose between straight round-robin, failover (sites between datacenters), or Performance, when you have sites in geographic locations and you want the "closest" one to the user. That's what I chose. It's all automatic, which is nice.

重要说明:您可能会想,等等,尽管Azure网站已经内置了负载平衡功能? 重要的是要记住,有一个负载平衡选择了哪个数据中心,有一个负载平衡选择了一个数据中心内的实际Web服务器。 另外,如果您在地理位置上有站点并且希望用户找到“最近”站点,则可以在直接循环,故障转移(数据中心之间的站点)或性能之间进行选择。 那就是我选择的。 都是自动的,很好。

Since the Traffic Manager is just going to resolve to a specific endpoint and all my endpoints already have a wildcard SSL, it all literally just works.

由于流量管理器只是要解析到特定的端点,并且我所有的端点都已经具有通配符SSL,因此从字面上看,所有这些都可以正常使用。

When I run NSLOOKUP myHub I get something like this:

当我运行NSLOOKUP myHub时,我得到如下信息:

>nslookup hub.mystartup.com
Server: ROUTER
Address: 10.71.1.1

Non-authoritative answer:
Name: ssl.mystartup-northcentralus.azurewebsites.net
Address: 23.96.211.345
Aliases: hub.mystartup.com
mystartup.trafficmanager.net
mystartup-northcentralus.azurewebsites.net

As I'm in Oregon, I get the closest data center. I asked friends via Skype in Australia, Germany, and Ireland to test and they each got one of the other data centers.

当我在俄勒冈州时,我得到了最近的数据中心。 我通过澳大利亚,德国和爱尔兰的Skype要求朋友进行测试,他们每个人都得到了另一个数据中心之一。

I can test for myself by using https://www.whatsmydns.net and seeing the different IPs from different locations.

我可以通过使用https://www.whatsmydns.net并查看来自不同位置的不同IP进行自我测试。

Global DNS

This whole operation took about 45 minutes, and about 15 minutes of that was waiting for DNS to propagate.

整个操作大约花费了45分钟,其中大约15分钟正在等待DNS传播。

In less than an hour went from a small prototype in a data center in Chicago and then scaled it out to datacenters globally and added SSL.

在不到一个小时的时间内,便从芝加哥数据中心的一个小型原型机开始,然后将其扩展到全球的数据中心并添加了SSL。

Magical power.

神奇的力量。

相关链接 (Related Links)

  • Azure Friday - http://friday.azure.com and also on iTunes!

    Azure Friday- http://friday.azure.com以及iTunes上!

  • Setting up Traffic Manager

    设置流量管理器

  • Setting up Custom DNS Records to point to Azure Web Sites - with Stefan Schackow

    使用Stefan Schackow设置自定义DNS记录以指向Azure网站

  • Moving a website to Azure while adding Continuous Deployment from Git

    将网站移至Azure,同时从Git添加持续部署

  • Deploying TWO websites to Windows Azure from one Git Repository

    从一个Git存储库将两个网站部署到Windows Azure

翻译自: https://www.hanselman.com/blog/cloud-power-how-to-scale-azure-websites-globally-with-traffic-manager

azure 使用

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_815416.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何做个拥有优质内容被用户和搜索引擎认网站

说到做一个优质的被用户和搜索引擎认可的网站的时候我们首先要想到的就是网站内部软文,因为一个网站内部占比重最大的就是软文,网站内部软文的好坏直接会影响到整个网站质量的好坏,如果一个网站的质量很差,首先用户就不会认可&…

网站攻击方法及防御

2019独角兽企业重金招聘Python工程师标准>>> 现在做网站的站长都有一个心里,网站受攻击是在所难免的事,特别是一些比较热门的行业以及一些比较小的企业,更是被这些攻击整得焦头烂额。那么如果我们要解决攻击的问题,我们…

azure怎么安装依赖软件_Azure Application Insights警告我网站上的依赖请求失败

azure怎么安装依赖软件Ive been loving Application Insights ever since I hooked it up to my Podcast Site. Application Insights is stupid cheap and provides an unreal number of insights into whats going on in your site. I hooked it up and now I have a nice da…

使用Chrome的Lighthouse Auditor优化ASP.NET Core网站

Im continuing to update my podcast site. Ive upgraded it from ASP.NET "Web Pages" (10 year old code written in WebMatrix) to ASP.NET Core 2.1 developed with VS Code. Heres some recent posts: 我正在继续更新我的播客网站。 我已经将其从ASP.NET“网页”…

根据环境为ASP.NET Core网站动态生成robots.txt

Im putting part of older WebForms portions of my site that still run on bare metal to ASP.NET Core and Azure App Services, and while Im doing that I realized that I want to make sure my staging sites dont get indexed by Google/Bing. 我将仍旧在裸机上运行的网…

SEO的艺术(原书第2版)

《SEO的艺术(原书第2版)》基本信息原书名:The Art of SEO, Second Edition作者: Eric Enge Stephan Spencer Jessie Stricchiola Rand Fishkin译者: 姚军丛书名: O’Reilly精品图书系列出版社:机械工业出版社ISBN&…

HTML+CSS网站开发兵书

《HTMLCSS网站开发兵书》基本信息作者: 高洪涛丛书名: 程序员藏经阁出版社:电子工业出版社ISBN:9787121212369上架时间:2013-8-26出版日期:2013 年9月开本:16开页码:516版次&#xf…

浅谈大型网站动态应用系统架构(转)

动态应用,是相对于网站静态内容而言,是指以c/c、php、Java、perl、.net等服务器端语言开发的网络应用软件,比如论坛、网络相册、交友、BLOG等常见应用。动态应用系统通常与数据库系统、缓存系统、分布式存储系统等密不可分。 大型动态应用系统…

2012年5月美国旅游网站排名

2019独角兽企业重金招聘Python工程师标准>>> 2012年5月排名:Expedia居于旅游中介网站首位,TripAdvisor居于目的地及住宿网站首位,Southwest Airlines居于航空公司网站首位。 旅游中介 排名 网站名称 域名 访问率 1 Expedia …

7条大型网站设计和维护的关键技巧

Collis Taeed曾写过一篇博文《7 Crucial Tips for Designing and Maintaining a Large Site 》,为我们分享了大型网站设计及维护的关键技巧,alswl已将此文译成中文,现转载于此,以便大家学习。全文如下: 项目范围和规模…

60多个超炫的视差滚动效果网站设计欣赏

2019独角兽企业重金招聘Python工程师标准>>> 今天见到ebay新版网站的介绍页面,感觉很酷,Jeanne提到这是视差滚动效果,于是想起来之前见到的一些,这种通过鼠标滚动来展现页面元素的做法越来越常见了,于是整理…

asp.net 获取网站根目录

网站在服务器磁盘上的物理路径: HttpRuntime.AppDomainAppPath虚拟程序路径: HttpRuntime.AppDomainAppVirtualPath 任何于Request/HttpContext.Current等相关的方法, 都只能在有请求上下文或者页面时使用. 即在无请求上下文时,HttpContext.Current为null. 而上面提到的方法一直…

分享40款效果非常漂亮的 HTML5 CSS3 网站模板,模板免费下载

HTML5 作为下一代网页语言,加入中众多更具语义的标签,例如video、audio、section、article、header 和 nav 等。而 CSS3 作为 CSS 的下一代版本,同样引入了很多很酷的属性,以前很多需要 JavaScript 才能实现的复杂效果&#xff0c…

小网站到大网站的发展历程

为什么80%的码农都做不了架构师?>>> 开始都在一台服务器上,应用服务器,数据库服务器,文件服务器,访问量大了,内存不够用了,把数据库服务器踢出去,有钱的话可以分成3台&a…

秒杀全网!研发、运营必备实用工具网站

目录 1、搜索引擎 2、PPT 3、图片操作 4、文件共享 5、招聘求职 6、程序员面试题库 7、办公、开发软件 8、高清图片、视频素材网站 9、项目开源 10、算法 11、在线工具宝典大全 12、音乐 13、神辅助工具 14、语音处理 15、大数据 16、电子书 程序员开发需要具备良好的信息检索…

java开发web网站的路由设计_理解Web路由(浅谈前后端路由与前后端渲染)

1.什么是路由?在Web开发过程中,经常会遇到『路由』的概念。那么,到底什么是路由?简单来说,路由就是URL到函数的映射。路由的概念最开始是由后端提出来的,在以前用模板引擎开发页面的时候,是使用路由返回不…

[Erlang24]使用zotonic搭建网站记录

zotonic的搭建网站(blog)记录: zotonic:用Erlang做的一个web 框架:和wordpress 类似,但是官网称比PHP CMS要快10倍以上先看看我的成果:正弦波 localhost:本地回环地址 443:安全服务端口,好记&am…

网站定位之---根据IP获得区域

记得以前做一个培训机构网站时候需要定位,那时候用的搜狐的api,不是很精准。 demo:https://github.com/dunitian/LoTCodeBase/tree/master/NetCode/3.常用技能/06.Position/01.IPToPosition 后来做电商的时候用的新浪的api,感觉还行&#xff…

在阿里云centOS环境下搭建基于thinkphp的网站

Step1:购买服务器以及配置选择 作为学生党的优惠,30块3个月的服务器使用时间(为了成为未来的拍黄片导演怎么口以不舍得花钱) 云服务器ECS 学生特惠 基本按照一开始给你的配置就好了,除了公共镜像那里选择,看个人需求吧…

大型网站架构系列:负载均衡详解(1)

面对大量用户访问、高并发请求,海量数据,可以使用高性能的服务器、大型数据库,存储设备,高性能Web服务器,采用高效率的编程语言比如(Go,Scala)等,当单机容量达到极限时,我们需要考虑业务拆分和分…