Node.js在Google Cloud Platform上运行Hello World错误部署错误 [英] Node.js Running Hello World on Google Cloud Platform error deployment error

查看:163
本文介绍了Node.js在Google Cloud Platform上运行Hello World错误部署错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OSX Yosemite上,当我执行 Node.JSHello WorldGoogle Cloud Platform教程



初始错误如下所示:日产 - MacBook-Pro:1-hello-world nissan $ gcloud预览应用程序部署app.yaml --set-default $ b $($)

$ b您即将部署以下模块:
- hello-world-project-1018 / default(来自[/Users/nissan/source/repos/1-hello-world/app.yaml])
部署的URL:[https://hello-world-project-1018.appspot.com]

要继续(是/否)? y

开始部署...
验证受管VM已启用并准备就绪。
如果这是您的第一个部署,这可能需要一段时间才能完成。

错误:(gcloud.preview.app.deploy)无法连接到docker守护程序。
请考虑提供`--remote`标志来执行托管的docker构建,为此不需要本地的docker环境。

如果要在本地执行docker build,请检查环境变量DOCKER_HOST,DOCKER_CERT_PATH和DOCKER_TLS_VERIFY是否设置正确。
使用boot2docker,您可以通过运行以下命令来设置它们:
boot2docker shellinit
并执行boot2docker显示的命令。

我按照错误的建议,包括 - remote 标记,再次出现以下错误:

  Nissans-MacBook-Pro:1-hello-world日产$ gcloud预览应用程序部署app.yaml --set-default --remote 
您即将部署以下模块:
- hello-world-project-1018 / default(来自[/ Users / nissan / source / repos / 1-hello-world / app.yaml])
部署的URL:[https://hello-world-project-1018.appspot.com]

你想继续(是/否)? y

开始部署...
验证受管VM已启用并准备就绪。

配置远程构建服务。
已创建[https://www.googleapis.com/compute/v1/projects/hello-world-project-1018/global/firewalls/allow-gae-builder]。
名称网络SRC_RANGES规则SRC_TAGS TARGET_TAGS
allow-gae-builder默认0.0.0.0/0 tcp:2376
复制证书以进行安全访问。可能会提示您创建SSH密钥对。
警告:永久添加104.197.79.93(RSA)到已知主机列表。
错误:由于以下原因导致无法连接到Docker守护程序:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:590)
错误:(gcloud.preview.app.deploy)无法连接到docker守护进程。
请考虑提供`--remote`标志来执行托管的docker构建,为此不需要本地的docker环境。

如果要在本地执行docker build,请检查环境变量DOCKER_HOST,DOCKER_CERT_PATH和DOCKER_TLS_VERIFY是否设置正确。
使用boot2docker,您可以通过运行以下命令来设置它们:
boot2docker shellinit
并执行boot2docker显示的命令。

任何需要解决的建议将不胜感激。



Boot2Docker和Google Cloud Platform版本如下所示:

  Boot2Docker-cli版本:v1.7.1 
Git commit :8fdc6f5

Google Cloud SDK 0.9.70

应用程式2015.07.16
bq 2.0.18
bq-nix 2.0.18
核心2015.07.16
core-nix 2015.06.02
gcloud 2015.07.16
gsutil 4.13
gsutil-nix 4.12
预览2015.07.16


解决方案

我经历了一场战斗,让这个工作。我希望我可以记住每一步,但我会尽量提供我记得如下:


  1. 安装Boot2Docker CLI ,如果没有完成


  2. 将一个app.yaml文件添加到项目的根目录中。以下是我运行nodejs应用程序的示例:
    https://gist.github.com/匿名/ 7255416f58b56d282e6b - 我直接从Google的示例节点应用(书架)


  3. 在项目目录中,运行 boot2docker up - 这将提示您要运行另一个命令,并且必须设置一些环境变量。没有这样做,我收到了作者获取的错误。


这是:

 等待VM和Docker守护进程启动... 
.o
启动。
写/Users/bryan/.boot2docker/certs/boot2docker-vm/ca.pem
写/Users/bryan/.boot2docker/certs/boot2docker-vm/cert.pem
写/用户/ bryan / .boot2docker / certs / boot2docker-vm / key.pem

要将Docker客户端连接到Docker守护程序,请设置:
export DOCKER_HOST = tcp://192.168。 59.103:2376
export DOCKER_CERT_PATH = / Users / bryan / .boot2docker / certs / boot2docker-vm
export DOCKER_TLS_VERIFY = 1

或运行:`eval'$(boot2docker shellinit)

我运行 eval$(boot2docker shellinit)


  1. 运行 gcloud preview app deploy app.yaml --set-default --version X

另外要注意的是,由于某种原因,我认为(不确定)在没有版本标志的情况下不会工作,所以请尝试X应用程序的版本号替换X。



我相信这些是我采取的完整步骤终于让它工作了。希望至少有助于。


I am on Mac OSX Yosemite, I have an error occuring when I execute the step "Running Hello World" following the Node.JS "Hello World" tutorial for Google Cloud Platform

The initial error is listed below:

Nissans-MacBook-Pro:1-hello-world nissan$ gcloud preview app deploy app.yaml --set-default
You are about to deploy the following modules:
 - hello-world-project-1018/default (from [/Users/nissan/source/repos/1-hello-world/app.yaml])
     Deployed URL: [https://hello-world-project-1018.appspot.com]

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

Beginning deployment...
Verifying that Managed VMs are enabled and ready.
If this is your first deployment, this may take a while...done.

ERROR: (gcloud.preview.app.deploy) Couldn't connect to the docker daemon.
Please consider providing the `--remote` flag to perform a hosted docker build, for which a local docker environment is unnecessary.

If you would like to perform the docker build locally, please check whether the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly.
With boot2docker, you can set them up by running:
  boot2docker shellinit
and executing the commands that boot2docker shows.

I followed the advice in the error and included the --remote flag for the command with the following error again:

Nissans-MacBook-Pro:1-hello-world nissan$ gcloud preview app deploy app.yaml --set-default --remote
You are about to deploy the following modules:
 - hello-world-project-1018/default (from [/Users/nissan/source/repos/1-hello-world/app.yaml])
     Deployed URL: [https://hello-world-project-1018.appspot.com]

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

Beginning deployment...
Verifying that Managed VMs are enabled and ready.

Provisioning remote build service.
Created [https://www.googleapis.com/compute/v1/projects/hello-world-project-1018/global/firewalls/allow-gae-builder].
NAME              NETWORK SRC_RANGES RULES    SRC_TAGS TARGET_TAGS
allow-gae-builder default 0.0.0.0/0  tcp:2376
Copying certificates for secure access. You may be prompted to create an SSH keypair.
Warning: Permanently added '104.197.79.93' (RSA) to the list of known hosts.
ERROR: Failed to connect to Docker Daemon due to: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
ERROR: (gcloud.preview.app.deploy) Couldn't connect to the docker daemon.
Please consider providing the `--remote` flag to perform a hosted docker build, for which a local docker environment is unnecessary.

If you would like to perform the docker build locally, please check whether the environment variables DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are set correctly.
With boot2docker, you can set them up by running:
  boot2docker shellinit
and executing the commands that boot2docker shows.

Any advice to solve would be appreciated.

Boot2Docker and Google Cloud Platform versions are listed below:

Boot2Docker-cli version: v1.7.1
Git commit: 8fdc6f5

Google Cloud SDK 0.9.70

app 2015.07.16
bq 2.0.18
bq-nix 2.0.18
core 2015.07.16
core-nix 2015.06.02
gcloud 2015.07.16
gsutil 4.13
gsutil-nix 4.12
preview 2015.07.16

解决方案

I went through a heck of a battle to get this to work. I wish I could remember every step, but I'll try to provide as much as I remember below:

  1. Install Boot2Docker CLI, if not done already

  2. Add an app.yaml file to your project's root directory. Here is an example of mine running a nodejs app: https://gist.github.com/anonymous/7255416f58b56d282e6b -- I took this directly from Google's sample node app (bookshelf).

  3. In project directory, run boot2docker up -- this will prompt you to run another command with some environment variables you have to set. Without doing this, I got the error that the author gets.

Here's that:

Waiting for VM and Docker daemon to start...
.o
Started.
Writing /Users/bryan/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/bryan/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/bryan/.boot2docker/certs/boot2docker-vm/key.pem

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.103:2376
    export DOCKER_CERT_PATH=/Users/bryan/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

Or run: `eval "$(boot2docker shellinit)"`

I ran eval "$(boot2docker shellinit)"

  1. Run gcloud preview app deploy app.yaml --set-default --version X

Additional note is that for some reason, I think (not sure) that it wouldn't work without the version flag, so try that where X is replaced by a version number of your app.

I believe that these are the full steps I took that finally made it work. Hopefully it helps, at least.

这篇关于Node.js在Google Cloud Platform上运行Hello World错误部署错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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