python Mongo環境安裝,筆記

來源:互聯網
上載者:User
地址: http://blog.csdn.net/hujkay
作者:Jekkay Hu(34538980@qq.com)
關鍵詞:Eclipse, pydev, python,mongodb

時間: 2013/11/27


一·安裝Mongo   1.1  安裝包安裝 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 線上安裝    利用apt-get 安裝 Mongodb
   

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee --append /etc/apt/sources.list.d/10gen.listsudo apt-get updatesudo apt-get install mongodb-10gen

二· 安裝pymongo     2.1 install pymongo          easy_install pymongo


三· Mongo速成手冊    3.1Start mongodb  mongod --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  stop    1 Ctrl + D in console
   2 connect mongodb, and send db.shutdownServer() to admin database
   3 'kill -2 PID', or 'kill -15 PID', do not use 'kill -9 PID'


四·GUI manager    1 php admin
       http://rockmongo.com/
   2 MongoVUE
       http://www.mongovue.com/
   3 Rock Mongo
       http://code.google.com/p/rock-php


五· 其他  
    1 store func
        db.system.js.save({"_id":addnumber,"value":function f(x,y){return x+y ;}})
        db.eval('addnumber(3,4)')


胡楊, Jekkay Hu

2013-11-27

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.