首页 \ 问答 \ 配置Azure负载平衡器和NAT规则(Configuring Azure load balancer and NAT rules)

配置Azure负载平衡器和NAT规则(Configuring Azure load balancer and NAT rules)

我正在尝试在Azure中的CentOS 7.2上构建一个简单的双层wordpress环境。

我已经定义了一个虚拟网络,通过IPsec VPN将它连接到我的家庭实验室,我在Azure中定义了几个子网(使用网络安全组进行Web层,SQL层和实用程序层角色隔离)。

我有两个Web层虚拟机,它们都是同一可用性集的成员,并且都在Web层子网上。 他们有互联网接入(出站),我可以通过我的家庭实验室与他们联系,对我来说似乎很好 - httpd正在收听80 / tcp,我可以通过访问来自家庭实验室网络的网页每个Web服务器直接在其192.168.x地址上。

我应该提到我的网络服务器没有分配公共IP,但我不能看到这是一个问题..它们的目的是在负载均衡器后面。

所以,我创建了一个Load Balancer,并且:

  • 为LB分配了公共IP
  • 添加了一个后端池(选择了我的可用性集,并选择了我的两个Web服务器)
  • 添加了一个探针(http探测两个Web服务器)
  • 添加了负载均衡器规则

注意我没有添加入站NAT规则。 我无法弄清楚那是什么,或者我是否需要它。

在我的Web层,我tcpdump端口80并看到探针。 在httpd日志中,我看到探测器有200条成功消息。 我进入网络浏览器,点击我分配给LB的外部VIP,什么都没有。 它只是超时了。 我无法连接到LB VIP。

我错过了什么? 什么是NAT规则?

任何帮助,将不胜感激。 我在网上找到的所有内容都是在PowerShell等中执行此操作的示例。我正在使用Azure Web界面。

谢谢!

编辑:发现问题 - 需要NSG不仅允许AzureLoadBalancer,而且允许“Internet”命中端口80 / tcp。 应该早点考虑一下..


I'm trying to build a simple two-tier wordpress environment on CentOS 7.2 in Azure.

I've defined a virtual network, have connected it to my home-lab via IPsec VPN, and I've defined several subnets in Azure (for Web tier, SQL tier, and utility tier role segregation using Network Security Groups).

I have two web-tier VMs, both members of the same Availability Set, and are both on the web-tier subnet. They have internet access (outbound), I can SSH to them from my home-lab, and the seem fine operationally to me - httpd is listening on 80/tcp, and I can hit the web pages from my home-lab network by visiting each web server directly on its 192.168.x address.

I should mention my web servers DO NOT have public IPs assigned, but I can't see this being an issue.. they're intended to be behind the load balancer.

So, I've created a Load Balancer, and:

  • assigned a public IP to the LB
  • added a backend pool (selected my availability set, and chose my two web servers)
  • added a probe (http probing the two web servers)
  • added a load balancer rule

Notice I did NOT add an inbound NAT rule. I can't figure out what that's for, or if I need it.

On my web tier, I tcpdump port 80 and see the probes. In httpd logs, I see 200 success messages for the probes. I go to a web browser, hit the external VIP I assigned to the LB, and nothing. It just times out. I cannot connect to the LB VIP.

What am I missing? What are the NAT rules about?

Any help would be appreciated. All I can find online are examples doing this in powershell etc.. and I'm using the Azure web interface.

Thanks!

Edit: Found the issue - Needed the NSG to allow not just the AzureLoadBalancer, but "Internet" to hit port 80/tcp. Should have thought of that sooner..


原文:https://stackoverflow.com/questions/35928467
更新时间:2022-09-28 15:09

最满意答案

我要拿你的图表重新整理一下:

                                          /-----gamma-----/(3)---------->
                                         /               /
               /----beta---/(1)---/(2)--/---beta--------/--\
              /           /      /                          \
     /------------alpha--/------/---\                        \
    /                                \                        \
------------trunk--------------------(a)----------------------(b)------------------>

首先,删除trunk ,因为你没有使用它。 是的,你正在融入后备箱,但你永远不会从中取出代码。 相反, beta来自alphagamma来自beta 。 不妨将所有这些努力都归并到你从未真正使用过的代码行中:

                                          /-----gamma-----/(3)---------->
                                         /               /
               /----beta---/(1)---/(2)--/---beta--------/
              /           /      /                      
     /------------alpha--/------/                    
    /                                      
trunk

现在,让我们理清你的图表,以便主要的发展路线很好而且直线:

