在Amazon EC2的Ubuntu 11.04上未正确安装MongoDB [英] MongoDB is not installed properly on Ubuntu 11.04 in Amazon EC2

查看:165
本文介绍了在Amazon EC2的Ubuntu 11.04上未正确安装MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Amazon EC2的Ubuntu 11.04 AMI上安装MongoDB.

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

我在安全选项中允许27017端口.

I allowed 27017 port in security option.

问题是我可以使用"mongo OTHER IP ADDRESS"访问其他mongoDB.

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

但是简单地"mongo"并不能简单地使我能够访问localhost mongoDB.

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

mongoDB shell显示它即将开始工作,但在

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.

关于将mongoDB作为守护程序运行或在后台运行的任何技巧?

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

推荐答案

请确保将0.0.0.0用作安全组中的IP.这将包括您的公共IP和本地IP.如果这不是问题,请尝试进行调试.

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.

查看mongo在监听什么接口或IP范围: netstat -pan | grep mongod

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

我想它正在监听您的公共IP地址(您称呼它为其他IP地址").如果是这种情况,请尝试在不使用bind_ip的情况下启动mongod.如果未指定bind_ip参数,则可能与EC2有关.

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.

另一项测试: 尝试telnet localhost 27017(按Ctrl-],键入quit退出).这也应该失败,因为这与mongo客户端正在做的事情相同.

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.

这篇关于在Amazon EC2的Ubuntu 11.04上未正确安装MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