<strong>1, Mongod startup item Comment (default cannot generate path, need to establish manually) </strong><br/>
<span style= "White-space:pre" ></span>dbpath the path to the DB instance <br/>
<span style= "White-space:pre" ></span>logpath Logging path <br/>
<span style= "White-space:pre" ></span>logappend log in append form, default to overwrite <br/>
<span style= "White-space:pre" ></span>bind_ip instance binding IP address <br/>
<span style= "White-space:pre" ></span>port instance specifies the port, and the Web management interface adds 1000<br/> on this interface
<span style= "White-space:pre" ></span>fork after the implementation of the operation, <br/>
<span style= "White-space:pre" ></span>journal open operation log function <br/>
<span style= "white-space:pre" ></span>syncdelay sync flush Disk Time in seconds, default 60 seconds <br/>
<span style= "White-space:pre" ></span>directoryperdb db separate directory, similar to MySQL standalone table space <br/>
<span style= "White-space:pre" ></span>maxconns maximum number of links <br/>
<span style= "White-space:pre" ></span>repairpath Execute repair temporary directory, if not open journal, abnormal Panic, need to perform repair operation <BR/ >
<p>
<span style= "White-space:pre" ></span>auth requires account verification login
</p>
<p>
<br/>
</p>
<p>
<STRONG>2, stop service shutdownserver () db.shutdownserver () </strong>
</p>
<p>
<strong><br/>
</strong>
</p>
<p>
<strong>3, view current process db.currentop () <span style= "White-space:pre" > </span></strong>
</p>
<p>
<br/>
</p>
<p>
<strong>4, ending a process db.killop (process number) </strong>
</p>
<p>
<strong><br/>
</strong>
</p>
<strong>5, current instance running state per second using Mongostat to enter a library instance </strong><br/>
<span style= "White-space:pre" ></span>insert insert <br/> per second
<span style= "white-space:pre" ></span>query query <br/> per second
<span style= "white-space:pre" ></span>update update <br/> per second
<span style= "White-space:pre" ></span>delete delete <br/> per second
<span style= "White-space:pre" ></span>locked Lock amount <br/>
<span style= "White-space:pre" ></SPAN>QR|QW client Queue Length read, write <br/>
<span style= "White-space:pre" ></span>ar|aw active client Count read, write <br/>
<p>
<span style= "White-space:pre" ></span>conn link number
</p>
<p>
<br/>
</p>
<strong>6, exporting Data mongoexport </strong><br/>
<p>
<span style= "White-space:pre" ></span>mongoexport-d database name-C table name-The path of the file to be exported
</p>
<p>
<br/>
</p>
<STRONG>7, database backup Mongodump, select only the database, representing the full library backup </strong><br/>
<p>
<span style= "White-space:pre" ></span>mongodump-d database name-c backup table name-o backup path
</p>
<p>
<br/>
</p>
<strong>8, database restore Mongorestore ,drop to first remove and then insert data </strong><br/>
<span style= "White-space:pre" ></span>mongorestore-d database name backup path--drop<br/>
<p>
<span style= "White-space:pre" ></span>mongorestore-d drumdb D:\MDRUM\drumdb
</p>
<p>
<br/>
</p>
<STRONG>9, repair the database, will be invalid and corrupted data to clean out </strong><br/>
<p>
<span style= "White-space:pre" ></span>db.repairdatabase ()
</p>
<p>
<br/>
</p>
<STRONG>10, Fsync to the database to increase the write lock, need to execute the statement in the Admin library, after the execution of the buffer data is written to disk, blocking other write operations, <br/>
<span style= "White-space:pre" ></span> can then be backed up, and after the backup is finished, restore the write lock to DB. $cmd. Sys.unlock.findOne (); <br/>
<span style= "White-space:pre" ></span> after unlocking can use Db.currentop () <span style= "White-space:pre" ></ span> viewing process </strong><br/>
<span style= "White-space:pre" ></span> Locking Db.runcommand ({"fsync": 1, "lock " : 1}); <br/>
<span style= "white-space:pre" ></span> unlock db. $cmd. Sys.unlock.findOne ();
mongodb--Database Management