we have a 3 node sharded cluster and we are trying to delete the unused data from the collections, but after the delete the disk space was not released back to the OS.
can anyone provide me the details on running the compact command from a mongod instance? looks like running compact from mongos is not supported in 3.0.4
I would go with db.runCommand ( { compact: 'mydb.mycollection', force: true } ). But yeah if you can move to Atlas, just forget about it and migrate. Problem solved.
Thank you for the link. this is what I get when I try to connect to mongo shell from the instance where mongod is running.
MongoDB shell version: 3.0.4
connecting to: test
2022-12-01T15:55:08.719+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2022-12-01T15:55:08.720+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed.
Here is our set uo :
1. mongos server
/opt/mongo/bin/mongos --configdb m1.qa..com:27019,m2.qa..com:27019,m3.qa..com:27019
2. 3 mongod servers
/opt/mongo/bin/mongod --dbpath /mongodb/configdb --port 27019 --storageEngine wiredTiger
/opt/mongo/bin/mongod --dbpath /mongodb/sharddb --port 27018 --storageEngine wiredTiger