您的位置:首页 > 数据库 > SQL

Innotop: A real-time, advanced investigation tool for MySQL

2014-04-04 19:09 417 查看
GUI monitoring tools for MySQL are not always suitable for all our needs or situations. Most of them are designed to provide historical views into what happens to our database over time rather then real-time insight into current MySQL server status. Excellent free tools for this include Cacti, Zabbix, Ganglia, Nagios, etc. But each of them needs to be properly configured to provide details on what is going on in our MySQL instances. And setting up one of these monitoring solutions is neither quick nor trivial (well, maybe with the exception of Ganglia).MySQL Workbench provides a substitute for real-time MySQL status views, though it is very limited. It also needs to be installed on a workstation with a graphical environment.The fact is that you won’t find many text-mode tools of this kind for MySQL. The most widely known are Innotop and mytop. The latter unfortunately seems to be an abandon project as the last significant update happened in 2007. Additionally, mytop offers way less functionality then Innotop.

INNOTOP

Innotop can be really handy when you need a quick and easy tool that can provide a lot of details on what MySQL is doing – without using difficult queries to get those details manually. For our Percona Support customers, using Innotop will often be much easier then running complex SHOW statements and filtering their output in order to get some simple facts like slave replication lag, number of busy threads or InnoDB history list length. Also for us, Support engineers, it’s sometimes quicker to get a fast system overview with Innotop before we do deeper investigation using SHOW statements, Information_schema or more complex ways.But Innotop is even more then that! In this article I will show what are my favorite features of this little tool, that you probably were not aware of. It is not my intention to show all the functionality here, so to get quick idea of the base tool capabilities, check the sample screenshots.

Configuration

Let’s start from quick configuration examples to demonstrate how you can get the tool up and running in 5 minutes. Btw. I think configuration examples can be really useful as documentation is bit unclear about some of it’s aspects.After we are successful with installing latest Innotop, simply type ‘innotop’ command in our terminal and this is what most likely you will see:There are actually at least three ways to establish first working connection to MySQL server(s) for Innotop.The simplest way to just start working is to run it by using similar host/user/password parameters as you do for basic mysql client:innotop -h 127.0.0.1 -u root -p mysecret
1innotop-h127.0.0.1-uroot-pmysecre
yum install innotop && 赋予某用户privilegegs的时候需要几个特殊的权限,如下:
grant select,process,file,show databases,super,replication client on *.* to ec@'localhost' identified by 'ec';
否则,只能看到部分效果。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql innotop
相关文章推荐