【发布时间】:2018-06-21 07:49:51
【问题描述】:
我在 App Engine 上部署了一个 nodejs 应用程序,我面临的问题是 app Engine 在 10 分钟后重复点击命令“node app.js”。我一次只有一个应用实例,目前只提供一个版本。
这里是配置app的package.json和app.yaml
package.json
{
"name": "appengine-Relay-dashboard",
"description": "Manages the cronjobs in which the cloud functions are emitted.",
"version": "0.0.1",
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
"repository": {
"type": "git",
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": "9.x"
},
"scripts": {
"deploy": "gcloud app deploy",
"start":"node app.js",
"lint": "repo-tools lint",
"pretest": "npm run lint",
"system-test": "repo-tools test app",
"test": "npm run system-test",
"e2e-test": "repo-tools test deploy"
},
"dependencies": {
"@google-cloud/bigquery": "^1.2.0",
"aws-sdk": "^2.230.1",
"cron": "^1.3.0",
"express": "^4.16.2",
"moment-timezone": "^0.5.16",
"request": "^2.85.0",
"request-promise": "^4.2.2",
"sleep": "^5.1.1",
"twilio": "^3.16.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "2.2.1"
},
"cloud-repo-tools": {
"test": {
"app": {
"msg": "Hello, world!"
}
},
"requiresKeyFile": true,
"requiresProjectId": true
}
}
app.yaml
runtime: nodejs
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
这是我面临的图像中的问题
有谁知道如何解决这个问题?
【问题讨论】:
-
您正在运行的实例 - 运行时间是否超过 10 分钟?它是否有可能死亡或被杀死(可能是因为它没有通过健康检查)?
-
我得到了解决方案,请参阅下面的答案!
-
如果您能在代码中描述您想要实现的目标,即使您已经为自己找到了解决方案,这对社区中的其他人也会有所帮助
标签: node.js google-app-engine yaml app-engine-flexible