logRotate command issued on secondary node is rotating primary node's log

logRotate command issued on secondary node through connection string from pymongo rotating primary node’s log. How to rotate the secondary mongodb log?
My current approach:
conn = pymongo.MongoClient(port=dbport)

its localhost - primary node is on another server
replicaset has primary, secondary, arbiter
mongodb server 4.2.2
pymongo 4.1

what am I missing?

By default the client driver will automatically discover the replica set and connect to the primary. To connect directly to the node you will need to add the parameter directConnection=True as a URI option or keyword argument.

1 Like

Thank you Chris, adding directConnection=True to connection worked.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.