Good day all.
We are currently running a single instance of MongoDB within a replicaset that has only one member.
I’m in the process of migrating to a PSA architecture. The following will be my setup:
mongo1: primary, priority: 10
mongo2: secondary, priority: 1
mongoarb: arbiterOnly
* All Windows servers
The 3 servers are configured with:
security:
authorization: enabled
keyFile: <path>\mongo.key
replication:
replSetName: rs0
systemLog:
destination: file
verbosity: 0
quiet: false
logAppend: true
logRotate: rename
path: <path>\mongod.log
We already have a windows task to logRotate with a specific logsadm user account. The task is set to run every day, and we keep only 7 days worth of logs.
I found that on primary and secondary, I am able to issue the logRotate command no problem, i.e.:
mongosh.exe -u logsadm -p <password> --host mongo1 --port 27017 --eval "db.adminCommand({ logRotate: 1 })"
mongosh.exe -u logsadm -p <password> --host mongo2 --port 27017 --eval "db.adminCommand({ logRotate: 1 })"
However, because Arbiter doesn’t have a copy of the admin.users collection, it obviously cannot issue the command.
I tried connecting to the arbiter directly and create a logsadm user in it, but it of course won’t let me, because it is not the primary server.
My question: what is normally done for log rotation in regards of arbiters? I’m currently in a sandbox, testing it all (localhost, running PSA on different ports), so I can always redo steps…
For example, before adding arbiter to the replicaset, should I have went in and create the logsadm user, and only after add it as a member to the RS? Could this somehow affect the integrity of the replicaset afterwards?
Thanks for your returns.
Pat