SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
openark-kit
MySQL utilities for everyday use




            Shlomi Noach

        openark.org

                           O'Reilly MySQL Conference & Expo 2011
What is the openark-kit?
      openark-kit it a set of tools designed to ease
       some common MySQL tasks
         ●      Some of the tools simply automate common tasks
         ●      Others allow for MySQL auditing
         ●      Others still introduce new functionality to MySQL.
      All tools are standalone python scripts.
      openark-kit is developed and supported on the
       Linux operating system. There are ports for
       BSD and OS/X.

openark.org                                           openark-kit MySQL utilities for everyday use 2
Copyright © Shlomi Noach, 2011. All rights reserved
Openark-kit is an
                                      open source project
      The toolkit is release under the permissive New
       BSD License.
      Currently hosted by Google Code. Downloads
       and documentation on:
                http://code.openark.org/forge/openark-kit
                http://code.google.com/p/openarkkit/
      Looking for contributors!



openark.org                                           openark-kit MySQL utilities for everyday use 3
Copyright © Shlomi Noach, 2011. All rights reserved
Origin of openark-kit
      openark-kit is inspired by popular Maatkit.
      It follows similar naming conventions, command
       line options names, distribution concept, all in
       the hope and purpose of making a familiar
       environment.




openark.org                                           openark-kit MySQL utilities for everyday use 4
Copyright © Shlomi Noach, 2011. All rights reserved
Some openark-kit tools
      We discuss a few openark-kit tools
      A tool is written to solve a problem.
         ●      What kind of problems do openark-kit tools solve?
      We discuss issues in:
         ●      Auditing
         ●      General maintenance
         ●      Security
         ●      Massive, blocking operations


openark.org                                           openark-kit MySQL utilities for everyday use 5
Copyright © Shlomi Noach, 2011. All rights reserved
oak-hook-general-log
   Problem: you wish to log queries which are not using indexes.
      ●     You set log_queries_not_using_indexes=1
      ●     The slow log gets swamped with queries over very small queries,
            irrelevant to your problem.
   Problem: you wish to audit all queries using temporary tables.
      ●     This does not mean they're not using indexes
   Problem: you wish to audit queries iterating over 100,000 rows.
   Problem: you wish to only audit queries using a specific table
    or a specific index.
   Problem: you wish to audit queries answering for a
    combination of the above requirements.
   Problem: you wish to audit logins / logouts.
