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