尝试在 Debian 上设置 Mongodb
我正在尝试设置数据库客户端 MongoDB,但在启动时遇到一些问题。
我所做的:
我从 http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.0.tgz
我提取了它(
tar xzf
)。然后我运行命令
mkdir /data/db
不幸的是,当我尝试运行 mongod
我得到找不到命令
。我可能在这部分过程中失败的原因是什么?
I am trying to setup the database client MongoDB and am running into some problems getting it to startup.
What I have done:
I downloaded the 2.0 version of mongoDB from http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.0.tgz
I extracted it (
tar xzf
).I then ran the command
mkdir /data/db
Unfortunately when I try to run mongod
I get command not found
. Any reason why I might be failing at this part of the process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我想你并没有在下载页面上一直向下滚动并获取那里的第一个 Linux 版本。这是帮助您从 APT 安装 mongodb 的链接,它运行得非常好。 http://www.mongodb.org/display/DOCS/Ubuntu+and +Debian+软件包
I think you did not scroll all the way down on the download page and took the first linux version that was there. Here is the link that will help you install mongodb from APT it works really well. http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
仅解压存档并不会安装它。您必须转到 mongodb 目录并运行
./bin/mongod
才能运行服务器。Just untaring an archive doesn't install it.. You have to go to the mongodb directory and run
./bin/mongod
to run the server..试试这个:
启动 MongoDB:
Try this:
To start MongoDB:
有一个用于
mongodb
的debian
软件包。所以只需在终端中运行 apt-get install mongodb 即可。There is a
debian
package formongodb
. so just runapt-get install mongodb
in terminal.在 Debian 上安装和配置 MongoDB 的一种简单方法是使用 APT 包,请查看官方文档 Ubuntu 和 Debian 软件包 了解分步说明。
An easy way to install and configure MongoDB on Debian is from the APT package, check out the official docs for Ubuntu and Debian packages for step-by-step instructions.
我知道我参加聚会有点晚了,因为答案已经被检查过,但我通常不喜欢做包裹路线,因为我过去因为过时的包裹而运气不好。然而,我自己解压后就遇到了这个问题,结果发现这是我最初执行 tar xzf 时的权限问题。
当我在 bin 文件夹中时,我得到了这个:
我最后做的是这个:
瞧!
希望这能有所帮助。
I know I'm a bit late to the party as an answer has been checked but I generally don't like doing the packages route because I've had bad luck with out of date ones in the past. However, I just hit this issue myself after unzipping and it turned out to be a permissions issue from when I initially did the tar xzf.
When in the bin folder I was getting this:
What I wound up doing was this:
and VOILA!
Hopefully this helps a little more.
如果 Mongodb 2.0 版本就足够了,那么在 Debian squeeze 上安装它的最简单方法是:(
在本例中)明确包含 mongodb 的依赖包(如上所示)非常重要,否则您可能会遇到来自 mongodb 服务器的神秘行为 - 更多信息<一href="https://stackoverflow.com/questions/15552663/odd-results-from-mongoid-using-debian-squeeze-mongodb">此处。
If version 2.0 of Mongodb is sufficient, the easiest way to install it on Debian squeeze is by:
It's important (in this case) explicitly to include mongodb's dependency packages as shown above, or you may experience mysterious behavior from the mongodb server—more information here.