node-inspector无法连接到debian上的运行节点

时间:2014-08-07 13:15:19

标签: node.js node-inspector countly-analytics

我无法获取node-inspector网页网址来显示节点源代码的来源。

这是我如何开始节点:

root@mitendebian:/opt/software/countly# service supervisor start
Starting supervisor: --nodaemon --configuration /opt/software/countly/bin/config/supervisord.conf2014-08-07 18:07:52,036 CRIT Set uid to user 0
2014-08-07 18:07:52,061 INFO RPC interface 'supervisor' initialized
2014-08-07 18:07:52,061 WARN cElementTree not installed, using slower XML parser for XML-RPC
2014-08-07 18:07:52,061 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-08-07 18:07:52,066 INFO supervisord started with pid 6332
2014-08-07 18:07:53,070 INFO spawned: 'countly-dashboard' with pid 6333
2014-08-07 18:07:53,071 INFO spawned: 'countly-api' with pid 6334
2014-08-07 18:07:53,093 DEBG 'countly-api' stdout output:
debugger listening on port 8087

2014-08-07 18:07:53,102 DEBG 'countly-dashboard' stdout output:
debugger listening on port 8086

2014-08-07 18:07:54,103 INFO success: countly-dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:07:54,103 INFO success: countly-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:29:40,526 DEBG fd 7 closed, stopped monitoring <POutputDispatcher at 170156780 for <Subprocess at 170010188 with name countly-dashboard in state RUNNING> (stdout)>
2014-08-07 18:29:40,528 INFO exited: countly-dashboard (terminated by SIGUSR1; not expected)
2014-08-07 18:29:40,529 DEBG received SIGCLD indicating a child quit
2014-08-07 18:29:41,532 INFO spawned: 'countly-dashboard' with pid 6528
2014-08-07 18:29:41,585 DEBG 'countly-dashboard' stdout output:
debugger listening on port 8086

2014-08-07 18:29:42,585 INFO success: countly-dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-08-07 18:29:43,060 DEBG fd 10 closed, stopped monitoring <POutputDispatcher at 170225580 for <Subprocess at 170010252 with name countly-api in state RUNNING> (stdout)>
2014-08-07 18:29:43,061 INFO exited: countly-api (terminated by SIGUSR1; not expected)
2014-08-07 18:29:43,061 DEBG received SIGCLD indicating a child quit
2014-08-07 18:29:44,064 INFO spawned: 'countly-api' with pid 6536
2014-08-07 18:29:44,069 DEBG 'countly-api' stdout output:
debugger listening on port 8087

2014-08-07 18:29:45,071 INFO success: countly-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

然后我启动node-inspector:

root@mitendebian:/opt/software/countly/bin# Node Inspector v0.7.4
Visit http://localhost:8080/debug?port=5858 to start debugging.

root@mitendebian:/opt/software/countly/bin# ps -ef | grep node
root      6333  6332  0 18:07 pts/6    00:00:00 node --debug=8086 /opt/software/countly/bin/config/../../frontend/express/app.js
root      6334  6332  0 18:07 pts/6    00:00:00 node --debug=8087 /opt/software/countly/bin/config/../../api/api.js
root      6382  5518  0 18:12 pts/5    00:00:00 node /usr/local/bin/node-inspector
root      6527  5518  0 18:29 pts/5    00:00:00 grep node

root@mitendebian:/opt/software/countly/bin# kill -s USR1 6333
root@mitendebian:/opt/software/countly/bin# kill -s USR1 6334

root@mitendebian:/opt/software/countly/bin# ps -ef | grep node
root      6382  5518  0 18:12 pts/5    00:00:00 node /usr/local/bin/node-inspector
root      6528  6332 14 18:29 pts/6    00:00:00 node --debug=8086 /opt/software/countly/bin/config/../../frontend/express/app.js
root      6536  6332 18 18:29 pts/6    00:00:00 node --debug=8087 /opt/software/countly/bin/config/../../api/api.js
root      6544  5518  0 18:29 pts/5    00:00:00 grep node

root@mitendebian:/opt/software/countly/api# node --version
v0.10.29


root@mitendebian:/opt/software# npm -g ls
/usr/local/lib
├─┬ node-inspector@0.7.4
│ ├── async@0.8.0
│ ├── debug@0.8.1
│ ├─┬ express@4.0.0
│ │ ├─┬ accepts@1.0.0
│ │ │ ├── mime@1.2.11
│ │ │ └── negotiator@0.3.0
│ │ ├── buffer-crc32@0.2.1
│ │ ├── cookie@0.1.0
│ │ ├── cookie-signature@1.0.3
│ │ ├── escape-html@1.0.1
│ │ ├── fresh@0.2.2
│ │ ├── merge-descriptors@0.0.2
│ │ ├── methods@0.1.0
│ │ ├── parseurl@1.0.1
│ │ ├── path-to-regexp@0.1.2
│ │ ├── qs@0.6.6
│ │ ├── range-parser@1.0.0
│ │ ├─┬ send@0.2.0
│ │ │ └── mime@1.2.11
│ │ ├─┬ serve-static@1.0.1
│ │ │ └─┬ send@0.1.4
│ │ │   ├── fresh@0.2.0
│ │ │   ├── mime@1.2.11
│ │ │   └── range-parser@0.0.4
│ │ ├─┬ type-is@1.0.0
│ │ │ └── mime@1.2.11
│ │ └── utils-merge@1.0.0
│ ├─┬ glob@3.2.11
│ │ ├── inherits@2.0.1
│ │ └─┬ minimatch@0.3.0
│ │   ├── lru-cache@2.5.0
│ │   └── sigmund@1.0.0
│ ├── opener@1.3.0
│ ├─┬ rc@0.3.5
│ │ ├── deep-extend@0.2.11
│ │ ├── ini@1.1.0
│ │ └── minimist@0.0.10
│ ├─┬ strong-data-uri@0.1.1
│ │ └── truncate@1.0.2
│ ├── which@1.0.5
│ ├─┬ ws@0.4.32
│ │ ├── commander@2.1.0
│ │ ├── nan@1.0.0
│ │ ├── options@0.0.5
│ │ └── tinycolor@0.0.1
│ └─┬ yargs@1.2.6
│   └── minimist@0.1.0

根据网上的信息,我在访问http://mylocalhost.com:8080/debug?port=5858时会看到它应该向我显示来源。我没看见他们。我用mylocalhost.com替换了127个数字IP地址,因为stackoverflow给出了一些错误。

1 个答案:

答案 0 :(得分:2)

请注意,您要告知节点检查员在端口5858上进行连接,但您的应用程序不会在该端口上公开调试器。