GAE实例正在不同的网址上投放 [英] GAE instance is serving on different url

查看:102
本文介绍了GAE实例正在不同的网址上投放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Google应用引擎实例在默认的网址上投放的网址不同。最近,我将一个GAE项目上传到新创建的代码 foo-backend 的实例中。



在看到服务日志时,它显示

 > /_ah/spi/BackendService.getApiConfigs 
保存;键:__appstats __:031500,部分:57字节,完整:1452字节,开销:0.000 + 0.003;链接:http://1-dot-foo-backend.appspot.com/_ah/stats/details?time=1479812131572

你看,服务网址是 http://1-dot-foo-backend.appspot.com 而不是 http: //foo-backend.appspot.com 。我想改变这个..任何想法?

解决方案

在您的 app.yaml 你有版本:1



为了看看这里发生了什么,以下情形:您的应用程序的版本n已部署,并且前端队列为后端工作。您部署版本n + 1并将其设为默认值。但是你在前端和后端之间做了协调一致的改变。如果n + 1版本的后端接收到由前端版本n排队的工作,现在会发生什么情况?根据变化,这可能会导致混乱。



唯一安全的做法是安排由版本n前端排队的工作由版本处理n后端,直到所有版本的n工作都耗尽。同时,由版本n + 1前端处理的工作由版本n + 1后端处理。这是如何保证的?通过在工作在URL中排队时对默认版本进行编码。


My google app engine instance is serving on different url than the default's one. Recently I uploaded an GAE project to the newly created instance of code foo-backend.

On seeing the serving logs, it shows

> /_ah/spi/BackendService.getApiConfigs
Saved; key: __appstats__:031500, part: 57 bytes, full: 1452 bytes, overhead: 0.000 + 0.003; link: http://1-dot-foo-backend.appspot.com/_ah/stats/details?time=1479812131572

You see, serving url is http://1-dot-foo-backend.appspot.com instead of http://foo-backend.appspot.com. I want to change this.. Any idea?

解决方案

In your app.yaml you have version: 1.

To see the 'why' of what's going on here, consider the following scenario: You have version n of your app deployed, with the front-end queuing work for the back-end. You deploy version n+1 and make it the default. But you made a coordinated change between front-ends and back-ends. What now happens if work queued by front-end version n is received by a version n+1 backend? Depending on the change, it might cause mayhem.

The only safe thing to do is to arrange for work queued by a version n front-end to be handled by a version n back-end until all version n work is drained. Meanwhile work queued by a version n+1 front-end get handled by a version n+1 backend. How does this be guaranteed? By encoding the default version at the time the work is queued in the URL.

这篇关于GAE实例正在不同的网址上投放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