MongoDB

MacOS安装Mongo

  1. 官方网站下载对一个Mac安装包
  2. 解压到本地目录下
  3. 创建一个配置文件,例如 /etc/mongod.conf , set the dbpath to your preferred path.

    # This is an example config file for MongoDB.
    dbpath = /var/lib/mongodb
    bind_ip = 127.0.0.1
    noauth = true # use 'true' for options that don't take an argument
    verbose = true # to disable ...
more ...

Ubuntu 下安装 MongoDB

环境

  • Ubuntu: 12.04.1
  • MongoDB: 2.2.2

安装

修改/etc/apt/sources.list

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

运行一下命令:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo apt-get update
sudo apt-get install mongodb-10gen

配置

MongoDB主要的文件位置

  • 配置文件: /etc/mongodb.conf
  • 启动脚本: /etc/init ...
more ...