【发布时间】:2016-09-22 12:01:40
【问题描述】:
我已经完成了简单的设置:
后端(网站):
1 台安装了 tomcat 并在 8080 上提供服务的机器。
tomcat的webapps文件夹有两个文件夹
1 withGoogleRule1
|--test.html
2 withoutGoogleRule1
|--test.html
现在我有一个具有以下设置的 google-load-balancer 设置
现在后端机器direct ip 是http://104.197.37.171:8080/withoutGoogleRule1/test.html
负载均衡器网址是 http://107.178.240.39:8080/withoutGoogleRule1/test.html
问题:
无论我们刷新多少次直接机器的url,所有请求总是正确的。
但是,如果您使用负载均衡器访问 url,5 次中有 1 次会显示
The requested URL /withoutGoogleRule1/test.html was not found on this server.
详情:
Youtube Video显示请求失败
PS:
实例组详情:
LoadBalancer 后端详情
【问题讨论】:
-
您能否详细说明“withGoogleRule1”和“withoutGoogleRule1”的含义?你来这里的目的是什么?我很困惑,您为 withGoogleRule1 配置了 URL 映射,但您试图在没有 GoogleRule1 的情况下访问。
-
您可以检查您的 Tomcat 日志以确保 404 是由自身返回还是由负载均衡器返回。
-
您的实例组是什么类型的?托管还是非托管?
-
我注意到在您的实例组和后端服务中,您将 http 映射到 80 和 8080。在运行状况检查中,您使用了端口 80。
-
"withGoogleRule1" 和 "withoutGoogleRule1" 仅用于测试目的.. "withGoogleRule1" 是在 google "host and path" 中添加的 url .... "withoutGoogleRule1" 是一个 url,它是未添加到谷歌的主机和路径部分。
标签: tomcat load-balancing google-compute-engine google-cloud-platform