flyaway mysql_flyaway

Description

PM2 module to monitor a MySQL server with Keymetrics

Install

pm2 install pm2-mysql

Requirements

This module requires a MySQL install (tested against v5.6). Optionally, to monitor the DB disk Read/Write you will need iostat located in the sysstat package.

Slow Queries

To be able to display Slow Queries you first need to activate slow_query_log in MySQL via :

Edit /etc/mysql/my.cnf and add :

slow_query_log = '1'

and you need to set the log file path to a file your pm2 user has read access to :

slow_query_log_file = '/var/log/mysql/slow-queries.log'

General Query Log

To be able to display the last queries, you need to enable the General Query Log via :

general_log = '1'

and you need to set the log file path to a file your pm2 user has read access to :

general_log_file = '/var/log/mysql/general.log'

Configure

host (Defaults to localhost) : Set the hostname/ip of your mysql server

port (Defaults to 3306): Set the port of your mysql server

user (Defaults to root): Set the user of your mysql server

password (Defaults to none): Set the password of your mysql server

refreshRate (Defaults to 1000): Set the stats refresh rate (in milliseconds)

dbDiskName (Defaults to "sda"): Sets the name of the disk used by the database (used to fetch io stats)

slowQueriesLog (Defaults to "/var/log/mysql/slow-queries.log"): log file to fetch slow queries from

generalLog (Defaults to "/var/log/mysql/general.log"): log file to fetch last queries from

lastQueriesSize (Defaults to 100): number of lines to fetch from general log for last queries display

errorLog (Defaults to "/var/log/mysql/error.log"): error log file

lastErrorsSize (Defaults to 100): number of lines to fetch from error log for last errors display

How to set these values ?

After having installed the module you have to type :

pm2 set pm2-mysql:

e.g:

pm2 set pm2-mysql:port 3307 (set the mysql port to 3307)

pm2 set pm2-mysql:password keppo (use keppo as password for your mysql server)

Uninstall

pm2 uninstall pm2-mysql

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值