首页 > 数据库技术 > 详细

MongoDB的mater-slave及replset测试

时间:2015-07-25 12:19:42      阅读:339      评论:0      收藏:0      [点我收藏+]
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}]};
主节点:
技术分享
从节点:
技术分享

版权声明:本文为博主原创文章,未经博主允许不得转载。

MongoDB的mater-slave及replset测试

原文:http://blog.csdn.net/hanyueqi/article/details/47054713

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!