╰─ ./defragment_sharded_collection.py "mongodb://user:password@localhost:27017" --ns "POCDB.POCCOLL" --phases phase1 ─╯
2021-11-05 10:53:45,047 [INFO] Starting with parameters: 'mongodb://user:password@localhost:27017 --ns POCDB.POCCOLL --phases phase1'
Server is running at FCV 4.4
Traceback (most recent call last):
File "./defragment_sharded_collection.py", line 1069, in <module>
loop.run_until_complete(main(args))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./defragment_sharded_collection.py", line 222, in main
if not args.dryrun and (balancer_doc is None or balancer_doc['mode'] != 'off'):
KeyError: 'mode'
#----------------
Renatos-MBP-2(mongos-4.4.10)[mongos] config> db.settings.find()
{
"_id": "balancer",
"stopped": true
}
We should use the balancerStatus command to check if the balancer is on. The result of this command is guaranteed to be consistent on all the supported releases.
On a
4.4.10
cluster: