简体   繁体   中英

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. 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 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? Or is my problem that I should be putting something into 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
  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!)
  3. That app.yaml in the docs is a typo
  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. 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

Also, did you pass --backends to enable backends support in dev_appserver.py ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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