设为首页 加入收藏

TOP

MongoDB的master-slave及replset测试
2015-11-21 01:36:32 来源: 作者: 【 】 浏览:1
Tags:MongoDB master-slave replset 测试
1、masterslave截图 master配置文件: dbpath=../data_test/db/master
logpath=../data_test/master.log
port=8642
logappend=true
oplogSize=2048
storageEngine=wiredTiger
nojournal=true
slave配置文件: dbpath=../data_test/db/slave
logpath=../data_test/slave.log
port=8643
logappend=true
oplogSize=2048
storageEngine=wiredTiger
nojournal=true
slave=true
source=127.0.0.1:8642
slavedelay=10
autoresync=true 启动mater及结果: \ \
\
启动slave及结果: \ \
\
master上: \
\ slave上: \
\ 2、副本集测试(s1_1,s2_1,s3_1) s1_1配置文件: dbpath=../data/db/s1_1
logpath=../data/s1_1.log
port=8442
shardsvr=true
replSet=shard1
logappend=true
oplogSize=2048
storageEngine=wiredTiger
nojournal=true
s2_1配置文件: dbpath=../data/db/s2_1
logpath=../data/s2_1.log
port=8542
shardsvr=true
replSet=shard1
logappend=true
oplogSize=2048
storageEngine=wiredTiger
nojournal=true
s3_1配置文件: dbpath=../data/db/s3_1
logpath=../data/s3_1.log
port=8642
shardsvr=true
replSet=shard1
logappend=true
oplogSize=2048
storageEngine=wiredTiger
nojournal=true
启动文件: start mongod.exe --config=../config/m1/s1_1 start mongod.exe --config=../config/m2/s2_1 start mongod.exe --config=../config/m3/s3_1 配置副本集: use admin config = {_id: 'shard1', members:[{_id:0, host: 'localhost:8442'},{_id:1, host:'localhost:8542'},{_id:2, host:'localhost:8642',slaveDelay:7200,priority:0}]}; 主节点: \
从节点: \

?

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇数据库优化-基准测试(四) 下一篇欢迎使用CSDN-markdown编辑器

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: