MongoDB log too big problem handling

Source: Internet
Author: User
Tags mongodb

The MongoDB log configuration for general company applications is as follows:

LogPath =/usr/local/mongodb/logs/server.loglogappend = True

This configuration is added to the server.log to write the log, but a long time, will make server.log more and more large, resulting in disk problems and log query processing slow problem.

You can manually cut the log without stopping MongoDB using the following command:

>use Admin>db.runcommand ({logrotate:1})

The effect is as follows:

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A4/FC/wKioL1m1_XOSaBC4AAAwoiwhmqI894.png "title=" 1.PNG "alt=" Wkiol1m1_xosabc4aaawoiwhmqi894.png "/>



This article is from "The Clown who plays God" blog, please make sure to keep this source http://icenycmh.blog.51cto.com/4077647/1964263

MongoDB log too big problem handling

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.