简体   繁体   English

如何在GAE中配置后端

[英]How do I configure a backend in GAE

I seem to be missing something fundamental. 我似乎缺少一些基本知识。 I added a backends.yaml file to the directory where my app lives in my development environment. 我将backends.yaml文件添加到应用程序在开发环境中的目录中。 This file contains the following: 该文件包含以下内容:

backends:
- name: reporting
  class: B8
  options: dynamic public

I deployed and the admin console says I don't have any backends configured. 我已部署,管理控制台说我没有配置任何后端。 I tried using appcfg.py like this: 我尝试像这样使用appcfg.py:

appcfg.py backends ~/work/google/myappfolder list

and it says: 它说:

No backends configured for app: {my app name}.

The documentation says: 文件说:

appcfg backends <dir> list
Lists all the backends configured for the app specified in dir/app.yaml.

Is app.yaml a typo? app.yaml是错字吗? Or is my problem that I should be putting something into app.yaml? 还是我应该在app.yaml中添加内容的问题? I didn't find any mention of that anywhere else. 我在其他任何地方都没有提到它。

Also, some of the documentation says you have to start all backends manually, but other parts say that "dynamic" backends do not need be started from the command line -- they are started automatically. 另外,一些文档说您必须手动启动所有后端,但是其他部分说“动态”后端不需要从命令行启动,它们会自动启动。 Which is it? 哪有

This was answered by alex in the comments. 亚历克斯在评论中回答了这个问题。 Here are the key take-aways: 以下是关键要点:

  1. You must do appcfg.py backends dir update to get things going 您必须执行appcfg.py backends dir update才能使一切正常
  2. You must do that again every time you update your code (clicking the deploy button in the launcher program does not update your backends!) 每次更新代码时,都必须再次执行此操作(单击启动器程序中的deploy按钮不会更新您的后端!)
  3. That app.yaml in the docs is a typo 该文档中的app.yaml是一个错字
  4. You do not need to start dynamic backends from the command line; 您无需从命令行启动动态后端。 they do start automatically 他们会自动启动
  5. The logs are useless in debugging backend issues; 日志在调试后端问题时没有用。 do not assume a lack of information in the logs is indicative of anything 不要假设日志中缺少信息就可以说明任何事情
  6. If giving multiple options, separate them with commas 如果提供多个​​选项,请用逗号分隔

Have you actually started the backend up via the command line? 您实际上是否通过命令行启动了后端?

 appcfg backends <dir> start <backend>

Sets the backend state to START, allowing it to receive HTTP requests. 将后端状态设置为START,以允许其接收HTTP请求。 Resident backends start immediately. 常驻后端立即启动。 Dynamic backends do not start until the first user request arrives . 在第一个用户请求到达之前,动态后端不会启动 Has no effect if the backend was already started. 如果后端已经启动,则无效。

So yes, you do need to do that before it can serve even on dynamic instances as you have. 因此,是的,您确实需要这样做,以便它甚至可以在动态实例上使用。

https://developers.google.com/appengine/docs/python/backends/overview#Commands https://developers.google.com/appengine/docs/python/backends/overview#Commands

Also, did you pass --backends to enable backends support in dev_appserver.py ? 另外,您是否通过--backendsdev_appserver.py启用了后端支持?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM