MongoDB安装及复制集搭建
安装 wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.6.tgz tar zxvf mongodb-linux-x86_64-2.2.6.tgz mv mongodb-linux-x86_64-2.2.6 mongodb cd mongodb mkdir log # 添加日志文件目录 mkdir data # 添加数据目录 mkdir conf # 添加配置文件目录 mkdir arbiter # 添加仲裁服务目录 配置文件 进入 mongodb 下的 conf 目录 新建 mongod.conf 编辑 mongod.conf ,在其中添加如下内容: # mongod.conf logpath = /data/mongodb/log/mongod.log # 日志输出目录 logappend = true # 如果为 false 日志会覆盖 fork = true # true 为后台运行 quiet = true # 安静输出 port = 27017 # 端口 maxConns = 1024 # 最大连接数 directoryperdb = true # 是否按数据库分目录存放数据 dbpath = /data/mongodb/data # 数据目录 autoresync = true #