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.
-
what is your O.S environment?– Md Haidar Ali KhanCommented Dec 31, 2017 at 5:38
Add a comment
|
1 Answer
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.
-
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– ashkCommented 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– ashkCommented Jan 3, 2018 at 5:57