pt-heartbeat(percona toolkit)
2018-06-17 23:51:17来源:未知 阅读 ()
mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 172.16.16.35 Master_User: root Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000016 Read_Master_Log_Pos: 299786938 Relay_Log_File: mxqmongodb2-relay-bin.000032 Relay_Log_Pos: 299787151 Relay_Master_Log_File: mysql-bin.000016 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 299786938 Relay_Log_Space: 299787451 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 0 Last_SQL_Error: Replicate_Ignore_Server_Ids: Master_Server_Id: 353306 Master_UUID: 806ede0c-357e-11e7-9719-00505693235d Master_Info_File: mysql.slave_master_info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: 806ede0c-357e-11e7-9719-00505693235d:666-330347 Executed_Gtid_Set: 6a4ab82c-4029-11e7-86b0-00505693235d:1-3, 806ede0c-357e-11e7-9719-00505693235d:1-330347 Auto_Position: 1 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec)
[root@mxqmongodb2 bin]# ./pt-heartbeat --host=172.16.16.35 --port=3306 --user=root --password=123456 --database=test --update --create-table --daemonize
mysql> desc heartbeat; +-----------------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------------+---------------------+------+-----+---------+-------+ | ts | varchar(26) | NO | | NULL | | | server_id | int(10) unsigned | NO | PRI | NULL | | | file | varchar(255) | YES | | NULL | | | position | bigint(20) unsigned | YES | | NULL | | | relay_master_log_file | varchar(255) | YES | | NULL | | | exec_master_log_pos | bigint(20) unsigned | YES | | NULL | | +-----------------------+---------------------+------+-----+---------+-------+ 6 rows in set (0.01 sec) mysql> select * from heartbeat\G *************************** 1. row *************************** ts: 2017-06-23T09:27:49.001580 server_id: 353306 file: mysql-bin.000016 position: 299837221 relay_master_log_file: NULL exec_master_log_pos: NULL 1 row in set (0.00 sec)
UPDATE `test`.`heartbeat` SET ts='2017-06-23T09:32:47.001330', file='mysql-bin.000016', position='29
[root@mxqmongodb2 bin]# ./pt-heartbeat --host=172.16.16.35 --port=3306 --user=root --password=123456 --database=test --update --daemonize
[root@mxqmongodb2 bin]# ./pt-heartbeat -D test --monitor -h 172.16.16.34 -uroot -P3306 -p123456 0.00s [ 0.00s, 0.00s, 0.00s ] 0.00s [ 0.00s, 0.00s, 0.00s ] 0.00s [ 0.00s, 0.00s, 0.00s ] 0.00s [ 0.00s, 0.00s, 0.00s ] 0.00s [ 0.00s, 0.00s, 0.00s ]
[root@mxqmongodb2 tpcc-mysql]# ./tpcc_start -h127.0.0.1 -P3306 -d tpcc -u root -p123456 -w 10 -c 20 -r 10 -l 600
0.71s [ 0.68s, 0.16s, 0.05s ] 1.71s [ 0.71s, 0.17s, 0.06s ] 0.85s [ 0.72s, 0.17s, 0.06s ] 0.93s [ 0.74s, 0.18s, 0.06s ] 0.00s [ 0.74s, 0.18s, 0.06s ] 0.82s [ 0.73s, 0.18s, 0.06s ] 0.66s [ 0.75s, 0.18s, 0.06s ] 0.00s [ 0.75s, 0.18s, 0.06s ] 0.88s [ 0.74s, 0.18s, 0.06s ] 1.00s [ 0.74s, 0.19s, 0.06s ]
mysql> stop slave sql_thread; Query OK, 0 rows affected (0.03 sec)
53.00s [ 23.85s, 6.77s, 4.20s ] 54.00s [ 24.75s, 6.94s, 4.26s ] 55.00s [ 25.67s, 7.12s, 4.32s ] 56.00s [ 26.60s, 7.30s, 4.39s ] 57.00s [ 27.55s, 7.48s, 4.45s ] 58.00s [ 28.52s, 7.67s, 4.51s ] 59.00s [ 29.50s, 7.86s, 4.58s ] 60.00s [ 30.50s, 8.05s, 4.65s ] 61.00s [ 31.50s, 8.23s, 4.71s ] 62.00s [ 32.50s, 8.42s, 4.78s ] 63.00s [ 33.50s, 8.61s, 4.85s ] 64.00s [ 34.50s, 8.80s, 4.92s ] 65.00s [ 35.50s, 8.98s, 5.00s ]
[root@mxqmongodb2 bin]# ./pt-heartbeat -D test --check -h 172.16.16.34 -uroot -P3306 -p123456 1.00 [root@mxqmongodb2 bin]# ./pt-heartbeat -D test --check -h 172.16.16.34 -uroot -P3306 -p123456 0.00
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
下一篇:在PHP中连接数据库的八大步骤
- Percona-Tookit工具包之pt-table-usage 2018-07-23
- Percona-Tookit工具包之pt-summary 2018-07-22
- Percona-Tookit工具包之pt-slave-find 2018-07-20
- Percona-Tookit工具包之pt-slave-restart 2018-07-19
- Percona-Tookit工具包之pt-slave-find 2018-07-18
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash