MongoDB Series 2: familiar with some common tools provided by MongoDB, mongodb Series 2
In our preliminary study, we can successfully run MongoDB on our own machine. However, there are some tools that we don't know in the bin directory. Next, we will introduce the usage of various gadgets and the usage of the files created in the data folder of MongoDB.
1. Introduction and usage of various gadgets under the bin directory
Bsondump.exe
It is used to convert the exported bsonfile format to the jsonformat mongo.exe mongoDB client.
Mongod.exe
Server used to start mongoDB
Mongodump.exe
Used to export BSON files from mongodb databases, similar to mysql's dump tool mysqldump
Mongoexport.exe
This API is used to export a mongodb database in JSON, CSV, or TSV format.
Example: Export export -- host mongodb1.example.net -- port 37017 -- username user -- password pass -- collection contacts
Mongofiles.exe
The command used to interact with the GridFS File System of mongoDB and operate the files in it. It provides the storage object interface between our local system and the GridFS file system.
Example: program files -- hostname db1.example.net -- port 37017-d records list
Mongoimport.exe
In JSON, CSV, TSV, and other file formats.
Example: Export Import -- db users -- collection contacts -- type csv -- file/opt/backups/contacts.csv
Mongooplog.exe
It is used to copy running logs from the running mongod service to the specified server and is mainly used for Incremental backup.
Example: mongooplog -- from mongodb0.example.net -- host mongodb1.example.net, backup can also see this BLOG: http://www.ttlsa.com/html/2052.html
Mongoperf.exe is a tool used to independently check the I/O performance of mongoDB.
Example: mongoperf.exe <testPrefJson.txt (Note: testPrefJson.txt stores the test parameters in json format, for example, {nThreads: 16, fileSizeMB: 1000, r: true }, for more parameters, see the help of this command.) configure the iostat command on linux to observe the write effect.
Mongorestore.exe
Used to restore exported BSON files to mongodb Databases
Mongos.exe
Used for registration system processing
Mongostat.exe
The current mongod status monitoring tool, such as the vmstat
Mongotop.exe
It provides the time that the mongod database takes to read and write data, which is recorded for each collection. The default record time is recorded by seconds.
Mongosniff (this tool is available in linux and unix) is used to monitor TCP/IP connections to mongodb, similar to tcpdump. Application can view this BLOG: http://blog.nosqlfan.com/html/521.html
2. Introduction to data files created by MongoDB
Dbname.0
Data Files
Dbname. ns File
Dbname. ns file storage namespace information. In mongodb, each collection has a namespace named dbname. collection_name. The dbname. ns file stores an array of hash table nodes. The key is based on the namespace name, and the value is the namespace information. The size of the hash table node is 628 bytes, and the default size of the dbname. ns file is 16 Mb. A total of 26715 namespaces can be stored.
Mongod. lock
Store the process information of the current MongoDB instance
Copyright statement: Reprinted with the blog address to respect the author's Labor achievements. Welcome to http://blog.csdn.net/zgs_shmilyto grow together.