我今天正在开发我的OpenShift应用程序,在没有更改与mongodb连接相关的任何内容的情况下,我开始收到以下消息:
/opt/app-root/src/node_modules/mongodb/lib/server.js:242
process.nextTick(function() { throw err; })
^
Error: connect EHOSTUNREACH 172.30.173.215:27017
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
npm info lifecycle bolao_2018@0.1.0~start: Failed to exec start script
npm ERR! Linux 3.10.0-693.21.1.el7.x86_64
npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "run" "-d" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! bolao_2018@0.1.0 start: `node main`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bolao_2018@0.1.0 start script 'node main'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bolao_2018 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node main
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bolao_2018
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bolao_2018
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/app-root/src/npm-debug.log
唯一不同的是,我看到出于某种原因mongodb服务尝试了一个新的部署并失败了,所以我手动运行了一个。
我还注意到它试图连接的IP地址是mongodb的集群IP,但是当前运行的pod的节点IP是不同的。
有人能帮我弄清楚是什么触发了连接断开吗?
谢谢
在给定的Project
范围内,指向主机名“mongodb”的请求应路由到名为“mongodb”的库伯内特斯服务
(如果可用)。
要调试此连接问题,请执行以下操作:
env
以列出前端可用的环境变量。如果此容器是在创建“mongodb”服务后启动的,则配置字符串应该在环境中可见HOST:$MONGODB_SERVICE_PORT
以验证 mongodb
服务的可用性