Last active
July 11, 2016 10:32
-
-
Save noblejasper/3088a95eca56859206c7 to your computer and use it in GitHub Desktop.
MongoDBのCollectionを削除しても容量が減らない対応 ref: http://qiita.com/noblejasper/items/4f391309ced03ae02e7e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> use dbname; | |
set:PRIMARY> db.collectionname.drop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> rs.remove("10.120.41.196:27017") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:REMOVED> use admin; | |
set:REMOVED> db.shutdownServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo rm -r /var/lib/mongodb/* | |
$ sudo rm -r /var/log/mongodb/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo service mongod start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> rs.add("10.120.41.196:27017") # 追加するSECONDARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> rs.syncFrom('10.120.41.199:27017') # もう一つのSECONDARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> rs.syncFrom('10.120.41.199:27017') # もう一つのSECONDARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> rs.status() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set:PRIMARY> rs.freeze(15) | |
set:PRIMARY> rs.stepDown(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment