标签:member mongo for baidu 配置文件 log nfs ofo 安装
1.自启动脚本slave1.conf
dbpath=/home/data/mongodbdata/slave1/
logpath=/usr/local/mongodb/logs/slave1.log
logappend=true
port=27017
fork=true
replSet=tonghao
slave2.conf
dbpath=/home/data/mongodbdata/slave2
logpath=/usr/local/mongodb/logs/slave2.log
logappend=true
port=27016
fork=true
replSet=tonghao
3.集群config配置
./mongo
use admin
config = {"_id" : "tonghao", "members" : [ {"_id" : 0, "host" : "10.2.42.101:27017"},{"_id" : 1, "host" : "10.2.40.104:27017"},{"_id" : 2, "host":"10.2.40.104:27016"},]}
rs.initiate(config);
//重新配置参数命令
rs.reconfig(config, {force: true})
MongoDB离线安装包下载地址如下:
https://pan.baidu.com/s/1Zu7DogO-S7ReeJvVcUAAFw,密码:9lfy
标签:member mongo for baidu 配置文件 log nfs ofo 安装
原文地址:http://blog.51cto.com/zhaoanan/2312261