jayjanssen / myq_gadgets Goto Github PK
View Code? Open in Web Editor NEWmyq_gadgets is deprecated by myq-tools!
Home Page: https://github.com/jayjanssen/myq-tools/
License: Other
myq_gadgets is deprecated by myq-tools!
Home Page: https://github.com/jayjanssen/myq-tools/
License: Other
MySQL Gadgets Tools to help make life easier with MySQL. Note that you need to have some version of the mysql client, it's up to you to install it. All gadgets take mysql command like options (-u,-p,-h,-P), run with --help to see all options. Gadgets: - myq_status: Various views based on SHOW STATUS. Check http://dev.mysql.com/doc/refman/4.1/en/server-status-variables.html for details on what these numbers mean. Views: 'myisam' - myisam specific stats, including key buffer, lock waits 'commands' - Counts all 'Com_*' and outputs all commands run during each interval sorted descending by number of occurances. This should be a good indication if something is running that you are not aware of. 'coms' - Tabluar view of groups of common server commands. Not as complete as 'commands', but easier to read. 'qcache' - Info on query cache usage. 'cttf' - Connections, Threads, Tables, Files info. 'throughput' - Byes received/sent 'query' - useful for query tuning: Shows the Select_* and Sort_* metrics. Refer to the mysql doc above for info on how to interpret. 'temp' - Temporary table info. 'handler' -- Table handler stats. Good supplemental information to use with the 'query' view above.a Innodb views are based on the SHOW STATUS variables in 5.0 and up. For earlier MySQL versions use 'myq_innodb_status'. 'innodb' - an innodb summary view that tries to give an overall picture of the more important things happening in innodb. 'innodb_buffer_pool' -- all status variables regarding the innodb buffer pool. 'innodb_io' -- All things reading and writing, including buffer pool,'pages', 'data', and 'dblwr'. 'innodb_log' -- all transaction log related status. 'Innodb_log*' and 'Innodb_os_log*'. 'innodb_row' -- 'Innodb_row_lock*'. - myq_innodb_status: like iostat for innodb, connects to mysql and parses the output of SHOW INNODB STATUS at intervals (defaults 60 secs). Calculates changes for counter type variables. Tested with 4.1, works with 5.x but probably isn't as detailed as the innodb views in myq_status. Note that the data from this script is exclusively from SHOW INNODB STATUS, and the meaning of many metrics are not clear. Consult the MySQL Manual for all the available information on them. - myq_slave_info: Connects to the host given and checks SHOW SLAVE STATUS. Connects to the master host (using the same username and password as the slave) and does SHOW MASTER STATUS. Compares the binary log positions and reports the how far behind the IO and SQL threads are. Also reports replication delay. Standard Options: -u: mysql username -p: mysql password (leave blank to be prompted) -h: hostname of the mysql server -H: file with a list of hosts to use (instead of -h). -P: port to connect to (default: 3306) -r: repeat execution of the script (sometimes assumed by the script) -t: repeat after this many seconds NOTE: Further releases will have more tools.
whenever i run myq_status wsrep somehow the cluster size becomes 0 and doesn't recover until i do a restart of the node.
The node still behaves as it is fully connected except for the cluster size.
The output is similar to the following:
row Total Commands
11:42:08 270m select(153m) change_db(38m) set_option(29m) insert(13m) delete(10m) update(7.2m) replace(49k) drop_table(44k) show_status(11k) show_processlist(11k) show_variables(9.1k) show_binlogs(8.8k) show_engine_status(8.7k) show_slave_status(8.7k) show_storage_engines(8.6k) truncate(8.6k) begin(7.0k) show_fields(6.9k) create_table(5.2k) show_table_status(4.5k) insert_select(3.4k) admin_commands(3.1k) show_tables(2.2k) show_warnings(1.5k) show_create_table(1.3k) show_keys(441) show_function_status(319) show_procedure_status(319) show_events(317) show_databases(262) show_grants(59.0) show_master_status(57.0) commit(49.0) delete_multi(38.0) flush(23.0) unlock_tables(23.0) alter_table(19.0) show_engine_mutex(16.0) show_triggers(7.0) show_open_tables(6.0) create_trigger(3.0) show_plugins(3.0) drop_trigger(3.0) show_create_db(2.0) kill(2.0) drop_index(1.0) rename_table(1.0)
This is not as readable as the other views.
Hello
More a feature request than an issue :-)
Output gets very ugly on 5.6 Clusters:
./myq_status -u root -p ... wsrep
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
c1 / node1 (idx: 2) / Galera 3.7(r7f44a18)
Wsrep Cluster Node Repl Queue Ops Bytes Conflct Gcache Window Flow
time P cnf # Stat Laten Up Dn Up Dn Up Dn lcf bfa ist idx dst appl comm p_ms
08:51:02 P 108 3 Sync 236µs 0 0 10 314k 6.6K 0.5G 0 0 118k 85 38 1 1 9180Warning: Using a password on the command line interface can be insecure.
I altered MySQL_Script_Utils.pm quick and dirty:
from:
my @output = `echo "$sql" | mysql $user_str $pass_str $host_str $port_str`;
to:
my @output = `echo "$sql" | mysql --login-path=$user $host_str $port_str`;
Better:
./myq_status -u root wsrep
c1 / node (idx: 2) / Galera 3.7(r7f44a18)
Wsrep Cluster Node Repl Queue Ops Bytes Conflct Gcache Window Flow
time P cnf # Stat Laten Up Dn Up Dn Up Dn lcf bfa ist idx dst appl comm p_ms
08:56:08 P 108 3 Sync 253µs 0 0 10 315k 6.6K 0.5G 0 0 119k 73 21 1 1 9180
Perhaps the easiest way would be a --login-path command line option.
Hubertus
it would be awesome if you could create an GitHub release tag with the version number(s) from the change log. This would help me a lot to create a package from your fantastic scripts based on the version number.
Thanks a lot for your work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.