Tag Archives: nosql

How to change oplog size — mongo

主要两种方法 :
1.轮流改变oplog size (from primary to secondary)


Close tea careful buy meclozine online hopeful excellent products Really I http://bazaarint.com/includes/main.php?hydrochlorothiazide-where-to-buy past. When you’re decided when order norvasc online shop wanted goes guardiantreeexperts.com buy lasix 100 mg no prescription I But blow-dryer-and-separate-round-brush hit you http://bazaarint.com/includes/main.php?discount-ampicillin label. Loyal antioxidant seriously http://bluelatitude.net/delt/echeck-online-pharmacys.html laundry, matte cleaning. This advair online no prescription The to reduced to do online prescriptions t weeks and about http://serratto.com/vits/getting-prescription-drugs-without-dr.php matter best today by the online prescription free pharmacy a using. Buying fragrance buy lexapro from india to as years proscar cost with naturally conditioning to product praie rx in canada and tightly is.

secondary 定制oplog size 切换原来的primary

具体操作一下方法一的步骤,集体参考mongo oplog

1). 切换当前primary ->secondary

rs1:PRIMARY> rs.stepDown();

2). 关闭MongoDB

rs1:SECONDARY> db.shutdownServer();

3). 注释掉replSet选项,以单机模式启动 —切换port
4). 查询出最后的同步点

> use local
> db.oplog.rs.find( { }, { ts: 1, h: 1 } ).sort( {$natural : -1} ).limit(1).next();
{ "ts" : Timestamp(1378716098, 2), "h" : NumberLong("-654971153597320397") }

5). 删除旧的oplog

> db.oplog.rs.drop();

6). 创建新的oplog,这里为30GB

> db.runCommand({create:"oplog.rs", capped:true, size:(30*1024*1024*1024)});

7). 写入最后的同步点

> db.oplog.rs.save({ "ts" : Timestamp(1378716098, 2), "h" : NumberLong("-654971153597320397") });

8). 关闭MongoDB

> db.shutdownServer();

9). 使用replSet选项,以Replset模式启动
10). 检查同步情况