MongoDB is not installed properly on Ubuntu 11.04 in Amazon EC2

匆匆过客 提交于 2019-12-23 03:24:29

问题


I'm trying to install MongoDB on my Ubuntu 11.04 AMI in Amazon EC2.

I allowed 27017 port in security option.

The problem is that I can use "mongo OTHER IP ADDRESS" to access to other mongoDB.

But simply "mongo" does not simply give me access to localhost mongoDB.

mongoDB shell shows like it is about to work but it stops at

MongoDB shell version: 1.8.3
connecting to: test

If it is truly connected, it should give me ">" but it doesn't and freezes.

I couldn't find answer on freezing problem by googling myself.

Also any tips on running mongoDB as daemon or running in background?


回答1:


Be sure to use 0.0.0.0 as the IP in the security group. This will include your public IP and localhost IP. If this is not the issue, try this for debugging.

See what interface or IP range mongo is listening on: netstat -pan | grep mongod

I imagine that it's listening on your public IP address (OTHER IP ADDRESS as you call it). If this is the case, try starting mongod without bind_ip. If you didn't specify the bind_ip argument then it's probably something related to EC2.

Another test: Try telnet localhost 27017 (hit Ctrl-], type quit to quit). This should also fail because this is the same thing the mongo client is doing.



来源:https://stackoverflow.com/questions/7351889/mongodb-is-not-installed-properly-on-ubuntu-11-04-in-amazon-ec2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!