Ibm cloud IoTP样板应用程序在Diego迁移后不工作

Ibm cloud IoTP样板应用程序在Diego迁移后不工作,ibm-cloud,node-red,watson-iot,diego,Ibm Cloud,Node Red,Watson Iot,Diego,将我的Watson IoTP样板应用程序迁移到Diego后,它不再启动。我在日志中看到: [APP/0] OUT Welcome to Node-RED [APP/0] OUT =================== [APP/0] OUT 18 Jan 15:43:16 - [info] Node-RED version: v0.15.3 [APP/0] OUT 18 Jan 15:43:16 - [info] Node.js version: v4.

将我的Watson IoTP样板应用程序迁移到Diego后,它不再启动。我在日志中看到:

[APP/0]      OUT Welcome to Node-RED
[APP/0]      OUT ===================
[APP/0]      OUT 18 Jan 15:43:16 - [info] Node-RED version: v0.15.3
[APP/0]      OUT 18 Jan 15:43:16 - [info] Node.js  version: v4.6.2
[APP/0]      OUT 18 Jan 15:43:16 - [info] Linux 4.4.0-45-generic x64 LE
[APP/0]      OUT 18 Jan 15:43:16 - [info] Loading palette nodes
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibm hdfs in] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibm hdfs] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibmpush] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:20 - [info] Settings file  : /home/vcap/app/bluemix-settings.js
[APP/0]      OUT 18 Jan 15:43:20 - [info] Server now running at http://127.0.0.1:`**1880**`/red/
[APP/0]      OUT 18 Jan 15:43:20 - [info] Starting flows
[APP/0]      OUT 18 Jan 15:43:20 - [info] Started flows
[CELL/0]     ERR Timed out after 1m0s: health check never passed.
[CELL/0]     OUT Exit status 0
[CELL/0]     OUT Destroying container
[API/8]      OUT App instance exited with guid ca3f2bbd-ac6e-42ec-8a61-1ff704274c3e payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* Exited with status 4\n* 2 error(s) occurred:\n\n* cancelled\n* process did not exit", "crash_count"=>2, "crash_timestamp"=>1484754267594231230, "version"=>"0361fa77-694c-4e8f-991e-0c52dd0c4c87"}

如何解决此问题?

问题在于,应用程序查找要绑定到的端口的方式随着Diego的改变而改变。默认情况下,不再填充VCAP_APP_PORT环境变量。要修复它,您需要为您的应用程序创建git回购(概述选项卡->连续交付->添加git)。使用jazzhub编辑bluemix-settings.js文件以进行更改

uiPort:process.env.VCAP_APP_端口

uiPort:process.env.PORT


部署这些更改,应用程序应该启动。

问题是,应用程序查找要绑定到的端口的方式随着Diego的改变而改变。默认情况下,不再填充VCAP_APP_PORT环境变量。要修复它,您需要为您的应用程序创建git回购(概述选项卡->连续交付->添加git)。使用jazzhub编辑bluemix-settings.js文件以进行更改

uiPort:process.env.VCAP_APP_端口

uiPort:process.env.PORT


部署这些更改,应用程序应该启动。

我在npm express应用程序中遇到了类似的问题,并在无需编辑bluemix-settings.js文件的情况下修复了它

只需删除对process.env.VCAP_APP_主机的所有引用(不再是Diego中的引用),并将process.env.VCAP_APP_端口更改为process.env.PORT

比如说,

var host = 'localhost';
var port = (process.env.PORT || 1337); 
app.listen(port, host); 
console.log('App started on port ' + port);
您可以通过键入以下内容来检查您的应用程序是否正在运行Diego:

cf has-diego-enabled APPNAME
安装diego cli工具后

cf install-plugin Diego-Enabler -r CF-Community
我还禁用了健康检查:

cf set-health-check APPNAME none

我在一个npm express应用程序中遇到了类似的问题,并且在不编辑bluemix-settings.js文件的情况下修复了它

只需删除对process.env.VCAP_APP_主机的所有引用(不再是Diego中的引用),并将process.env.VCAP_APP_端口更改为process.env.PORT

比如说,

var host = 'localhost';
var port = (process.env.PORT || 1337); 
app.listen(port, host); 
console.log('App started on port ' + port);
您可以通过键入以下内容来检查您的应用程序是否正在运行Diego:

cf has-diego-enabled APPNAME
安装diego cli工具后

cf install-plugin Diego-Enabler -r CF-Community
我还禁用了健康检查:

cf set-health-check APPNAME none