【问题标题】:How run ghost on Google App Engine如何在 Google App Engine 上运行 ghost
【发布时间】:2018-07-02 16:39:09
【问题描述】:

我想在 GAE 标准环境下运行 ghost。 但我做不到。会发生什么?

server.js

const ghost = require('ghost');
const port = process.env.PORT || 8080;

ghost().then(function (ghostServer) {
    ghostServer.rootApp.listen(port);
});

错误信息

INFO This request caused a new process to be started for your application and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

ERROR A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)

【问题讨论】:

    标签: node.js google-app-engine ghost


    【解决方案1】:

    我之前收到过一次错误代码 204。就在我发现应用引擎版本的 python ssl 库中存在内存泄漏时,每隔几分钟就会使我的实例崩溃。我必须与 Google Cloud Support 合作才能解决这个问题。

    我遇到了另一个问题,我不得不更改 python 库的源代码,因为它会尝试绑定到端口并失败。这实际上很好,因为它优雅地失败了,我试图解决的问题是它有时会挂起 10 分钟。

    根据this,GAE 标准上的 NodeJS 处于测试阶段:

    这是 Google App Engine 标准环境中的 Node.js 测试版。此功能可能会以向后不兼容的方式进行更改,并且不受任何 SLA 或弃用政策的约束。

    所以我不会偏离他们提供的示例应用太远:

    https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/hello-world/standard

    选项

    1. 如果可能,请在 GAE 标准上坚持使用 Express
    2. 如果您需要使用 Ghost,请考虑切换到 GAE Flex
    3. 如果您对在 GAE 标准上使用 Ghost 很执着,请像在示例中那样使用 Express,但将其设置为 Ghost 的适配器。有一个单一的 Express 请求处理程序,将请求提供给 Ghost 并将来自 ghost 的响应传回(事实上,这个功能请求听起来像我试图描述的 https://github.com/TryGhost/Ghost/issues/827

    【讨论】:

    • 感谢您的回答。我选择并尝试了“3”。但它不起作用。我认为“ghost”中有错误的系统调用。
    【解决方案2】:

    目前谷歌的公开文档中没有提到“错误 204”,所以我建议您直接联系技术支持来解决这个问题。关注this 链接并提供您的项目编号。

    注意:项目编号和项目ID不一样,后者视为PII,不应公开分享。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-03-31
      • 1970-01-01
      • 1970-01-01
      • 2020-01-07
      • 2016-05-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多