首页
学习
活动
专区
圈层
工具
发布

部署
EN

Stack Overflow用户
提问于 2015-08-11 23:59:39
回答 2查看 746关注 0票数 1

我是新的谷歌应用引擎。我在python中创建了hello world应用程序,并在本地验证了它。我尝试使用以下命令进行部署

appcfg.py -A项目ID更新dir\

它打开一个浏览器,并要求我登录到我的谷歌应用程序帐户。一旦我这样做,浏览器就会显示一个带有本地主机的url。应用程序再次在本地主机上运行,不会在google云上部署。我试着用项目ID ie- http://your-app-id.appspot.com/访问url,但它说没有找到错误。有人遇到这种情况,你能帮忙吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-08-12 00:13:01

这种行为有几个可能的原因:

  • 您没有正确地使用appcfg.py命令
  • 对于GAE部署,您使用的是不支持appcfg.py的glcoud版本(命令正在“滚入”gcloud工具集)

要检查已安装的gcloud版本,只需运行$ gcloud即可。

更新的gcloud使用了以下语法:$ gcloud preview app deploy ~/my_app/app.yaml,这是一个链接,以及关于部署的更多细节

票数 0
EN

Stack Overflow用户

发布于 2017-05-25 11:06:31

此部署适用于windows平台1)在google应用程序引擎上的本地服务器部署:

代码语言:javascript
复制
cd to C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin
then run command

python dev_appserver.py  C:\000_hello_endpoints(location)

this will deploy your app locally on http://localhost:8080

 Output :
INFO 2017-05-25 13:51:20,782 devappserver2.py:692] Skipping SDK update check.
INFO 2017-05-25 13:51:22,221 api_server.py:272] Starting API server at: http://localhost:21018
INFO 2017-05-25 13:51:22,232 dispatcher.py:205] Starting module "default" running at: localhost:8080
INFO 2017-05-25 13:51:22,232 admin_server.py:116] Starting admin server at: http://localhost:8000

2) Cloud app Deployment on Google app engine:

Run gcloud init command in google cloud sdk shell:
Choose the account you would like to use to perform operations for
this configuration:
 [1] karanchaparwalops@gmail.com
 [2] Log in with a new account
Please enter your numeric choice: 1

You are logged in as: [karanchaparwalops@gmail.com].

Pick cloud project to use:
 [1] machine-nebula-168
 [2] Create a new project
Please enter numeric choice or text value (must exactly match list
item): 1

Your current project has been set to: [machine-nebula-168].

Do you want to configure Google Compute Engine
(cloud.google.com/compute) settings (Y/n)? Y

Which Google Compute Engine zone would you like to use as project
default?
If you do not specify a zone via a command line flag while working
with Compute Engine resources, the default is assumed.
 [1] asia-east1-b
 [2] asia-east1-a
 [3] asia-east1-c
 [4] asia-northeast1-c
 [5] asia-northeast1-a
 [6] asia-northeast1-b
 [7] asia-southeast1-b
 [8] asia-southeast1-a
 [9] europe-west1-d
 [10] europe-west1-c
 [11] europe-west1-b
 [12] us-central1-b
 [13] us-central1-f
 [14] us-central1-a
 [15] us-central1-c
 [16] us-east1-d
 [17] us-east1-c
 [18] us-east1-b
 [19] us-east4-b
 [20] us-east4-c
 [21] us-east4-a
 [22] us-west1-b
 [23] us-west1-a
 [24] Do not set default zone
Please enter numeric choice or text value (must exactly match list
item): 1

Your project default Compute Engine zone has been set to [asia-east1-b].
You can change it by running [gcloud config set compute/zone NAME].

Your project default Compute Engine region has been set to [asia-east1].
You can change it by running [gcloud config set compute/region NAME].

Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use karanchaparwalops@gmail.com by default
* Commands will reference project `machine-nebula-168` by default
* Compute Engine commands will use region `asia-east1` by default
* Compute Engine commands will use zone `asia-east1-b` by default

Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic -h` to learn about advanced features of the SDK like arg files and output formatting

C:\000_Hello_Endpoints>gcloud app deploy
You are creating an app for project [machine-nebula-168].
WARNING: Creating an App Engine application for a project is irreversible and the region
cannot be changed. More information about regions is at
cloud.google.com/appengine/docs/locations.

Please choose the region where you want your App Engine application
located:

 [1] europe-west (supports standard and flexible)
 [2] us-east1 (supports standard and flexible)
 [3] us-central (supports standard and flexible)
 [4] asia-northeast1 (supports standard and flexible)
 [5] us-east4 (supports standard and flexible)
 [6] cancel
Please enter your numeric choice: 4

Creating App Engine application in project [machine-nebula-168] and region [asia-northeast1]....done.
You are about to deploy the following services:
 - machine-nebula-168/default/20170525t134403 (from [C:\000_Hello_Endpoints\app.yaml])
  Deploying to URL: [machine-nebula-168.appspot]

Do you want to continue (Y/n)? Y

Beginning deployment of service [default]...
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[C:\Users\KaranC\AppData\Roaming\gcloud\logs\2017.05.25\13.43.24.426000.log].
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 4 files to Google Cloud Storage ═╣
╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...done.
Deployed service [default] to [machine-nebula-168.appspot]

You can stream logs from the command line by running:
  $ gcloud app logs tail -s default

To view your application in the web browser run:
  $ gcloud app browse

C:\000_Hello_Endpoints>gcloud app browse
Opening [https://machine-nebula-168.appspot.com] in a new tab in your default browser.

我假设您已经为windows安装了python引擎sdk,谢谢您调优in..upvote,如果它有帮助的话。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31953938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档