我是新的谷歌应用引擎。我在python中创建了hello world应用程序,并在本地验证了它。我尝试使用以下命令进行部署
appcfg.py -A项目ID更新dir\
它打开一个浏览器,并要求我登录到我的谷歌应用程序帐户。一旦我这样做,浏览器就会显示一个带有本地主机的url。应用程序再次在本地主机上运行,不会在google云上部署。我试着用项目ID ie- http://your-app-id.appspot.com/访问url,但它说没有找到错误。有人遇到这种情况,你能帮忙吗?
发布于 2015-08-12 00:13:01
发布于 2017-05-25 11:06:31
此部署适用于windows平台1)在google应用程序引擎上的本地服务器部署:
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,如果它有帮助的话。
https://stackoverflow.com/questions/31953938
复制相似问题