In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Innotop is a very powerful MySQL monitoring tool, written in perl, through the text mode to show the operation of the MysQL server and Innodb.
Install innotop
Download address: https://github.com/innotop/innotop
Two versions are available on Github, one is the development version (innotop-master) and the other is the stable version (innotop-gtid). Here, we are using the development version.
Note: the download address provided online is http://code.google.com/p/innotop/, but this is the original maintenance address, the project has now been migrated to Github, and the version of innotop-1.9.0.tar.gz has also been tested (the latest version of google code is 1.9.1), many features can not be used, may be related to the version of MySQL, it is recommended to download directly from Github.
# unzip innotop-master.zip
# cd innotop-master
# perl Makefile.PL
Checking if your kit is complete...Looks goodWarning: prerequisite Term::ReadKey 2.1 not found.Writing Makefile for innotop
The above error is reported and the ReadKey package is missing.
# yum search ReadKey-Note: basically all missing Perl Module can be obtained by yum
Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: centos.ustc.edu.cn=== perl-TermReadKey.x86_64 S matched: ReadKey = = perl-TermReadKey.x86_64: A perl module for simple terminal control Name and summary matches only, use "search all" for everything.
# yum install-y perl-TermReadKey
# perl Makefile.PL
Writing Makefile for innotop
# make install
Cp innotop blib/script/innotop/usr/bin/perl-MExtUtils::MY-e 'MY- > fixin (shift)'-- blib/script/innotopManifying blib/man1/innotop.1 Installing / usr/local/share/man/man1/innotop.1 Installing / usr/local/bin/innotopAppending installation info to / usr/lib64/perl5/perllocal.pod
How to use Innotop
First of all, let's check its common startup parameters through innotop-- help.
# innotop-- help Usage: innotop-- [no] color-C Use terminal coloring (default)-config-c Config file to read-- count Number of updates before exiting-- delay-d Delay between updates in seconds-- help Show this help message-- host-h Connect to host-- [no] inc-i Measure incremental differences-mode- M Operating mode to start in-- nonint-n Non-interactive Output tab-separated fields-password-p Password to use for connection-port-P Port number to use for connection-skipcentral-s Skip reading the central configuration file-socket-S MySQL socket to use for connection-spark Length of status sparkline (default 10)-timestamp-t Print timestamp in-n mode (1: per iter 2: per line)-user-u User for login if not current user-version Output version information and exit-write-w Write running configuration into home directory if no config files were loaded
Where:
-d: how often is it updated
-h: hostname of the connection
-p: connected port
-location of S:socket
-u: connected user
It is not difficult to understand children's shoes that are familiar with MysQL.
After logging in, the default is Dashboard. Innotop supports a variety of modes, and Dashboard is just one of them. Pass "?" Key, we can view all modes.
Through the above letters, you can switch to different states.
How to view innotop documents
1. # man innotop
2. # perldoc innotop
How to monitor multiple MySQL servers
There are two ways:
First, add it directly to the innotop interactive interface, as follows:
# innotop
After entering the interactive interface, click the @ key to enter the connection configuration interface.
Begin to fill in below, there are mainly the following items:
The explanation is as follows:
Choose connections for this mode: select the connection, or create it manually if the connection does not exist. So there will be a prompt "There is no connection called 'master26',create it?:" below.
Fill in y, then enter, and you will be prompted to fill in DSN string and press the format.
In Enter password, it should be noted that the cursor does not move when you enter the password, but in fact it has input. After typing, enter directly.
For this method, it is simple and suitable in the case of few monitoring machines, but the disadvantage of this method is that once you exit innotop, all the configuration information will be lost, re-enter, and need to be reconfigured.
Therefore, the recommended methods are as follows.
Second, using configuration files
# innotop-- write, enter the interactive interface and exit. A .innotop / innotop.conf is generated in the current directory
# ls .innotop / innotop.conf plugins
# vim .innotop / innotop.conf
There is a localhost by default for the configuration information about the connection in this configuration file.
[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 of much use for us to edit our own configuration information and can be deleted.
Here, you can add a connection message in the first way, and then edit it accordingly.
Take master26 in the first method as an example. 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_dl master26=user=root have_user=1 pass=123 have_pass=1 dsn=DBI:mysql:;host=192.168.91.26;port=3306 savepass=1 [/ connections]
Edit the innotop.conf file according to the actual production requirements.
[connections] master26=user=root have_user=1 pass=123 have_pass=1 dsn=DBI:mysql:;host=192.168.91.26;port=3306 savepass=1 slave25=user=root have_user=1 pass=123 have_pass=1 dsn=DBI:mysql:;host=192.168.91.25;port=3306 savepass=1 slave22=user=root have_user=1 pass=123 have_pass=1 dsn=DBI:mysql:;host=192.168.91.22;port=3306 savepass=1 [/ connections]
Start innotop, and the information of master26 is monitored by default.
You can select the appropriate server through "n" or "@".
Good is good, but not intuitive enough. We hope that the information of the three servers in this example can be displayed on one screen, so that there is no need to switch back and forth, and it is more intuitive. Here, you need to use the function of SERVER GROUPS.
SERVER GROUPS
As the name implies, it means that the server is grouped, and the granularity of this information display is no longer the server, but the whole group.
There are also two ways to add:
First, add it directly to the innotop interactive interface
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]
Next, let's take a look at the effect of the cluster.
It is sufficient to monitor the status of master-slave clusters.
Note: after being configured in the innotop interactive interface, you need to exit innotop and enter again, otherwise the CXN column will not be displayed.
Summary:
1. Some people may wonder whether it is not safe to save the password to the configuration file, especially in a production environment. In fact, the password can not be stored in the configuration file. The configuration is as follows:
[connections] server144=user=root have_user=1 have_pass=1 dsn=DBI:mysql:;host=192.168.244.144;port=3306 savepass= dl_table= [/ connections]
If it is added in the innotop interactive interface, then the last step Save password in plain text in the config file?: can write "n".
two。 In addition to the above features, innotop is quite powerful. For example, in M mode, that is, Replication Status, you can use the "o" key to send commands to the server. As follows:
The function of Anyway,Innotop is still very powerful, let's think about it slowly.
Reference:
Https://www.percona.com/blog/2013/10/14/innotop-real-time-advanced-investigation-tool-mysql/
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.