Definição
rs.printReplicationInfo()Prints a formatted report of the replica set member's oplog. The displayed report formats the data returned by
db.getReplicationInfo(). The output ofrs.printReplicationInfo()is identical to that ofdb.printReplicationInfo().Observação
The
rs.printReplicationInfo()method run inmongoshdoes not return JSON. Users.printReplicationInfo()for manual inspection, anddb.getReplicationInfo()in scripts.
Exemplo de saída
The following example is a sample output from the rs.printReplicationInfo() method run on the primary:
configured oplog size: 192MB log length start to end: 65422secs (18.17hrs) oplog first event time: Mon Jun 23 2014 17:47:18 GMT-0400 (EDT) oplog last event time: Tue Jun 24 2014 11:57:40 GMT-0400 (EDT) now: Thu Jun 26 2014 14:24:39 GMT-0400 (EDT)
Campos de Saída
rs.printReplicationInfo() formats and prints the data returned by db.getReplicationInfo():
- tamanho do oplog configurado
- Exibe o valor
db.getReplicationInfo().logSizeMB. - comprimento do registro do início ao fim
- Exibe os valores
db.getReplicationInfo().timeDiffedb.getReplicationInfo().timeDiffHours. - hora do primeiro evento do oplog
- Exibe o
db.getReplicationInfo().tFirst. - oplog hora do último evento
- Exibe o
db.getReplicationInfo().tLast. - agora
- Exibe o
db.getReplicationInfo().now.
Consulte db.getReplicationInfo() para obter uma descrição dos dados.
Compatibilidade
Esse método está disponível em implantações hospedadas nos seguintes ambientes:
- MongoDB Atlas: o serviço totalmente gerenciado para implantações do MongoDB na nuvem
Importante
Esse comando não é suportado em clusters M0 e Flex. Para obter mais informações, consulte Comandos não suportados.
MongoDB Enterprise: a versão autogerenciada e baseada em assinatura do MongoDB
MongoDB Community: uma versão com código disponível, de uso gratuito e autogerenciada do MongoDB