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)
conn.admin.command({“logRotate”:1})
its localhost - primary node is on another server
replicaset has primary, secondary, arbiter
using:
mongodb server 4.2.2
pymongo 4.1
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.