openark.org                                           openark-kit MySQL utilities for everyday use 6
Copyright © Shlomi Noach, 2011. All rights reserved
oak-hook-general-log
     Percona Server and MariaDB answer for most of the
      above (see Percona's Slow Query Log feature), or
      otherwise lay the basis for answering additional
      questions.
     Standard MySQL distribution does not answer for any
      of the above.
     oak-hook-general-log hooks up to a (>= 5.1) MySQL
      server and audits running queries in near real-time.
     Queries answering for input criteria are dumped to
      standard output.

openark.org                                           openark-kit MySQL utilities for everyday use 7
Copyright © Shlomi Noach, 2011. All rights reserved
oak-hook-general-log
      MySQL's general log contains much of the
       information required to solve above problems.
      General log can be directed at file or log tables,
       and is mostly turned off due to overwhelming
       amounts of entries.
      Sadly, it lacks some important information:
         ●      Both formats neglect to note the database context
         ●      File format only identifies account on login; but not
                on queries

openark.org                                           openark-kit MySQL utilities for everyday use 8
Copyright © Shlomi Noach, 2011. All rights reserved
oak-hook-general-log

                            Filtering criteria        SHOW PROCESSLIST




                                                             mysql.general_log
    oak-hook-general-log
                                                           EXPLAIN
                                                      Query execution plan


                Dump to standard output

openark.org                                            openark-kit MySQL utilities for everyday use 9
Copyright © Shlomi Noach, 2011. All rights reserved
oak-hook-general-log
     oak-hook-general-log enables general log on log
      tables for limited period.
     It cross-references log entries with the process list
      so as to identify database context (with fair
      chances of success due to asynchronous action).
     It rotates the general_log table so as to prevent it
      from filling up.
     It can evaluate query execution time on-the-fly.
     Whether to dump query or not may depend on
      output of query execution plan.
openark.org                                           openark-kit MySQL utilities for everyday use 10
Copyright © Shlomi Noach, 2011. All rights reserved
oak-prepare-shutdown
      Issue: MySQL must be restarted
         ●      Perhaps to make changes to variables such as
                innodb_buffer_pool_size to take effect.
         ●      Perhaps files should be moved around.
      Problem: restart takes a very long time.
      In the process of shutdown:
         ●      MySQL rejects any new incoming connections
         ●      But waits on all pending queries to complete
         ●      Then, InnoDB must flush dirty pages to disk
openark.org                                           openark-kit MySQL utilities for everyday use 11
Copyright © Shlomi Noach, 2011. All rights reserved
oak-prepare-shutdown
      oak-prepare-shutdown automates a popular
       solution:
         ●      Reduce innodb_max_dirty_pages_pct to zero.
         ●      Follow up on Innodb_buffer_pool_pages_dirty
                until no improvement is observed for 10 successive
                seconds.
      This allows MySQL to accept connections while
       flushing dirty pages.
      MySQL will be more I/O bound than before, but
       still there!
openark.org                                           openark-kit MySQL utilities for everyday use 12
Copyright © Shlomi Noach, 2011. All rights reserved
oak-prepare-shutdown

$ oak­prepare­shutdown && service mysql stop
­­ innodb_buffer_pool_pages_dirty: 79278
­­ innodb_buffer_pool_pages_dirty: 28113
­­ innodb_buffer_pool_pages_dirty: 1284
­­ No improvement from 1284
­­ No improvement from 1284
­­ No improvement from 1284
…
­­ No improvement from 1284
­­ No improvement from 1284
­­ Found no improvement for 10 successive 
attempts. Will now terminate
$ Stopping MySQL.........................[OK]

openark.org                                           openark-kit MySQL utilities for everyday use 13
Copyright © Shlomi Noach, 2011. All rights reserved
Security
      Openark kit provides with two tools to audit &
       control some security and privileges issues:
         ●      oak-security-audit
         ●      oak-block-account




openark.org                                                      openark-kit MySQL utilities for everyday use 14
Copyright © Shlomi Noach, 2011. All rights reserved
MySQL security model
     The MySQL security model is a simple hierarchal
      set of rules.
     GRANTS and passwords are associated on a
      per-account basis, and are created over the
      following constructs:
         ●     Entire domain
         ●     Databases (schemata)
         ●     Tables
         ●     Columns
         ●     Routines
openark.org                                           openark-kit MySQL utilities for everyday use 15
Copyright © Shlomi Noach, 2011. All rights reserved
MySQL security model
     Missing from the model:
        ●     The catalog level, above the schemata level.
        ●     LDAP/Kerberos integration (*MySQL 5.5 now supports
              pluggable authentication)
        ●     Roles
        ●     ...
     Missing functionality makes for management
      overhead. More accounts must be created, and
      explicitly associated with privileges.
     People look for shortcuts, thereby relaxing security.

openark.org                                           openark-kit MySQL utilities for everyday use 16
Copyright © Shlomi Noach, 2011. All rights reserved
oak-security-audit
      Common shortcut pattern:
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES
       ON xampp.* TO 'web_user'@'%.local';

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES 
       ON app.* TO 'web_user'@'%.local';

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES 
       ON interfaces.* TO 'web_user'@'%.local';
… the list goes on …

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES 
       ON analytics.* TO 'web_user'@'%.local';
… and on … 

Too much to type. Take a shortcut:
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES 
       ON *.* TO 'web_user'@'%.local';


openark.org                                              openark-kit MySQL utilities for everyday use 17
Copyright © Shlomi Noach, 2011. All rights reserved
oak-security-audit
   Many are familiar with the mysql_secure_installation tool.
   oak-security-audit brings much more to the table. Among other
    tests, it will:
      ●    Check for non-local root accounts, anonymous users, wild card host
           accounts
      ●    Look for accounts with empty passwords (implies no password required)
      ●    Look for different users sharing identical passwords
      ●    Report non-root accounts with complete grants; administrative
           privileges; write access to the mysql schema
      ●    Test general settings: look for sql_mode settings, old_passwords use.




openark.org                                              openark-kit MySQL utilities for everyday use 18
Copyright © Shlomi Noach, 2011. All rights reserved
oak-security-audit
$ oak­security­audit

­­ Auditing in strict level
­­ The following users are assumed as root: root
­­
­­ Looking for non local 'root' accounts
­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
­­ Found 1 non local 'root' accounts. Recommended actions:
RENAME USER 'root'@'remote' TO 'root'@'localhost';
­­
­­ Looking for anonymous user accounts
­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
­­ Passed
­­
­­ Looking for accounts accessible from any host
­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
­­ Found 1 accounts accessible from any host. Recommended actions:
RENAME USER 'foo'@'%' TO 'foo'@'<specific host>';
­­ ...


openark.org                                              openark-kit MySQL utilities for everyday use 19
Copyright © Shlomi Noach, 2011. All rights reserved
oak-block-account
      Most user authenticated systems have some
       form of user access blocking.
         ●      Due to repeating failed login attempts
         ●      Due to failed payment
         ●      Due to request for account freeze
      MySQL has no such notion.
      The mere fact an account exists allows for user
       login.
      No                    GRANT/REVOKE login ON *.*

openark.org                                           openark-kit MySQL utilities for everyday use 20
Copyright © Shlomi Noach, 2011. All rights reserved
oak-block-account
     We may wish to temporarily block an account due to
      abuse suspicion.
     Perhaps we wish to disable some modules in our
      system, which are not completely under our control.
     oak-block-account works around this limitation by
      changing account's password in such way that:
        ●     The account becomes inaccessible (no password will gain
              access).
        ●     The block is easily reversible.
        ●     At any point it is easy to deduce whether an account is
              blocked or not.
openark.org                                           openark-kit MySQL utilities for everyday use 21
Copyright © Shlomi Noach, 2011. All rights reserved
oak-block-account
root@mysql­5.1.51> SELECT user, host, password FROM mysql.user;
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| user        | host      | password                                  |
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| shlomi      | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| replication | 10.0.0.%  | *35CE0EA4EA6C6E962A01F70C121071AE5D38B517 |
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+


$ oak­block­account ­­account­user=shlomi  
    ­­account­host=localhost ­­block

root@mysql­5.1.51> SELECT user, host, password FROM mysql.user;
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| user        | host      | password                                  |
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+
| shlomi      | localhost | 9DA2AC2DE76CD7ADD8654EE50192347BE7384BB6* |
| replication | 10.0.0.%  | *35CE0EA4EA6C6E962A01F70C121071AE5D38B517 |
+­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+


openark.org                                           openark-kit MySQL utilities for everyday use 22
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
      Problem: company wishes to create a
       denormalized table, the combination of three
       large, static tables.
         ●      To populate new table, they issue:
                    INSERT INTO new_table 
                    SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…)


         ●      Three days later, they give up and hit Ctrl+C
      InnoDB transaction becomes huge.


openark.org                                             openark-kit MySQL utilities for everyday use 23
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
      InnoDB uses MVCC (Multi Version
       Concurrency Control) to manage concurrency,
       as well as allow for non blocking selects.
      A row may have concurrent versions of data.


                    Trx #2 modifies row
                                                                 Trx #1 reads table


                    Trx #3 modifies row
                    Changes not yet merged
                    into baseline
                                                      Baseline
openark.org                                                       openark-kit MySQL utilities for everyday use 24
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
   Long running transactions make for increasing number of non-
    merged versions, and eventually to increased locks.
   A long running transaction may be aborted at the last moment, in
    which case it must be able to rollback. It must store original data
    while manipulating it.
   A long running transaction will have to resort to disk at some point.
   oak-chunk-update breaks down queries to smaller chunks, executed
    in smaller transactions, with optional sleep time.
   Also note Maatkit's mk-archiver tool, for archiving/purging table rows.




openark.org                                             openark-kit MySQL utilities for everyday use 25
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
      In simplest invocation magic begins with query
       modification:
     $ oak­chunk­update ­­execute="INSERT INTO new_table 
       SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…) 
       WHERE OAK_CHUNK(t1)"

      The tool will break translate this query into
       many queries of the form:
     INSERT INTO new_table 
       SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…) 
       WHERE (t1.col >= …) AND (t1.col < …)



openark.org                                             openark-kit MySQL utilities for everyday use 26
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
     How does it work?
     oak-chunk-update requires a UNIQUE KEY on one
      of the tables. PK is best, others possible.
     It will automatically split (chunk) the table into
      smaller portions, e.g. of 1,000 rows, in ascending
      key order.
     It will execute the query with WHERE clause
      limiting to said rows.
     The key may actually be compound (over several
      columns)
openark.org                                             openark-kit MySQL utilities for everyday use 27
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
      A scarier example:
$ oak­chunk­update ­d sakila ­e "UPDATE film_actor SET 
last_update = DATE(last_update) WHERE OAK_CHUNK(film_actor)"

UPDATE film_actor SET last_update = DATE(last_update) 
WHERE
  (((film_actor.actor_id > @unique_key_range_start_0) OR    
  (((film_actor.actor_id = @unique_key_range_start_0)) AND     
  (film_actor.film_id > @unique_key_range_start_1)))
AND 
  ((film_actor.actor_id < @unique_key_range_end_0) OR   
  (((film_actor.actor_id = @unique_key_range_end_0)) AND     
  (film_actor.film_id < @unique_key_range_end_1)) OR   
  ((film_actor.actor_id = @unique_key_range_end_0) AND 
  (film_actor.film_id = @unique_key_range_end_1))))


openark.org                                             openark-kit MySQL utilities for everyday use 28
Copyright © Shlomi Noach, 2011. All rights reserved
oak-chunk-update
     Common usage:
        ●      Routine purging of old data
        ●      Copying data between tables
        ●      Updating data for a newly created column
        ●      Queries which are just too large for single transactions
     Benefits:
        ●      Smaller, faster transactions
        ●      Optional sleep time allows for spreading of total runtime,
               with chance for replication to catch up.
        ●      Optional hints to limit range, or auto-stop execution.
openark.org                                             openark-kit MySQL utilities for everyday use 29
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table
      BIG problem: you want to refactor a table; say,
       add a column:
ALTER TABLE forum_message ADD COLUMN is_private TINYINT;

      MySQL will lock down the table. No reads, no
       writes. Not even metadata.
      Effectively, on a “popular” table, this means
       database lockdown.



