NodeJS v5.7.0 is with mongodb driver 2.1.2 used on CentOS6. Many times I get the following error trying to boot my nodejs server:
[2016-03-05 17:33:01.355] [INFO] [default] - TestGM online
Connecting to DB...
/home/beryllium/sitesrv/node_modules/mongodb/lib/mongo_client.js:415
throw err
^
AssertionError: null == { [MongoError: getaddrinfo ENOTFOUND XXX.com XXX.com:27017]
name: 'MongoError',
message: 'ge
at /home/beryllium/sitesrv/server.js:53:10
at /home/beryllium/sitesrv/node_modules/mongodb/lib/mongo_client.js:412:11
at _combinedTickCallback (node.js:370:9)
at process._tickCallback (node.js:401:11)
[beryllium@njs sitesrv]$
where XXX.com runs MongoDB v3.2.
The nslookup
and curl
have no problems resolving IP for XXX.com.
What can be a problem?
EDIT
When I connect from the same machine/account where nodejs runs with mongo shell to the same server as Node cannot connect to, there is no problem:
mongo -u ZZZZ -p YYYY XXX.com/logs
MongoDB shell version: 3.2.3
connecting to: XXX.com/logs
Server has startup warnings:
...
...