Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of orzdba in Mysql tools

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "orzdba example Analysis in Mysql tools". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "orzdba example Analysis in Mysql tools".

Mysql tool set: orzdba

Modify about 160lines of code to configure MySQL related verification information, such as username,password,host,port,sock, etc.

Install tcprstat

Install orzdba_rt_depend_perl_module.tar.gz dependency packages (version module, Class-Data-Inheritable module, Module-Build module, File-Lockfile module)

Cd Perl_Module/

Perl Makefile.PL

Make

Make install

Cd Module-Build-0.31

Perl Makefile.PL

Make

Make install

Cd File-Lockfile-v1.0.5

Perl Build.PL

Perl. / Build

Perl. / Build test

Perl. / Build install

Cd version-0.99

Perl Makefile.PL

Make

Make install

Mv orzdba.txt orzdba

. / orzdba.sh-- help

Grep-n'my $MYSQL' orzdba

Root@pts/1 # modify the code:

My $MYSQL = qq {mysql-s-skip-column-names-uroot-P$port}

MYSQL. = qq {- S$socket} if defined $socket

My $TCPRSTAT = "/ usr/bin/tcprstat-no-header-t 1-n 0-p $port"

Modified to:

This step can be avoided, mainly because there is a password to alarm.

My $MYSQL = qq {mysql-s-skip-column-names-uroot-P$port-h227.0.0.1-p12345678}

MYSQL. = qq {- S$socket} if defined $socket

My $TCPRSTAT = "/ usr/bin/tcprstat-no-header-t 1-n 0-p $port"

Error handling:

ERROR 1054 (42S22) at line 1: Unknown column 'Com_select' in' where clause'

Modify the code as follows:

-e'show variables where Variable_name in ("sync_binlog", "max_connections", "max_user_connections", "max_connect_errors", "table_open_cache", "table_definition_cache", "thread_cache_size", "binlog_format", "open_files_limit", "max_binlog_size", "max_binlog_cache_size")'

Change it to:

-e "show variables where Variable_name in ('sync_binlog','max_connections','max_user_connections','max_connect_errors','table_open_cache','table_definition_cache','thread_cache_size','binlog_format','open_files_limit','max_binlog_size','max_binlog_cache_size')"

Error code

-e'show variables where Variable_name in ("innodb_flush_log_at_trx_commit", "innodb_flush_method", "innodb_buffer_pool_size", "innodb_max_dirty_pages_pct", "innodb_log_buffer_size", "innodb_log_file _ size", "innodb_log_files_in_group", "innodb_thread_concurrency", "innodb_file_per_table", "innodb_open_files", "innodb_io_capacity" "innodb_read_io_threads", "innodb_write_io_threads", "innodb_adaptive_fl ushing", "innodb_lock_wait_timeout", "innodb_log_files_in_group")'

Change to

-e "show variables where Variable_name in ('innodb_flush_log_at_trx_commit','innodb_flush_method','innodb_buffer_pool_size','innodb_max_dirty_pages_pct','innodb_log_buffer_size','innodb_log_fil ebullient sizebooks, innocent logbooks, fileswritten groupbooks, innodances, threadbooks, currencybooks, playbooks, adapters, adaptations, indexbooks, indexbooks, openings, openings, files, books, files, books, books, 'innodb_read_io_threads','innodb_write_io_threads','innodb_adaptive_fl ushing','innodb_lock_wait_timeout','innodb_log_files_in_group') "

Error code

-e'show global status where Variable_name in ("Com_select", "Com_insert", "Com_update", "Com_delete", "Innodb_buffer_pool_read_requests", "Innodb_buffer_pool_reads", "Innodb_rows_inserted", "Innodb_rows_updated", "Innodb_rows_deleted", "Innodb_rows_read", "Threads_running", "Threads_connected", "Threads_cached", "Threads_created", "Bytes_received", "Bytes_sent" "Innodb_buffer_pool_pages_data", "Innodb_buffer_pool_pages_free", "Innodb_buffer_pool_pages_dirty", "Innodb_buffer_pool_pages_flushed", "Innodb_data_reads", "Innodb_data_writes", "Innodb_data_read", "Innodb_data_written", "Innodb_os_log_fsyncs", "Innodb_os_log_written")'

Change to

-e "show global status where Variable_name in ('Com_select','Com_insert','Com_update','Com_delete','Innodb_buffer_pool_read_requests','Innodb_buffer_pool_reads','Innodb_rows_inserted','Innodb_rows_updated','Innodb_rows_deleted','Innodb_rows_read','Threads_running','Threads_connected','Threads_cached','Threads_created','Bytes_received','Bytes_sent' 'Innodb_buffer_pool_pages_data','Innodb_buffer_pool_pages_free','Innodb_buffer_pool_pages_dirty','Innodb_buffer_pool_pages_flushed','Innodb_data_reads','Innodb_data_writes','Innodb_data_read','Innodb_data_written','Innodb_os_log_fsyncs','Innodb_os_log_written') "

Remove the password alarm message

Warning: Using a password on the command line interface can be insecure.

Create an encrypted password:

Mysql_config_editor set-user=root-password

Ls-alh. My *

Mysql_config_editor print-all

Or

Cd root

[root@server11 ~] # more .my.cnf

[client]

User=root

Password=123456

View Linux host metrics

. / orzdba-sys-C 10-I 1-t-d sda3

-sys: print system information, including-t (print current time),-l (print load information, 1 minute, 5 minutes, 15 minutes),-c (print cpu information),-s (print exchange partition information)

-d: print disk information, you need to point to the disk device name

-n: print network information, receive and send size, need to point to the name of the network card device

View MySQL response time (rt)

The response time of the MySQL is monitored by calling tcprstat.

. / orzdba-rt-C 10-I 1-t-d sda

Monitor the performance metrics of InnoDB

. / orzdba-innodb-C 10-I 1

Monitor MySQL Server performanc

. / orzdba-mysql-C 10-I 1

Lazy man mode:

Nohup. / orzdba-lazy-d sda-C 5-I 2-L / tmp/orzdba.log > / dev/null 2 > & 1 &

-

Orzdba report

1. Run orzdba to collect mysql-related performance data, and generate log.xxxx-xx-xx collection data file

Here I made some slight changes to orzdba in order to get more continuous data

Original: if ($mycount = = 0) {

Modify 193behavior if ($mycount0000000 = = 0) {

one

two

three

. / orzdba-mysql-innodb_rows-C 500000-I 5\

-S / u01/tmp/mysql.sock\

-L / tmp/orzdba.log-logfile_by_day &

2. Use orzdba_report.py to analyze orzdba.log.xxxx-xx-xx files and generate reports

Orzdba_report.py source code: orzdba_report

one

Python orzdba_report.py orzdba.log.2016-02-21

At this point, I believe you have a deeper understanding of "orzdba example Analysis in Mysql tools". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report