openark.org                                           openark-kit MySQL utilities for everyday use 30
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table
    Possible solution: use replication
       ●     Make ALTER TABLE on slave
       ●     Upgrade slave to master
       ●     Build new replication slave
    Better, use Master-Master replication
       ●     MMM for MySQL automates much of the plumbing.
    Cons:
       ●     You need additional servers
       ●     These servers will be (probably) inaccessible due to ALTER
             TABLE invocation.
       ●     Application will have to fail-over to secondary servers

openark.org                                           openark-kit MySQL utilities for everyday use 31
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table
     oak-alter-table uses similar approach of oak-chunk-
      update in breaking up your query into chunks.
     How can you split an ALTER statement?
        ●     By simulating it
        ●     Create a new, empty, “ghost” table
        ●     Execute ALTER on ghost table
        ●     Slowly synchronize between original table (T) and ghost
              table (G)
        ●     Throw away original table, rename ghost in its place.



openark.org                                           openark-kit MySQL utilities for everyday use 32
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table


                                                                      G (ghost)
                                                                      Created empty
                                    T (original table)                Reflects new schema




                                           AFTER triggers on T
                                     Propagate INSERT/DELETE/UPDATE




                                                                      Copy data




openark.org                                                             openark-kit MySQL utilities for everyday use 33
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table
     “Slowly synchronize between original table (T) and
      ghost table (G)”. How?
        ●     A lot of “magic” in onto play.
        ●     oak-online-alter-table creates “AFTER” triggers on table T.
        ●     Triggers propagate INSERT, UPDATE, DELETE statements
              onto G, in such way that they are ensured to succeed.
        ●     Getting range snapshot of T's unique key (i.e. PRIMARY
              KEY or other), the tool chunks that range (à la oak-chunk-
              update), and copies chunked rows to G.
        ●     Meanwhile, queries on T may actually modify or delete such
              rows. With relatively small, quick locks this concurrency
              problem can be solved.
openark.org                                           openark-kit MySQL utilities for everyday use 34
Copyright © Shlomi Noach, 2011. All rights reserved
oak-online-alter-table
      Note:
         ●      The tool is experimental!
         ●      Use of triggers makes for noticeable impact on
                overall performance.
         ●      Current limitation:
                        No support for foreign keys (can be lifted on child-side)
                        No AFTER triggers may exist (can be lifted in MySQL
                         5.1)
         ●      Other alternatives exist today, based on this tool.


openark.org                                                openark-kit MySQL utilities for everyday use 35
Copyright © Shlomi Noach, 2011. All rights reserved
Other noteworthy tools
    oak-repeat-query: repeat execution of a given query until
     either:
       ●     No more rows are affected
       ●     Predefined time has passed
       ●     Predefined number of iterations has passed
    oak-purge-master-logs: safely purge master's binary
     logs after consulting with slaves' positions.
    oak-show-limits: show AUTO_INCREMENT "free space"
    More...



openark.org                                           openark-kit MySQL utilities for everyday use 36
Copyright © Shlomi Noach, 2011. All rights reserved
Thank you!
      I blog at http://openark.org
      Find open source projects on
       http://code.openark.org/forge/
      Do you wish to participate in openark-kit or
       other tools development?
         ●      Contact me at shlomi@[you-know-where].org
      Questions?



openark.org                                                    openark-kit MySQL utilities for everyday use 37
Copyright © Shlomi Noach, 2011. All rights reserved

Weitere ähnliche Inhalte

Was ist angesagt?

MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015Dave Stokes
 
MySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAsMySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAsSveta Smirnova
 
Undelete (and more) rows from the binary log
Undelete (and more) rows from the binary logUndelete (and more) rows from the binary log
Undelete (and more) rows from the binary logFrederic Descamps
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagHow Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagJean-François Gagné
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationSveta Smirnova
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015Dave Stokes
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackSveta Smirnova
 
PNWPHP -- What are Databases so &#%-ing Difficult
PNWPHP -- What are Databases so &#%-ing DifficultPNWPHP -- What are Databases so &#%-ing Difficult
PNWPHP -- What are Databases so &#%-ing DifficultDave Stokes
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Andrejs Prokopjevs
 
Automated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirksAutomated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirksColin Charles
 
Pseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementPseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementShlomi Noach
 
MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksColin Charles
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreSujatha Sivakumar
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationManish Kumar
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminFrederic Descamps
 
MongoDB Engines: Demystified
MongoDB Engines: DemystifiedMongoDB Engines: Demystified
MongoDB Engines: DemystifiedSveta Smirnova
 

Was ist angesagt? (20)

MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015
 
MySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAsMySQL Replication Troubleshooting for Oracle DBAs
MySQL Replication Troubleshooting for Oracle DBAs
 
Undelete (and more) rows from the binary log
Undelete (and more) rows from the binary logUndelete (and more) rows from the binary log
Undelete (and more) rows from the binary log
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
How Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lagHow Booking.com avoids and deals with replication lag
How Booking.com avoids and deals with replication lag
 
Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it Back
 
PNWPHP -- What are Databases so &#%-ing Difficult
PNWPHP -- What are Databases so &#%-ing DifficultPNWPHP -- What are Databases so &#%-ing Difficult
PNWPHP -- What are Databases so &#%-ing Difficult
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
 