trunk-alpha-------beta-----------------------gamma-------------------------->
            \           /      /       \                /
             \---alpha-/------/         \---beta-------/

最后,翻转一切...

             /-alpha-\-----\            /--beta-------\
            /         \     \          /               \
trunk------/--(beta)---\-----\--------/-(gamma)---------\------(gamma)-------->

有你的箱子!

我知道你在做什么。 你不是在中继线上编码,因为中继线假设代表你的发行版。 在您的原始图中,主干上有两个版本。 要点(a)将分支alpha合并回主干,并将Point(b)合并分支Beta返回主干。 这代表你的Release Alpha和Release beta。

但是,这就是标签的用途! 您在发布中制作标签,并且您的标签现在代表您的发布。 而且,它更好,因为标签会保留文件的历史记录。

假设您在Point(b)处转到主干并记录特定文件。 您在Point(b)处看到该文件,并且您在Point(a)处看到另一个版本。 但是,您不知道该文件在点(a)和点(b)之间是如何变化的。 事实上,你甚至不知道是谁发布了对特定更改负责。

但是,如果您在分支上执行了一个标记而不是将代码合并回主干,那么您将会看到该文件的整个历史记录都返回到该文件的第一个版本。 Subversion的日志命令(如果你不使用--stop-on-copy开关)将带你从标签下降到分支测试版并返回到主干。

啊,你说,但是我怎么能看到版本alpha和版本beta之间的区别? 在我的计划中,我可以看看后备箱的历史!

但是,如果您需要查看一个版本与另一个版本之间的所有更改,则可以轻松地在两个标签之间进行差异。 而且,由于它们是标签,因此找到实际发行版本要容易得多,而不是试图弄清哪个版本的trunk表示您的发行版本。

所以,你确实有一个后备箱,但你不会那么称呼它。


I'm going to take your chart and reorganize it a bit:

                                          /-----gamma-----/(3)---------->
                                         /               /
               /----beta---/(1)---/(2)--/---beta--------/--\
              /           /      /                          \
     /------------alpha--/------/---\                        \
    /                                \                        \
------------trunk--------------------(a)----------------------(b)------------------>

First, remove trunk, since you're not using it. Yes, you're merging back into the trunk, but you never take code out of it. Instead, beta comes from alpha and gamma comes from beta. Might as well save yourself all that effort merging back into a code line you never really use:

                                          /-----gamma-----/(3)---------->
                                         /               /
               /----beta---/(1)---/(2)--/---beta--------/
              /           /      /                      
     /------------alpha--/------/                    
    /                                      
trunk

Now, let's straighten out your chart, so that the main development line is nice and straight:

trunk-alpha-------beta-----------------------gamma-------------------------->
            \           /      /       \                /
             \---alpha-/------/         \---beta-------/

And, finally flip over everything...

             /-alpha-\-----\            /--beta-------\
            /         \     \          /               \
trunk------/--(beta)---\-----\--------/-(gamma)---------\------(gamma)-------->

There's your trunk!

I know what you're doing. You're not coding on trunk because trunk is suppose to represent your release. In your original diagram, there are two versions on trunk. Point (a) where you merge branch alpha back to trunk, and Point (b) where you merge branch beta back to trunk. This represents your Release alpha and Release beta.

However, that's what tags are for! You make a tag on a release, and your tag now represents your release. And, it's better because a tag preserves the history of your file.

Let's say you go to your trunk at Point (b) and take a log of a particular file. You see the file at Point (b) and you see another version at Point (a). But, you have no idea how that file was changed between point (a) and point (b). In fact, you don't even know who's release responsible for a particular change.

