0

While running the command in the shell db.adminCommand( { logRotate : 1 } ) of arbiter it showing an error message as not authorized to run this command but in primary and secondary of replicaset its working. So what's the solution for this version is 3.4.3.

1

1 Answer 1

0

As per MongoDB BOL Here Rotate the log file by issuing the logRotate command from the admin database in a mongo shell:

db.adminCommand( { logRotate : 1 } )

You must issue the logRotate command against the admin database in the form:

{ logRotate: 1 }

Note : Your mongod instance needs to be running with the --logpath [file] option.

3
  • Its centos 7 but its not working arbiter it need authentication but while giving authentication which we are using for primary and seconadry in this replica set its not working for arbiter so whats the solution
    – ashk
    Commented Jan 3, 2018 at 5:04
  • @ashk,Have you checked your "logpath" or "systemLog.path" settings configuration. Commented Jan 3, 2018 at 5:18
  • log path is same as primary and secondary but while using use admin and run this command db.adminCommand( { logRotate : 1 } ) its shownig not authorized to execute this command authentication required
    – ashk
    Commented Jan 3, 2018 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.