mongoDB复制集修改oplog大小 [数据库教程]

database

ctiy:PRIMARY> use local

switched to db local

ctiy:PRIMARY> db.oplog.rs.stats().maxSize //查看大小

NumberLong("53687091200") //这里为50G,单位为B

ctiy:PRIMARY> use local

switched to db local

ctiy:PRIMARY> db.adminCommand({replSetResizeOplog:1,size:5120}) //修改为5G,

{ //修改 这里单位 为 M

"ok" : 1,

"operationTime" : Timestamp(1595321857, 1),

"$clusterTime" : {

"clusterTime" : Timestamp(1595321857, 1),

"signature" : {

"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

"keyId" : NumberLong(0)

}

}

}

ctiy:PRIMARY> db.oplog.rs.stats().maxSize

NumberLong("5368709120")

ctiy:SECONDARY> rs.printReplicationInfo() // 另一种查看方法

configured oplog size: 51200MB

log length start to end: 2580359secs (716.77hrs)

oplog first event time: Sun Jun 21 2020 20:01:51 GMT+0800 (CST)

oplog last event time: Tue Jul 21 2020 16:47:50 GMT+0800 (CST)

now: Tue Jul 21 2020 16:47:54 GMT+0800 (CST)

mongoDB复制集修改 oplog 大小

以上是 mongoDB复制集修改oplog大小 [数据库教程] 的全部内容, 来源链接: utcz.com/z/534809.html

回到顶部