简体   繁体   English

试图在Debian上设置Mongodb

[英]Trying to setup Mongodb on Debian

I am trying to setup the database client MongoDB and am running into some problems getting it to startup. 我正在尝试设置数据库客户端MongoDB,并遇到一些问题,让它启动。

What I have done: 我做了什么:

Unfortunately when I try to run mongod I get command not found . 不幸的是,当我尝试运行mongodcommand not found Any reason why I might be failing at this part of the process? 我可能在这个过程中失败的原因是什么?

只是解开存档不会安装它..您必须转到mongodb目录并运行./bin/mongod来运行服务器..

I think you did not scroll all the way down on the download page and took the first linux version that was there. 我认为你没有在下载页面上一直向下滚动并采用了那里的第一个linux版本。 Here is the link that will help you install mongodb from APT it works really well. 这是帮助您从APT安装mongodb的链接,它非常有效。 http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages

Try this: 试试这个:

# apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
# echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list
# apt-get update
# apt-get install -y mongodb-org

To start MongoDB: 要启动MongoDB:

# /etc/init.d/mongod start

There is a debian package for mongodb . mongodb有一个debian包。 so just run apt-get install mongodb in terminal. 所以只需在终端中运行apt-get install mongodb

If version 2.0 of Mongodb is sufficient, the easiest way to install it on Debian squeeze is by: 如果Mongodb的2.0版本已经足够,那么在Debian squeeze上安装它的最简单方法是:

$ sudo echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get -t squeeze-backports install mongodb mongodb-clients mongodb-dev mongodb-server

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 . 重要的(在这种情况下)明确地包括mongodb的依赖包,如上所示,或者您可能会遇到来自mongodb服务器的神秘行为 - 这里有更多信息。

在Debian上安装和配置MongoDB的简单方法是从APT包中查看Ubuntu和Debian软件包的官方文档,以获得分步说明。

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. 但是,我只是在解压缩后自己解决了这个问题,结果发现这是我最初执行tar xzf时的权限问题。

When in the bin folder I was getting this: 在bin文件夹中我得到了这个:

$ mongod
-sh: mongod: not found

What I wound up doing was this: 我最后做的是这样的:

sudo chown -R $USERNAME:$USERNAME /mongodb-linux-x86_64-2.0.0/bin
sudo chown -R $USERNAME:$USERNAME /data/db
cd mongodb-linux-x86_64-2.0.0
sudo bin/mongod

and VOILA! 和VOILA!

Wed Oct  5 22:46:59 [initandlisten] MongoDB starting : pid=3049 port=27017  
dbpath=/data/db/ 64-bit host=MyRackspaceRandomProject
Wed Oct  5 22:46:59 [initandlisten] db version v2.0.0, pdfile version 4.5

Hopefully this helps a little more. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM