[转]处理 AWS ELB 中GoRouter实例失效(Out of Service)
我在AWS上部署CF的时候,在Go Router 前面设置了AWS ELB来对传入流量进行均衡。部署完毕,所有的虚拟机开始运行。可是在Amazon Console的网络界面中,EC2服务下的ELB实例却显示一个Go Router失效了(Out of Service)。
解决这个问题,我从以下三方面着手:
1)检查ELB
2)检查Go Router
3)检查ELB和Go Router之间的网络通信设置
首先curl ELB 没什么问题,并且另外一个Go Router在ELB的可用实例中正常运行,所以ELB本身应该没什么问题。
其次,我运行bosh vms查看Go Router虚拟机在正常运行,然后ssh远程登录到Go Router虚拟机,使用monit summary看到一切作业进程也都运行正常。
这些快速的调试技巧让我锁定了第三种可能。我看到ELB在Availability Zones中没有设置失效Go Router所在的子网,而为了使ELB能够路由流量到某个特定的子网或者Availability Zone,我们必须在ELB的实例中的Availability Zones进行设置添加那个子网。
接下来的工作很简单,登录AWS Console,去AWS的页面左上角点击Services会看到下拉菜单,选择EC2,进入了EC2管理页面后,点击Load Balancers选项,选择要设置的ELB,点击Instances一项就可以看到Edit Availability Zones,点击添加失效Go Router所在的子网段,点击保存。失效的Go Router开始作为ELB的实例运行了!
To read the English version, please click:Handling GoRouter Is "Out of Service" for AWS ELB.
When I deployed CF in AWS, I put an ELB in front of my two Go Routers to balance the incoming traffic. After the CF deployment completes all the VMs are running. However, one of the Go Router is showed as out of service in the Instances tab in the ELB dashboard.
To debug this problem I looked in these three locations:
1) Check ELB itself
2) Check if the Go Router is working
3) Check networking between the Go Router and ELB
First I start by curling the ELB without problems and one of the Go Router instance is in service, so ELB itself should not be a problem.
Second, I then run bosh vms to verify the Go Router is running, ssh into the Go Router VM and run monit summary, all the processes are running.
Those quick checks lead me to look into the third possibility. I observed that the subnet which the "out of service" Go Router belongs to is not configured in the Availability Zones for the ELB. In order to make the ELB route traffic to an AZ we have to configure it in the Availability Zones.
The fix is pretty simple, go to AWS console, find Load Balancers in EC2dashboard, select the ELB we are debugging and then click Instances Tab, click Edit Availability Zones, add the subnet which the "out of service" Go Router belongs to, click Save. Now I can see both of my Go routers are in Service in my ELB!
浙公网安备 33010602011771号