0
[email protected]:~/cse303.p2$ node qloader.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: failed to connect to [52.33.215.205:27017]
at null.<anonymous> (/home/ubuntu/cse303.p2/node_modules/mongoose/node_modules/mongodb/lib/mong odb/connection/server.js:556:74)
at EventEmitter.emit (events.js:106:17)
at null.<anonymous> (/home/ubuntu/cse303.p2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
at EventEmitter.emit (events.js:98:17)
at Socket.<anonymous> (/home/ubuntu/cse303.p2/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:415:13)
上面是我在嘗試執行'node'來運行我的數據庫時得到的錯誤消息。Ubuntu不能使用節點運行mongod數據庫
我已將所有安全組設置爲「所有流量」,我想這對我的安全組不是問題。
當我ping那個ip地址它可以連接,這是什麼顯示。
[email protected]:~/cse303.p2$ ping 52.33.215.205
PING 52.33.215.205 (52.33.215.205) 56(84) bytes of data.
64 bytes from 52.33.215.205: icmp_seq=1 ttl=63 time=1.37 ms
64 bytes from 52.33.215.205: icmp_seq=2 ttl=63 time=1.27 ms
64 bytes from 52.33.215.205: icmp_seq=3 ttl=63 time=1.21 ms
64 bytes from 52.33.215.205: icmp_seq=4 ttl=63 time=1.25 ms
^C
--- 52.33.215.205 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.218/1.281/1.376/0.072 ms
所以它可以連接到該地址,但是當我添加該端口27017時,它不起作用。
[email protected]:~/cse303.p2$ ping 52.33.215.205:27017
ping: unknown host 52.33.215.205:27017
我不確定我的mongod是否正常運行,這就是我得到的。
[email protected]:~$ sudo service mongodb start
mongodb start/running, process 1382