Operation 3 MongoDB and MySQL turn on slow query log, and MongoDB starts from config file

Source: Internet
Author: User

1.

MongoDB starts from a configuration file

Create configuration file:/usr/local/mongodb/etc/mongodb.conf

The contents of the configuration file are:

#Directory and relavent setdbpath =/var/mongodb/datalogpath =/var/mongodb/logs/log.logprofile=2slowms=100# Repairpath =/var/mongodb/repairpidfilepath =/usr/local/mongodb/mongodb.pid#directoryperdb = True#sysinfo = true# verbose = True#logappend = TRUE#CPU = true#network and Security Setnoauth = True#port = 8888#maxconns = 1024fork = True#ma Nagement#nohttpinterface = True#rest = True#quota = True#quotafiles = 1024#nssize = 16#syncdelay = 5

which

profile=2 representative Prints all

The SLOWMS represents more than a few seconds of operation.

Results are output to LogPath

Noauth on behalf of START account verification


2.

Start with configuration file

/usr/local/mongodb/bin/mongod-f/usr/local/mongodb/etc/mongodb.conf

Display after successful startup:

About-to-fork child process, waiting until server was ready for connections.forked Process:389child process started succes sfully, parent exiting


3.mysql5.6 Turn on Slow query

Vim MY.CNF

Queries that represent more than one second are slow queries, and slow queries are written to files in the Mysql-slow.log file

Log-error=/var/log/mysql-error.logslow_query_log=1slow_query_log_file=/www/web_logs/mysql/mysql-slow.log


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Operation 3 MongoDB and MySQL turn on slow query log, and MongoDB starts from config file

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.