我试图将我的应用程序启动到Heroku上,并且在几个地方挂断了。 我已经使用' node.js'设置了应用。提供的流程,并使用插件Redis Cloud,'但它正在挂断。
使用heroku logs --tail
我收到一长串错误消息,但大多数都是来自我没有写过或触摸过的node_modules。
类似于此的错误发生了几(3)次,但它的一般结构是:
2015-04-22T22:36:03.497059+00:00 heroku[web.1]: State changed from crashed to starting
2015-04-22T22:36:05.119390+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-04-22T22:36:06.597719+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-04-22T22:36:06.597695+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-04-22T22:36:07.093093+00:00 app[web.1]: events.js:72
2015-04-22T22:36:07.093394+00:00 app[web.1]: ^
2015-04-22T22:36:07.092975+00:00 app[web.1]:
2015-04-22T22:36:07.095896+00:00 app[web.1]: at process._tickCallback (node.js:442:13)
2015-04-22T22:36:07.095887+00:00 app[web.1]: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2015-04-22T22:36:07.095890+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:196:24)
2015-04-22T22:36:07.095891+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/redis/index.js:106:14)
2015-04-22T22:36:07.095894+00:00 app[web.1]: at net.js:441:14
2015-04-22T22:36:07.095893+00:00 app[web.1]: at Socket.emit (events.js:95:17)
2015-04-22T22:36:07.093363+00:00 app[web.1]: throw er; // Unhandled 'error' event
2015-04-22T22:36:07.090979+00:00 app[web.1]: listening on *:15286
2015-04-22T22:36:07.894314+00:00 heroku[web.1]: State changed from crashed to starting
2015-04-22T22:36:07.893549+00:00 heroku[web.1]: State changed from starting to crashed
2015-04-22T22:36:07.878999+00:00 heroku[web.1]: Process exited with status 8
2015-04-22T22:36:09.837516+00:00 heroku[web.1]: Starting process with command `node app.js`
2015-04-22T22:36:11.600503+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-04-22T22:36:11.600483+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-04-22T22:36:12.312046+00:00 app[web.1]:
2015-04-22T22:36:12.312797+00:00 app[web.1]: throw er; // Unhandled 'error' event
2015-04-22T22:36:12.320402+00:00 app[web.1]: at Socket.emit (events.js:95:17)
2015-04-22T22:36:12.320405+00:00 app[web.1]: at process._tickCallback (node.js:442:13)
2015-04-22T22:36:12.320394+00:00 app[web.1]: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2015-04-22T22:36:12.320398+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:196:24)
2015-04-22T22:36:12.320400+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/redis/index.js:106:14)
2015-04-22T22:36:12.320403+00:00 app[web.1]: at net.js:441:14
2015-04-22T22:36:12.312260+00:00 app[web.1]: events.js:72
2015-04-22T22:36:12.308956+00:00 app[web.1]: listening on *:15286
2015-04-22T22:36:12.313581+00:00 app[web.1]: ^
2015-04-22T22:36:13.172938+00:00 heroku[web.1]: State changed from starting to crashed
2015-04-22T22:36:13.163265+00:00 heroku[web.1]: Process exited with status 8
还有一些其他错误可能会或可能不会被捆绑,但它们含糊不清(code=H10
似乎只是表明存在问题......而不是它是什么。)
2015-04-22T14:57:01.110155+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=appName.herokuapp.com request_id=2b8587e3-f519-45e7-bb9f-5f0953e9440a fwd="50.150.70.220" dyno= connect= service= status=503 bytes=
2015-04-22T14:57:02.558241+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=appName.herokuapp.com request_id=d0e44873-30cb-4a34-94ed-bcc754927dd7 fwd="50.150.70.220" dyno= connect= service= status=503 bytes=
2015-04-22T21:47:17.963341+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=appName.herokuapp.com request_id=d320b50b-0926-4de7-83d0-a9a4208fb6c5 fwd="38.140.30.202" dyno= connect= service= status=503 bytes=
2015-04-22T21:47:19.564687+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=appName.herokuapp.com request_id=9307e6c0-2731-438d-abae-9266634b05ba fwd="38.140.30.202" dyno= connect= service= status=503 bytes=
那么,这是否足以确定这是为什么/应用程序挂断的原因?
答案 0 :(得分:0)
鉴于此:
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
建议您的代码尝试建立与本地Redis服务器的连接。在Heroku上使用Redis Cloud时,您需要打开与Redis数据库的连接,其端点和密码存储在REDISCLOUD_URL
env var。