我将我的项目从ComputeEngine迁移到AppEngine,在ComputeEngine中,我定义了每个服务可以使用的端口。因此,当彼此通信时,我所做的就是用一个简单的localhost来称呼他们:端口,一切都是幸福;直到我必须在AppEngine中做同样的事情,事实证明我无法识别已部署的每个服务的本地url。
我认为,定义将在部署每个服务时生成的公共URL(.appspot.com)并不是一个好主意,因为会生成网络流量。
答案 0 :(得分:2)
使用dispatch.yaml
,您可以确定为每个网址提供哪种服务:
dispatch: # don't forget: gcloud app deploy dispatch.yaml after changes !!!
- url: "*/urls/that/need/more/RAM/" # note wildcard capability
service: service_1
- url: "urls/that/need/more/speed/*" # note wildcard capability
service: service_2
- url: "service_1.app_name.appspot.com/*" # this should match cron calls to service_1 target
service: service_1
- url: "*/.*"
service: default