赤色烙印 发表于 2015-7-11 04:17:50

ModoDB 安装

#建立数据目录
$ mkdir -p /data/db


#下载压缩包
#定位安装目录 $ cd /home/apps/
$ curl -O http://downloads.mongodb.org/linux/mongodb-linux-i686-1.3.3.tgz


#解压缩文件
$ tar xzf mongodb-linux-i686-1.3.3.tgz


#启动服务
$ ./mongodb-linux-i686-1.3.3/bin/mongod &


#运行 mongo shell
$ ./mongodb-linux-i686-1.3.3/bin/mongo
>db.foo.save({ a : 1 } )
>db.foo.findOne()  
  #关闭防火墙
  1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop   
  #检查端口
  netstat -an -t|grep 27017
netstat -an -t|grep 28017
  
  另外:
  #把mongodb/bin添加到PATH里,这样就可以在任意位置运行mongod和mongo了
  $ export PATH="/home/apps/mongodb-linux-i686-1.3.3/bin:$PATH"
  
  相关文档
  
页: [1]
查看完整版本: ModoDB 安装