在下载和安装运行时(etcd-)集线器和代理之后,我启动了集线器和代理,并使用超级简单的nodejs webserver和nsolid测试了配置:
nsolid-cli --socket 40437 info给我
{
"id": "0f2a54e6dba5dfe3970ff14999aba88518dca924",
"app": "TESTAPP",
"tags": [],
"pid": 1565,
"nodeEnv": "production",
"execPath": "/opt/nsolid/bin/nsolid",
"main": "/home/someuser/testserver.js"
}然而,当启动nsolid-控制台时,nsolid代理就会死掉,从而引发
TypeError: Cannot read property 'indexOf' of undefined
at Router.proxy (/opt/nsolid-proxy/router.js:59:18)
at emitThree (events.js:97:13)
at Listener.emit (events.js:175:7)
at Concat.callback (/opt/nsolid-proxy/node_modules/nsolid-listener/listener.js:138:32)
at Concat._done (/opt/nsolid-proxy/node_modules/nsolid-listener/concat.js:47:19)
at emitNone (events.js:72:20)
at Concat.emit (events.js:166:7)
at finishMaybe (_stream_writable.js:468:14)
at endWritable (_stream_writable.js:478:3)
at Concat.Writable.end (_stream_writable.js:443:5)
Shutting down hub下面是nsolid控制台在使用NODE_DEBUG=nsolid运行时输出的内容:
NSOLID 6132: registering default commands
NSOLID 6132: nsolid initializing
NSOLID 6132: nsolid initialized on port 45918
> nsolid-console@1.4.4 start /opt/nsolid-console
> NODE_ENV=production node bin/nsolid-console --interval=1000
NSOLID 6143: registering default commands
NSOLID 6143: nsolid initializing
Server running on http://0.0.0.0:3000
NSOLID 6143: nsolid initialized on port 37954
NSOLID 6143: sending http://localhost:9000/info
POLLING ERROR: socket hang up
NSOLID 6143: sending http://localhost:9000/system_info
POLLING ERROR: connect ECONNREFUSED 127.0.0.1:9000我试着设置代理来侦听127.0.0.1:9000和0.0.0:9000,以及使用localhost等。
编辑
下面是nsolid-控制台目录中的.nsolid-proxyrc:
{
"registry": "localhost:4001",
"port": 9000,
"denied": [],
"broadcast_approved": [
"ping",
"process_stats",
"system_stats",
"system_info",
"info",
"versions",
"startup_times"
]
}发布于 2016-02-18 15:40:37
您的nsolid配置文件似乎有问题,请检查nsolid-proxy文件夹中的.nsolid-proxyrc文件,默认配置文件应该如下所示:
{
"registry": "localhost:4001",
"port": 9000,
"denied": [],
"broadcast_approved": [
"ping",
"process_stats",
"system_stats",
"system_info",
"info",
"versions",
"startup_times"
]
}检查denied属性,它应该是一个数组。
https://stackoverflow.com/questions/35484746
复制相似问题