运行 用于开发的本地 ESP

Run a ESP local for development

当我尝试 运行 本地 ESP 时出现此错误。

ERROR:Fetching service config failed(status code 403, reason Forbidden, url ***)

我有一个新创建的服务帐户,这个帐户可以很好地使用 gcloud cli。

系统:OSX Sierra Docker for MAC

这是我用来启动容器的命令:

docker run -d --name="esp" --net="host" -v ~/Downloads:/esp gcr.io/endpoints-release/endpoints-runtime:1.0 -s 2017-02-07r5 -v echo.endpoints.****.cloud.goog -p 8082 -a localhost:9000  -k /esp/serviceaccount.json

更新:

我发现我为服务名称 verision 和版本 servicename 设置的错误。

现在我没有收到任何错误,但它不起作用,这是容器的控制台输出。在我看来一切都很好,但它不起作用,我无法使用 localhost:8082/***

调用代理
INFO:Constructing an access token with scope https://www.googleapis.com/auth/service.management.readonly
INFO:Service account email: aplha-api@****.iam.gserviceaccount.com
INFO:Refreshing access_token
INFO:Fetching the service configuration from the service management service
nginx: [warn] Using trusted CA certificates file: /etc/nginx/trusted-ca-certificates.crt

这是使用的正确命令:

 docker run -d --name="esp-user-api" --net="host" -v ~/Downloads:/esp gcr.io/endpoints-release/endpoints-runtime:1.0 -s echo.endpoints.***.cloud.goog  -v 2017-02-07r5  -p 8082 -a localhost:9000 -k /esp/serviceaccount.json

Aron,我假设: (1) 您正在遵循本用户指南:https://cloud.google.com/endpoints/docs/running-esp-localdev

(2) 你在 localhost:9000

上确实有一个后端 运行ning

您是否按照 localhost:8082/*** 的用户指南中的建议发出了 curl 请求? curl 命令是否卡住或 returns 任何错误消息?

如果您还没有本地后端 运行ning,我建议您按照上面的用户指南来 运行 本地后端。请注意,本指南将指导您在端口 8080 运行,因此您需要将 docker 运行 命令从“-a localhost:9000”更改为“-a localhost:8080" 还有。

此外,请注意本用户指南适用于 linux 环境。我们还没有在 Mac 环境中尝试过此设置。我们确实注意到一些用户在 Windows docker 上进行了额外的工作,他将后端设置为 "IP of docker NIC"。注意“-a”是“--backend”的缩写。

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/google-cloud-endpoints/4sRaSkigPiU/KY8g46NSBgAJ