在Google Flex Engine上部署Django Channels应用程序 [英] Deploying Django channels app on google flex engine

查看:117
本文介绍了在Google Flex Engine上部署Django Channels应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在django频道上工作,并且在将它们部署到google flex引擎上时遇到问题,首先我遇到了部署未能在指定的时间内变得健康的错误,并通过在app.yaml中添加readiness_check来解决它,现在我遇到以下错误:

I am working on django channels and getting problem while deploying them on google flex engine,first I was getting error of 'deployment has failed to become healthy in the allotted time' and resolved it by adding readiness_check in app.yaml,now I am getting below error:

(gcloud.app.deploy)操作[apps / socketapp-263709 / operations / 65c25731-1e5a-4aa1-83e1-34955ec48c98 ] 时间到。此操作可能仍在进行中。

App.yaml

runtime: python
env: flex
runtime_config:
  python_version: 3
instance_class: F4_HIGHMEM

handlers:
# This configures Google App Engine to serve the files in the app's
# static directory.
- url: /static
  static_dir: static/
- url: /.*
  script: auto
# [END django_app]

readiness_check:
  check_interval_sec: 120
  timeout_sec: 40
  failure_threshold: 5
  success_threshold: 5
  app_start_timeout_sec: 1500

如何解决此问题,有何建议?

How can I fix this issue,any suggestions?

推荐答案

以下错误是由于多个问题引起的:

The following error is due to several issues:

1)您没有正确配置app.yaml文件。 App Engine Flexible中的资源请求不是通过instance_class选项进行的,要请求资源,您必须使用资源选项,如下所示:

1) You aren't configuring correctly your app.yaml file. The resource request in App Engine Flexible is not through instance_class option, to request resources, you've to use resources option like following:

resources:
  cpu: 2
  memory_gb: 2.3
  disk_size_gb: 10
  volumes:
   - name: ramdisk1
     volume_type: tmpfs
     size_gb: 0.5

2)您缺少应用程序的入口点。要部署 Django频道,他们建议为Daphne服务器提供一个入口点。在您的app.yaml中添加以下代码:

2) You're missing an entrypoint for your app. To deploy Django channels, they suggest to have an entrypoint for Daphne server. Add in your app.yaml the following code:

entrypoint: daphne -b 0.0.0.0 -p 8080 mysite.asgi:application

3)完成上一个操作后,如果仍然遇到相同的错误,则可能是在您的App Engine Flexible应用程序区域中使用IP地址配额已达到限制。
要检查此问题,可以转到项目主页的活动选项卡。他们会看到配额限制和虚拟机创建失败的警告。

3) After doing the previous, if you still get the same error, it's possible that your In-use IP addresses quota in the region of your App Engine Flexible application has reached its limit. To check this issue, you can go to "Activity" tab of your project home page. Their, you can see warnings of quota limits and VM's failing to be created.

默认情况下,App Engine会离开您的应用程序的先前版本,并且运行时可能会占用IP地址您可以删除以前的版本和/或请求增加IP地址配额限制。

App Engine by default leaves the previous versions of your App, and running that may take IP addresses.You can delete the previous versions and/or request an increase of your IP address quota limit.

还可以更新gcloud工具和SDK来解决问题。

Also update gcloud tools and SDK which may resolve the issue.

要检查您的使用地址单击此处,您将可以通过单击Cloud Console中的编辑配额按钮来增加配额。

To check your in-use addresses click here and you will be able to increase your quota by clicking the 'Edit Quotas' button in the Cloud Console.

这篇关于在Google Flex Engine上部署Django Channels应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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