MySQL monitoring tool-innotop

Source: Internet
Author: User
Tags dsn mysql version

Innotop is a very powerful MySQL monitoring tool, written in Perl, showing the health of MySQL servers and InnoDB in text mode.

Installing Innotop

: Https://github.com/innotop/innotop

There are two versions available on GitHub, one for the development version (Innotop-master) and one for the stable version (Innotop-gtid). Here, we are using the development version.

Note: http://code.google.com/p/innotop/is available online, but this is the original maintenance address, and the project has now been migrated to GitHub, and Innotop-1.9.0.tar.gz This version is also tested (the latest version of Google Code is 1.9.1), many features are not available, may be related to the MySQL version, it is recommended to download directly from GitHub.

# Unzip Innotop-master.zip

# CD Innotop-master

# Perl makefile.pl

If2.1 for Innotop

Reported above error, missing Readkey package.

# Yum Search ReadKey-note: Basically missing Perl module can usually be obtained by Yum

* * * * updates:centos.ustc.edu.cn ================================================= n/s  Matched:readkey ==================================================perlperl for Simple Terminal control  'searchall' for everything.

# yum Install-y Perl-termreadkey

# Perl makefile.pl

 for Innotop

# make Install

CP innotop blib/script/innotop/usr/bin/perl'my->fixin (shift)  ' --blib/script/innotopmanifying blib/man1/innotop. 1  /usr/local/share/man/man1/innotop. 1  /usr/local/bin/info to/usr/lib64/perl5/perllocal.pod

How to use Innotop

First we look at its common startup parameters through Innotop--help

# Innotop--Helpusage:innotop<options> <innodb-status-file>--[no]color-C use terminal coloring (default)--config-c ConfigfileTo read--count number of updates before exiting--delay-d Delay between updatesinchseconds--Help Show this help message--host-h Connect to host--[no]inc-I Measure incremental differences--mode-m Operating mode to startinch--nonint-n non-interactive, Output tab-separated Fields--password-p Password to use forConnection--port-p Port number to use forConnection--skipcentral-s Skip reading the central configurationfile--socket-s MySQL socket to use forConnection--spark Length of Status Sparkline (defaultTen)  --timestamp-t Print Timestampinch-N Mode (1: Per ITER;2: Per line)--user-u User for Login ifNot current user--version Output version information and exit--Write-WWrite running configuration into home directoryifno config files were loaded

which

-D: How much time to update

-H: The host name of the connection

-P: Connected port

Location of the-s:socket

-U: Connected Users

It is not difficult to understand the children's shoes that are familiar with MySQL.

When logged in, the default is dashboard. The innotop supports multiple modes, and dashboard is just one of the modes. Through the "?" Key we can view all modes

The above letters can be switched to different states.

How to view Innotop's documentation

1. # Man Innotop

2. # Perldoc Innotop

How to monitor multiple MySQL servers

There are two ways of doing this:

First, directly in the Innotop interactive interface to add, the steps are as follows:

# Innotop

After entering the interactive interface, click the @ key to enter the connection configuration interface.

The following are the main items to be filled out below:

The description is as follows:

Choose connections for this mode: Select the connection, if the connection does not exist, create it manually. So here's the tip "there is no connection called ' master26 ', create it?:".

Fill in Y, and then enter, you will be prompted to fill in the DSN string, according to format.

Where in the Enter password this one needs to note that you enter the password when the cursor is not moving, but in fact, it is input, the input is complete, directly enter.

For this method, simple, in the case of monitoring the machine is relatively small, but the disadvantage of the method is that once the exit Innotop, all configuration information will be lost, re-enter, need to reconfigure.

Therefore, the recommended method is as follows.

Second, the use of configuration files

# Innotop--write, exit after entering the interactive interface. Generates a. innotop/innotop.conf in the current directory.

ls . innotop/innotop.conf  plugins

# vim. innotop/innotop.conf

There is a localhost in the configuration file for the configuration information about the connection, by default.

[connections]localhost=user= have_user= have_pass= dsn=dbi:mysql:;host=localhost;mysql_read_default_ Group=client savepass= dl_table=test.innotop_dl[/connections]

Of course, this is not very useful for us to edit our own configuration information and can be removed.

Here, you can add a connection message based on the first method, and then edit the information accordingly.

As an example of master26 in the first way, after adding, the information in innotop.conf is as follows:

[connections]localhost=user= have_user= have_pass= dsn=dbi:mysql:;host=localhost;mysql_read_default_ Group=client savepass= dl_table=test.innotop_dlmaster26=user=root have_user=1 pass=123 have_pass= 1 dsn=dbi:mysql:;host=192.168. 91.26;p ort=3306 savepass=1[/connections]

Edit the innotop.conf file according to the actual production requirement.

[Connections]master26=user=root have_user=1Pass=123 have_pass=1dsn=dbi:mysql:;host=192.168.91.26;p ort=3306savepass=1Slave25=user=root have_user=1Pass=123 have_pass=1dsn=dbi:mysql:;host=192.168.91.25;p ort=3306savepass=1Slave22=user=root have_user=1Pass=123 have_pass=1dsn=dbi:mysql:;host=192.168.91.22;p ort=3306savepass=1[/connections]

Start Innotop, the default is to monitor the MASTER26 information.

The appropriate server can be selected by "n" or "@".

Good, but not intuitive enough, we hope that the three server information in this example can be displayed in a screen, so that there is no need to switch back and forth, more intuitive. Here, you need to use the functionality of the server groups.

SERVER GROUPS

As the name implies, is to talk about the server group, this information is not the granularity of the server, but the whole group.

There are two different ways to add:

First, directly in the Innotop interactive interface to add

Using the "#" key, first create the name of the group and then add the server as follows:

Second, edit the configuration file

[Server_groups]master-slave=master26 slave22 slave25[/server_groups]

Let's take a look at the effect of cluster display

Fully sufficient for monitoring the condition of the master-slave cluster.

Note: After configuring in the Innotop interactive interface, you need to exit Innotop and then enter, otherwise the CXN column will not be displayed.

Summarize:

1. Some people may have doubts about whether it is unsafe to save the password to a configuration file, especially in a production environment. In fact, the password can also not be persisted in the configuration file, configured as follows:

[connections]server144=user=root have_user=1 have_pass=1 dsn=dbi:mysql:;host=  192.168. 244.144;p ort=3306 savepass= dl_table=[/connections]

If it is added in the Innotop interactive interface, the last step is save password in plain text in the config file?: Write "n".

2. In addition to the above features, Innotop is quite powerful. For example, in M mode, the replication status, the "O" key can be used to send commands to the server. As shown below:

Anyway,innotop function or its powerful, we slowly ponder it ~

Reference:

https://www.percona.com/blog/2013/10/14/innotop-real-time-advanced-investigation-tool-mysql/

MySQL monitoring tool-innotop

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.