Google Cloud Endpoint 可扩展服务代理未启动

Google Cloud Endpoint Extensible Service Proxy does not start

我正在尝试在我的计算实例上安装可扩展服务代理。我正在按照本指南安装 ESP Nginx 服务:https://cloud.google.com/endpoints/docs/quickstart-compute-engine#running_the_extensible_service_proxy。我能够毫无问题地安装 ESP 服务,但是当我尝试使用命令 service nginx start 启动该服务时,该服务没有启动。

首先它在 /var/log/nginx/error.log 中给出了这个错误:

Traceback (most recent call last):
File "/usr/sbin/start_esp.py", line 48, in <module>
from mako.template import Template
ImportError: No module named mako.template

在我使用命令 pip install mako 安装 mako 模板模块后错误消失了。

现在报错:

INFO:Fetching the service name from the metadata service
ERROR:Fetching service name failed (status code 404)

如有任何帮助,我们将不胜感激。谢谢

您是否忘记在元数据中输入您的服务名称? 来自 https://cloud.google.com/endpoints/docs/quickstart-compute-engine

在元数据部分添加以下端点元数据 key/value 对:

将 endpoints-service-name 指定为键,将 YOUR-PROJECT-ID.appspot.com 指定为其值,将 YOUR-PROJECT-ID 替换为您的项目 ID。 单击添加项目。 将 endpoints-service-version 指定为键,部署时返回的服务版本作为键的值。