Automated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirksAutomated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirks
 
Pseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology ManagementPseudo GTID and Easy MySQL Replication Topology Management
Pseudo GTID and Easy MySQL Replication Topology Management
 
MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirks
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadmin
 
MongoDB Engines: Demystified
MongoDB Engines: DemystifiedMongoDB Engines: Demystified
MongoDB Engines: Demystified
 

Ähnlich wie openark-kit: MySQL utilities for everyday use

200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4Frazer Clement
 
1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivanIvan Tu
 
Oracle OpenWorld - Getting started with MySQL Cluster
Oracle OpenWorld - Getting started with MySQL ClusterOracle OpenWorld - Getting started with MySQL Cluster
Oracle OpenWorld - Getting started with MySQL ClusterBenedita Paúl Vasconcelos
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptxIvan Ma
 
My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015Sanjay Manwani
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMiguel Araújo
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1Ivan Ma
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Manuel Contreras
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance TuningMark Swarbrick
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech UpdatesRyusuke Kajiyama
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksDave Stokes
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015Mario Beck
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAsBen Krug
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...GeneXus
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014Dave Stokes
 

Ähnlich wie openark-kit: MySQL utilities for everyday use (20)

200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
200 million qps on commodity hardware : Getting started with MySQL Cluster 7.4
 
1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan1 my sql20151219-kaji_ivan
1 my sql20151219-kaji_ivan
 
Let's Start MySQL
Let's Start MySQLLet's Start MySQL
Let's Start MySQL
 
Oracle OpenWorld - Getting started with MySQL Cluster
Oracle OpenWorld - Getting started with MySQL ClusterOracle OpenWorld - Getting started with MySQL Cluster
Oracle OpenWorld - Getting started with MySQL Cluster
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 
My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
MySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQLMySQL Shell: The DevOps Tool for MySQL
MySQL Shell: The DevOps Tool for MySQL
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
 
NoSQL and MySQL
NoSQL and MySQLNoSQL and MySQL
NoSQL and MySQL
 
MySQL Manchester TT - Performance Tuning
MySQL Manchester TT  - Performance TuningMySQL Manchester TT  - Performance Tuning
MySQL Manchester TT - Performance Tuning
 
My sql8 innodb_cluster
My sql8 innodb_clusterMy sql8 innodb_cluster
My sql8 innodb_cluster
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates
 
MySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disksMySql's NoSQL -- best of both worlds on the same disks
MySql's NoSQL -- best of both worlds on the same disks
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
MySQL 20 años: pasado, presente y futuro; conoce las nuevas características d...
 
MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014MySQL 5.7 -- SCaLE Feb 2014
MySQL 5.7 -- SCaLE Feb 2014
 

Kürzlich hochgeladen

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Kürzlich hochgeladen (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

openark-kit: MySQL utilities for everyday use

  • 1. openark-kit MySQL utilities for everyday use Shlomi Noach openark.org O'Reilly MySQL Conference & Expo 2011
  • 2. What is the openark-kit?  openark-kit it a set of tools designed to ease some common MySQL tasks ● Some of the tools simply automate common tasks ● Others allow for MySQL auditing ● Others still introduce new functionality to MySQL.  All tools are standalone python scripts.  openark-kit is developed and supported on the Linux operating system. There are ports for BSD and OS/X. openark.org openark-kit MySQL utilities for everyday use 2 Copyright © Shlomi Noach, 2011. All rights reserved
  • 3. Openark-kit is an open source project  The toolkit is release under the permissive New BSD License.  Currently hosted by Google Code. Downloads and documentation on: http://code.openark.org/forge/openark-kit http://code.google.com/p/openarkkit/  Looking for contributors! openark.org openark-kit MySQL utilities for everyday use 3 Copyright © Shlomi Noach, 2011. All rights reserved
  • 4. Origin of openark-kit  openark-kit is inspired by popular Maatkit.  It follows similar naming conventions, command line options names, distribution concept, all in the hope and purpose of making a familiar environment. openark.org openark-kit MySQL utilities for everyday use 4 Copyright © Shlomi Noach, 2011. All rights reserved
  • 5. Some openark-kit tools  We discuss a few openark-kit tools  A tool is written to solve a problem. ● What kind of problems do openark-kit tools solve?  We discuss issues in: ● Auditing ● General maintenance ● Security ● Massive, blocking operations openark.org openark-kit MySQL utilities for everyday use 5 Copyright © Shlomi Noach, 2011. All rights reserved
  • 6. oak-hook-general-log  Problem: you wish to log queries which are not using indexes. ● You set log_queries_not_using_indexes=1 ● The slow log gets swamped with queries over very small queries, irrelevant to your problem.  Problem: you wish to audit all queries using temporary tables. ● This does not mean they're not using indexes  Problem: you wish to audit queries iterating over 100,000 rows.  Problem: you wish to only audit queries using a specific table or a specific index.  Problem: you wish to audit queries answering for a combination of the above requirements.  Problem: you wish to audit logins / logouts. openark.org openark-kit MySQL utilities for everyday use 6 Copyright © Shlomi Noach, 2011. All rights reserved
  • 7. oak-hook-general-log  Percona Server and MariaDB answer for most of the above (see Percona's Slow Query Log feature), or otherwise lay the basis for answering additional questions.  Standard MySQL distribution does not answer for any of the above.  oak-hook-general-log hooks up to a (>= 5.1) MySQL server and audits running queries in near real-time.  Queries answering for input criteria are dumped to standard output. openark.org openark-kit MySQL utilities for everyday use 7 Copyright © Shlomi Noach, 2011. All rights reserved
  • 8. oak-hook-general-log  MySQL's general log contains much of the information required to solve above problems.  General log can be directed at file or log tables, and is mostly turned off due to overwhelming amounts of entries.  Sadly, it lacks some important information: ● Both formats neglect to note the database context ● File format only identifies account on login; but not on queries openark.org openark-kit MySQL utilities for everyday use 8 Copyright © Shlomi Noach, 2011. All rights reserved
  • 9. oak-hook-general-log Filtering criteria SHOW PROCESSLIST mysql.general_log oak-hook-general-log EXPLAIN Query execution plan Dump to standard output openark.org openark-kit MySQL utilities for everyday use 9 Copyright © Shlomi Noach, 2011. All rights reserved
  • 10. oak-hook-general-log  oak-hook-general-log enables general log on log tables for limited period.  It cross-references log entries with the process list so as to identify database context (with fair chances of success due to asynchronous action).  It rotates the general_log table so as to prevent it from filling up.  It can evaluate query execution time on-the-fly.  Whether to dump query or not may depend on output of query execution plan. openark.org openark-kit MySQL utilities for everyday use 10 Copyright © Shlomi Noach, 2011. All rights reserved
  • 11. oak-prepare-shutdown  Issue: MySQL must be restarted ● Perhaps to make changes to variables such as innodb_buffer_pool_size to take effect. ● Perhaps files should be moved around.  Problem: restart takes a very long time.  In the process of shutdown: ● MySQL rejects any new incoming connections ● But waits on all pending queries to complete ● Then, InnoDB must flush dirty pages to disk openark.org openark-kit MySQL utilities for everyday use 11 Copyright © Shlomi Noach, 2011. All rights reserved
  • 12. oak-prepare-shutdown  oak-prepare-shutdown automates a popular solution: ● Reduce innodb_max_dirty_pages_pct to zero. ● Follow up on Innodb_buffer_pool_pages_dirty until no improvement is observed for 10 successive seconds.  This allows MySQL to accept connections while flushing dirty pages.  MySQL will be more I/O bound than before, but still there! openark.org openark-kit MySQL utilities for everyday use 12 Copyright © Shlomi Noach, 2011. All rights reserved
  • 14. Security  Openark kit provides with two tools to audit & control some security and privileges issues: ● oak-security-audit ● oak-block-account openark.org openark-kit MySQL utilities for everyday use 14 Copyright © Shlomi Noach, 2011. All rights reserved
  • 15. MySQL security model  The MySQL security model is a simple hierarchal set of rules.  GRANTS and passwords are associated on a per-account basis, and are created over the following constructs: ● Entire domain ● Databases (schemata) ● Tables ● Columns ● Routines openark.org openark-kit MySQL utilities for everyday use 15 Copyright © Shlomi Noach, 2011. All rights reserved
  • 16. MySQL security model  Missing from the model: ● The catalog level, above the schemata level. ● LDAP/Kerberos integration (*MySQL 5.5 now supports pluggable authentication) ● Roles ● ...  Missing functionality makes for management overhead. More accounts must be created, and explicitly associated with privileges.  People look for shortcuts, thereby relaxing security. openark.org openark-kit MySQL utilities for everyday use 16 Copyright © Shlomi Noach, 2011. All rights reserved
  • 17. oak-security-audit  Common shortcut pattern: mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES        ON xampp.* TO 'web_user'@'%.local'; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES         ON app.* TO 'web_user'@'%.local'; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES         ON interfaces.* TO 'web_user'@'%.local'; … the list goes on … mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES         ON analytics.* TO 'web_user'@'%.local'; … and on …  Too much to type. Take a shortcut: mysql> GRANT SELECT,INSERT,UPDATE,DELETE,EXECUTE,FILE,LOCK TABLES         ON *.* TO 'web_user'@'%.local'; openark.org openark-kit MySQL utilities for everyday use 17 Copyright © Shlomi Noach, 2011. All rights reserved
  • 18. oak-security-audit  Many are familiar with the mysql_secure_installation tool.  oak-security-audit brings much more to the table. Among other tests, it will: ● Check for non-local root accounts, anonymous users, wild card host accounts ● Look for accounts with empty passwords (implies no password required) ● Look for different users sharing identical passwords ● Report non-root accounts with complete grants; administrative privileges; write access to the mysql schema ● Test general settings: look for sql_mode settings, old_passwords use. openark.org openark-kit MySQL utilities for everyday use 18 Copyright © Shlomi Noach, 2011. All rights reserved
  • 19. oak-security-audit $ oak­security­audit ­­ Auditing in strict level ­­ The following users are assumed as root: root ­­ ­­ Looking for non local 'root' accounts ­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ­­ Found 1 non local 'root' accounts. Recommended actions: RENAME USER 'root'@'remote' TO 'root'@'localhost'; ­­ ­­ Looking for anonymous user accounts ­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ­­ Passed ­­ ­­ Looking for accounts accessible from any host ­­ ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ­­ Found 1 accounts accessible from any host. Recommended actions: RENAME USER 'foo'@'%' TO 'foo'@'<specific host>'; ­­ ... openark.org openark-kit MySQL utilities for everyday use 19 Copyright © Shlomi Noach, 2011. All rights reserved
  • 20. oak-block-account  Most user authenticated systems have some form of user access blocking. ● Due to repeating failed login attempts ● Due to failed payment ● Due to request for account freeze  MySQL has no such notion.  The mere fact an account exists allows for user login.  No GRANT/REVOKE login ON *.* openark.org openark-kit MySQL utilities for everyday use 20 Copyright © Shlomi Noach, 2011. All rights reserved
  • 21. oak-block-account  We may wish to temporarily block an account due to abuse suspicion.  Perhaps we wish to disable some modules in our system, which are not completely under our control.  oak-block-account works around this limitation by changing account's password in such way that: ● The account becomes inaccessible (no password will gain access). ● The block is easily reversible. ● At any point it is easy to deduce whether an account is blocked or not. openark.org openark-kit MySQL utilities for everyday use 21 Copyright © Shlomi Noach, 2011. All rights reserved
  • 22. oak-block-account root@mysql­5.1.51> SELECT user, host, password FROM mysql.user; +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | user        | host      | password                                  | +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | shlomi      | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | replication | 10.0.0.%  | *35CE0EA4EA6C6E962A01F70C121071AE5D38B517 | +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ $ oak­block­account ­­account­user=shlomi       ­­account­host=localhost ­­block root@mysql­5.1.51> SELECT user, host, password FROM mysql.user; +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | user        | host      | password                                  | +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | shlomi      | localhost | 9DA2AC2DE76CD7ADD8654EE50192347BE7384BB6* | | replication | 10.0.0.%  | *35CE0EA4EA6C6E962A01F70C121071AE5D38B517 | +­­­­­­­­­­­­­+­­­­­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ openark.org openark-kit MySQL utilities for everyday use 22 Copyright © Shlomi Noach, 2011. All rights reserved
  • 23. oak-chunk-update  Problem: company wishes to create a denormalized table, the combination of three large, static tables. ● To populate new table, they issue: INSERT INTO new_table  SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…) ● Three days later, they give up and hit Ctrl+C  InnoDB transaction becomes huge. openark.org openark-kit MySQL utilities for everyday use 23 Copyright © Shlomi Noach, 2011. All rights reserved
  • 24. oak-chunk-update  InnoDB uses MVCC (Multi Version Concurrency Control) to manage concurrency, as well as allow for non blocking selects.  A row may have concurrent versions of data. Trx #2 modifies row Trx #1 reads table Trx #3 modifies row Changes not yet merged into baseline Baseline openark.org openark-kit MySQL utilities for everyday use 24 Copyright © Shlomi Noach, 2011. All rights reserved
  • 25. oak-chunk-update  Long running transactions make for increasing number of non- merged versions, and eventually to increased locks.  A long running transaction may be aborted at the last moment, in which case it must be able to rollback. It must store original data while manipulating it.  A long running transaction will have to resort to disk at some point.  oak-chunk-update breaks down queries to smaller chunks, executed in smaller transactions, with optional sleep time.  Also note Maatkit's mk-archiver tool, for archiving/purging table rows. openark.org openark-kit MySQL utilities for everyday use 25 Copyright © Shlomi Noach, 2011. All rights reserved
  • 26. oak-chunk-update  In simplest invocation magic begins with query modification: $ oak­chunk­update ­­execute="INSERT INTO new_table    SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…)    WHERE OAK_CHUNK(t1)"  The tool will break translate this query into many queries of the form: INSERT INTO new_table    SELECT … FROM t1 JOIN t2 ON (…) JOIN t3 ON (…)    WHERE (t1.col >= …) AND (t1.col < …) openark.org openark-kit MySQL utilities for everyday use 26 Copyright © Shlomi Noach, 2011. All rights reserved
  • 27. oak-chunk-update  How does it work?  oak-chunk-update requires a UNIQUE KEY on one of the tables. PK is best, others possible.  It will automatically split (chunk) the table into smaller portions, e.g. of 1,000 rows, in ascending key order.  It will execute the query with WHERE clause limiting to said rows.  The key may actually be compound (over several columns) openark.org openark-kit MySQL utilities for everyday use 27 Copyright © Shlomi Noach, 2011. All rights reserved
  • 28. oak-chunk-update  A scarier example: $ oak­chunk­update ­d sakila ­e "UPDATE film_actor SET  last_update = DATE(last_update) WHERE OAK_CHUNK(film_actor)" UPDATE film_actor SET last_update = DATE(last_update)  WHERE   (((film_actor.actor_id > @unique_key_range_start_0) OR       (((film_actor.actor_id = @unique_key_range_start_0)) AND        (film_actor.film_id > @unique_key_range_start_1))) AND    ((film_actor.actor_id < @unique_key_range_end_0) OR      (((film_actor.actor_id = @unique_key_range_end_0)) AND        (film_actor.film_id < @unique_key_range_end_1)) OR      ((film_actor.actor_id = @unique_key_range_end_0) AND    (film_actor.film_id = @unique_key_range_end_1)))) openark.org openark-kit MySQL utilities for everyday use 28 Copyright © Shlomi Noach, 2011. All rights reserved
  • 29. oak-chunk-update  Common usage: ● Routine purging of old data ● Copying data between tables ● Updating data for a newly created column ● Queries which are just too large for single transactions  Benefits: ● Smaller, faster transactions ● Optional sleep time allows for spreading of total runtime, with chance for replication to catch up. ● Optional hints to limit range, or auto-stop execution. openark.org openark-kit MySQL utilities for everyday use 29 Copyright © Shlomi Noach, 2011. All rights reserved
  • 30. oak-online-alter-table  BIG problem: you want to refactor a table; say, add a column: ALTER TABLE forum_message ADD COLUMN is_private TINYINT;  MySQL will lock down the table. No reads, no writes. Not even metadata.  Effectively, on a “popular” table, this means database lockdown. openark.org openark-kit MySQL utilities for everyday use 30 Copyright © Shlomi Noach, 2011. All rights reserved
  • 31. oak-online-alter-table  Possible solution: use replication ● Make ALTER TABLE on slave ● Upgrade slave to master ● Build new replication slave  Better, use Master-Master replication ● MMM for MySQL automates much of the plumbing.  Cons: ● You need additional servers ● These servers will be (probably) inaccessible due to ALTER TABLE invocation. ● Application will have to fail-over to secondary servers openark.org openark-kit MySQL utilities for everyday use 31 Copyright © Shlomi Noach, 2011. All rights reserved
  • 32. oak-online-alter-table  oak-alter-table uses similar approach of oak-chunk- update in breaking up your query into chunks.  How can you split an ALTER statement? ● By simulating it ● Create a new, empty, “ghost” table ● Execute ALTER on ghost table ● Slowly synchronize between original table (T) and ghost table (G) ● Throw away original table, rename ghost in its place. openark.org openark-kit MySQL utilities for everyday use 32 Copyright © Shlomi Noach, 2011. All rights reserved
  • 33. oak-online-alter-table G (ghost) Created empty T (original table) Reflects new schema AFTER triggers on T Propagate INSERT/DELETE/UPDATE Copy data openark.org openark-kit MySQL utilities for everyday use 33 Copyright © Shlomi Noach, 2011. All rights reserved
  • 34. oak-online-alter-table  “Slowly synchronize between original table (T) and ghost table (G)”. How? ● A lot of “magic” in onto play. ● oak-online-alter-table creates “AFTER” triggers on table T. ● Triggers propagate INSERT, UPDATE, DELETE statements onto G, in such way that they are ensured to succeed. ● Getting range snapshot of T's unique key (i.e. PRIMARY KEY or other), the tool chunks that range (à la oak-chunk- update), and copies chunked rows to G. ● Meanwhile, queries on T may actually modify or delete such rows. With relatively small, quick locks this concurrency problem can be solved. openark.org openark-kit MySQL utilities for everyday use 34 Copyright © Shlomi Noach, 2011. All rights reserved
  • 35. oak-online-alter-table  Note: ● The tool is experimental! ● Use of triggers makes for noticeable impact on overall performance. ● Current limitation:  No support for foreign keys (can be lifted on child-side)  No AFTER triggers may exist (can be lifted in MySQL 5.1) ● Other alternatives exist today, based on this tool. openark.org openark-kit MySQL utilities for everyday use 35 Copyright © Shlomi Noach, 2011. All rights reserved
  • 36. Other noteworthy tools  oak-repeat-query: repeat execution of a given query until either: ● No more rows are affected ● Predefined time has passed ● Predefined number of iterations has passed  oak-purge-master-logs: safely purge master's binary logs after consulting with slaves' positions.  oak-show-limits: show AUTO_INCREMENT "free space"  More... openark.org openark-kit MySQL utilities for everyday use 36 Copyright © Shlomi Noach, 2011. All rights reserved
  • 37. Thank you!  I blog at http://openark.org  Find open source projects on http://code.openark.org/forge/  Do you wish to participate in openark-kit or other tools development? ● Contact me at shlomi@[you-know-where].org  Questions? openark.org openark-kit MySQL utilities for everyday use 37 Copyright © Shlomi Noach, 2011. All rights reserved