Mysql Copy Tool
1.percona-toolkit Introduction
Percona-toolkit is a collection of advanced command-line tools used to perform a variety of manual execution of very complex and cumbersome MySQL and System tasks, these tasks include:
- check Master and slave data consistency
- effectively archive records
- find duplicate index
- Summary of server information
- analysis from logs and tcpdump query
- Span style= "color: #555555; Font-family: "The song body" and collect important system information when the system goes wrong
Percona-toolkit from Maatkit and the Aspersa Tools, these two tools are managed MySQL the most famous tool, now Maatkit The tool has not been maintained, please use Percona-toolkit it! These tools mainly include development, performance, configuration, monitoring, replication, System, practical six categories, as a good DBA, some of the tools are very useful, if you can master and flexible application, will greatly improve productivity.
?
2. Installing percona-toolkit
[Email protected] ~]# yum-y install percona-toolkit-2.2.4-1.noarch.rpm
?
[email protected] ~]# PT #以pt开头命令
?
3. Simple to use
(1). Server Summary
[Email protected] ~]# pt-summary
(2). Server disk Monitoring
[Email protected] ~]# pt-diskstats
(3). mysql Service Status Summary
[Email protected] ~]# pt-mysql-summary----user=root
?
(4). Slow query log analysis statistics
?
?
[email protected] ~]# Pt-query-digest/mydata/data/mysql-slow.log
?
(5).master-Slave condition monitoring, provided to it aMySQLServer'sIPUser name password, you can analyze the information of each server in the master/slave architecture, including but not limited toMySQLversions,IPaddress,Server ID,MySQLthe start time of the service, the role (primary/from),Slave Status (How many seconds lag behind the master server,There are no errors,slaveThere is no running).
?
[Email protected] ~]# Pt-slave-find--host=localhost--user=root
(6). mysql Deadlock Monitoring
[Email protected] ~]# pt-duplicate-key-checker--database=xxx h= ' 127.0.0.1 '--user=root--password=xxxx
View a XXX database, the password is set when you authorize, or you can have no password
?
(7). monitoring replication latency from a library
?
[email protected] ~]# pt-slave-delay--host xxx --user=root--password=xxx
?
?
?
?
?
?
?
?
Mysql Replication Tool (Percona-toolkit)