Python MONGO environment installation, notes

Source: Internet
Author: User
Tags install mongodb mongodb
Address: Http://blog.csdn.net/hujkay
Author: Jekkay Hu (34538980@qq.com)
Tags: Eclipse, Pydev, Python,mongodb

Time: 2013/11/27


One • installation MONGO 1.1 Installation Package Installation 1. Download the package from following URL.
Http://www.mongodb.org/downloads
2. Install Mongodb
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/

1.2 Online installation using Apt-get installation Mongodb

sudo apt-key adv--keyserver keyserver.ubuntu.com--recv 7f0ceb10
echo "Deb http://downloads-distro.mongodb.org/ Repo/ubuntu-upstart Dist 10gen "| sudo tee--append/etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install Mongodb-10gen

two • installation Pymongo 2.1 Install PymongoEasy_install Pymongo


three · MONGO Quick Manual 3.1Start MongoDBMongod--dbpath=/data/mongodb/--logpath=/var/log/mongodb.log--logappend
Default port:27017
Default HTTP port:28017


Start MongoDB via config file:
1.1 Conf file/etc/xxxx.conf content:
dbpath=/data/mongodb/
Logpath=/var/log/mongodb.log
1.2 Start
Mongod-f/etc/xxxx.conf
Backed daemon startup, add args--fork:
Mongod--dbpath=/data/mongodb/--logpath=/var/log/mongodb.log--fork--logappend
Mongod--dbpath=/data/mongodb/--logpath=/var/log/mongodb.log--logappend


Repaire the database if corrupt
Mongod--dbpath=/data/mongodb/--logpath=/var/log/mongodb.log--repair




3.2 Stop1 Ctrl + D in console
2 Connect MongoDB, and send Db.shutdownserver () to admin database
3 ' kill-2 pid ', or ' kill-15 pid ', don't use ' kill-9 pid '


Four · GUI Manager1 PHP Admin
http://rockmongo.com/
2 Mongovue
http://www.mongovue.com/
3 Rock Mongo
http://code.google.com/p/rock-php


Five · Other
1 store func
Db.system.js.save ({"_id": Addnumber, "value": function f (x,y) {return x+y;}})
Db.eval (' Addnumber (3,4) ')


Populus euphratica, Jekkay Hu

2013-11-27

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.