However, if you did a tag off the branch instead of merging your code back to trunk, you'd see the entire history of that file all the back to the very first version of the file. Subversion's log command (if you don't use the --stop-on-copy switch) will take you from the tag down to branch beta and back to trunk.

Ah, you say, but how can I see the differences between release alpha and release beta? In my scheme, I can look at the history of the trunk!

However, if you need to see all the changes between one release and another, you could easily just do a diff between two tags. And, sine they're tags, it's much easier to find the actual release version instead of trying to figure out which version on trunk represents your which release.

So, you do have a trunk, but you just don't call it that.

相关问答

更多
  • 这看起来像背包的用例。 将每个版本的两个版本之间的类型和实例分开,并针对公共接口编写项目的其余部分,您可以将其实例化两次,类似于ML仿函数。 如果您不想复制类型声明,我不确定它是否可以正常工作,但也许您可以在公共库中使用类型Version的幻像参数声明类型: data Version = V1 | V2 data MyData (v :: Version) = ... data MyData2 (v :: Version) = C X Y (MyData v) | ... 并且有两个库分别为MyData ...
  • 天啊,听起来很乱...... 要做的第一件事就是让所有的开发人员离开回购集团几个小时,如果不是几天(因为它需要一段时间而且会有压力,希望你周末没有计划....),也许需要你的CI系统离线了一点。 (不是必要的,但它会节省一堆破碎的版本) 然后阅读: SVN手册转储/加载 制作repo文件系统的备份副本。 (如果你犯了错误。) svnadmin dump REPO_LOCATION_HERE --revision 0:LAST_SAFE_REVISION_NUMBER_HERE > baseline.dump ...
  • 通常所有的开发都是在trunk上完成的,trunk是你发布的基础。 您可以使用分支来稳定代码以准备发布,修补发行版或实现无法在主干上开发的功能,原因有多种。 当使用分支进行稳定或修补释放时,错误的修复或应该进入稳定分支的更改都是在主干上开发的,并且选择性地合并到分支。 使用功能分支时,您将提交到分支,然后合并回主干(可能从那里到稳定/补丁分支。 简短的故事,我想念你的开发周期中的trunk,我想知道你如何确保所有的更改最终都在trunk中,因为那是你的下一个主要功能发布将从/应该从哪里开始的。 Normal ...
  • 如果您在创建存储库时没有建立某种结构,则现在不能在不影响现有用户的情况下这样做。 存储库就像一个文件系统。 您现在可以创建结构,但是因为它将涉及在项目存储位置移动,所以要求用户从新位置结帐,或者使用开关选项更新其现有结帐以指向新位置。 你怎么做呢? 1)使用svn mkdir在存储库中创建trunk和branches文件夹。 您可以使用创建文件夹选项从Subclipse从SVN存储库视图执行此操作。 2)然后您需要将存储库根目录中的任何文件和文件夹移动到中继文件夹,以便中继线现在成为项目的根目录。 我会用命 ...
  • 我会解释发生了什么 。 在Git存储库中有一个'master'的更新,它绑定到SVN中的trunk。 此外,更新是非快进的,默认情况下,Git不允许在没有git push命令的-f选项的情况下进行此类推送。 非快进更新将转换为分支替换,因为这是SVN存储库中最接近的模拟。 例如,您可以比较git log master之后和更新与相应的svn log -v Project1/trunk输出,并看到两者都不包含r6089,并且列出的第一个提交将是r5477(如果我们不认为r6109没有在Git中没有模拟的变化) ...
  • 我建议为主干和每个分支单独进行一个eclipse项目。 我发现当分支分离时合并和标记更容易。 此外,更新单个项目所需的时间比分离项目要长,因为您每次都必须签出新创建的标签。 另一个注意事项是Eclipse是基于Java的。 将整个代码库签出为单个项目将显着影响系统性能。 当项目分开时,您可以关闭您不工作的分支。 I suggest having a separate eclipse project for the trunk and each of the branches. I found it's mu ...
  • 将当前主干移动到其他位置(/ branch / oldtrunk),然后将/ branch / mybranch移动到/ trunk。 (如果你想要的是用分支替换当前的trunk?) 使用命令行客户端,可以使用以下命令: svn mv http://path/to/repo/trunk http://path/to/repo/branch/oldtrunk svn mv http://path/to/repo/branch/mybranch http://path/to/repo/trunk 注意:在上面 ...
  • 我只是将不同的分支机构检查为不同的项目。 MyProjectTrunk,MyProjectBranch1,MyProjectBranch2等没问题。 如果您使用Run as Application,项目将永远不会在同一JVM上运行。 I just check out different branches as different projects. MyProjectTrunk, MyProjectBranch1, MyProjectBranch2 etc. No problem. The projects ...
  • 我要拿你的图表重新整理一下: /-----gamma-----/(3)----------> / / /----beta---/(1)---/(2)--/---beta--------/--\ / / / ...
  • 重新显示是指您希望将分支父级从旧分支移动到新分支的示例。 您想要创建一个新的主干来分支。 一般情况下,我建议在当前主干中添加“Version 1”标签,以便在必要时可以在以后返回当前版本。 这就是你“保持”当前主干的方式。 然后你可能需要从版本3到主干的无基础合并。 然后trunk是最新的,你可以再次开始分支新版本。 这是一篇包含更多细节的好文章 。 Reparenting is when you want to move a branches parent from an old branch to a ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)