MongoDB Primary Series II: Recognize some of the common tools that MongoDB provides

Source: Internet
Author: User

In a preliminary discussion, we have been able to successfully run MongoDB on our own machine. But there are some tools that we don't know about in the bin directory. Next, you'll look at the purpose of each gadget and explore the purpose of a file that MongoDB creates in the Data folder.


1, the bin directory of the following a variety of small tools and how to use

Bsondump.exe

Client for converting exported Bson file format to JSON format Mongo.exe MongoDB

Mongod.exe

Server for starting MongoDB

Mongodump.exe

Used to export Bson format files from the MongoDB database, similar to the MySQL dump tool mysqldump

Mongoexport.exe

Used to export a database in MongoDB to a format of json,csv or TSV.

Use example: Mongoexport--host mongodb1.example.net--port 37017--username user--password pass--collection contacts

Mongofiles.exe

The command used to interact with MongoDB's Gridfs file system, and to manipulate the files in it, provides a storage object interface between our local system and the Gridfs file system.

Use example: Mongofiles--hostname db1.example.net--port 37017-d records list

For Mongoimport.exe

Import the file formats such as Json,csv or TSV into the MongoDB database.

Use example: Mongoimport--db users--collection contacts--type CSV--file/opt/backups/contacts.csv

Mongooplog.exe

Used to copy the run log from the running Mongod service to the specified server, primarily for incremental backups.

Use example: Mongooplog--from mongodb0.example.net--host mongodb1.example.net, backup You can also refer to this article blog:http://www.ttlsa.com/html/ 2052.html

Mongoperf.exe tool for independent checking of MongoDB I/O performance.

Use Example: Mongoperf.exe < TestPrefJson.txt (Note: testPrefJson.txt stores the parameters of the test in JSON format, such as: {Nthreads:16,filesizemb:1000,r:true }, see the Help for this command for more parameters, configure the Iostat command on Linux to observe the effect of the write

Mongorestore.exe

Used to restore exported Bson files to the MongoDB database

Mongos.exe

For registering system processing

Mongostat.exe

Current Mongod Status Monitoring tool, like Linux Vmstat monitoring Linux

Mongotop.exe

Provides a trace of the time that the Mongod database spends reading and writing data, records for each collection, and the default record time is recorded in seconds.

Mongosniff (Linux and Unix have this tool) is used to monitor TCP/IP connections to MongoDB, similar to tcpdump. App to 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

The Dbname.ns file stores namespace information. In MongoDB, each collection has a namespace, named Dbname.collection_name. The Dbname.ns file stores an array of hash table nodes. Key is based on the name of the namespace, and value is the namespace information. The size of the hash table node is 628 bytes, the default size of the Dbname.ns file is 16M, and altogether 26,715 namespaces can be stored.

Mongod.lock

Storing process information for the current MongoDB

Copyright NOTICE: Reprint Please specify the address of the blog, respect the author's labor results. Welcome to pay attention to http://blog.csdn.net/zgs_shmily, grow together.

MongoDB Primary Series II: Recognize some of the common tools that MongoDB provides

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.