Cool MariaDB Plugins

15

Click here to load reader

Transcript of Cool MariaDB Plugins

Page 1: Cool MariaDB Plugins

Cool MariaDB PluginsColin Charles

[email protected] http://bytebot.net/blog/ | @bytebot on twitter

http://mariadb.org/ | http://mariadb.com/ MySQL NL User Group, Amsterdam, Netherlands

12 October 2015

Page 2: Cool MariaDB Plugins

SHOW PLUGINSMariaDB [(none)]> SHOW PLUGINS;

+-------------------------------+----------+--------------------+------------------------+---------+

| Name | Status | Type | Library | License |

+-------------------------------+----------+--------------------+------------------------+---------+

| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |

| USER_STATISTICS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |

| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |

| QUERY_RESPONSE_TIME_AUDIT | ACTIVE | AUDIT | query_response_time.so | GPL |

Page 3: Cool MariaDB Plugins

Great way to contribute• MySQL AB

• R.J.Silk, Sergei Golubchik

• Codership Oy

• Brian Aker, MySQL AB

• Percona and Sergei Golubchik

• Oracle Corporation

• Percona Inc.

• MariaDB Corporation

• Google Inc

• Sergei Golubchik

• Marc Alff, Oracle

• Monty Program Ab

• Mikael Ronstrom, MySQL AB

• Roberto Spadim, Spaempresarial - Brazil

• Patrick Galbraith

• Alexey Botchkov

• Percona and Sergey Vojtovich

• Alexey Botchkov (MariaDB Corporation)

• Sphinx developers

• Oracle Corp

• Denis Endro eperi GmbH

• Jonas Oreland

• Tokutek Inc

• Patrick Galbraith and Brian Aker, MySQL AB

• higuchi dot akira at dena dot jp

• Roland Bouman

• Nirbhay Choubey

• Horst Hunger

• Georgi Kodinov

• He Zhenxing

• The Mroonga project

• Brian Aker

• Kentoku Shiba

Page 4: Cool MariaDB Plugins

Getting started

• INSTALL PLUGIN plugin_name SONAME ‘plugin_library.so’

• INSTALL SONAME ‘plugin_library’

• mysql_plugin

• In MariaDB: INFORMATION_SCHEMA.ALL_PLUGINS

Page 5: Cool MariaDB Plugins

auth_socket

• Connect via the Unix socket

• CREATE USER monty IDENTIFIED VIA unix_socket;

• Debian/Ubuntu use this by default

• Listen to Otto’s talk

Page 6: Cool MariaDB Plugins

PAM Authentication

• INSTALL SONAME ‘auth_pam';

• CREATE USER username@hostname IDENTIFIED VIA pam;

• Dialog & “cleartext” (for MySQL client libraries)

• 2-factor authentication entirely possible

Page 7: Cool MariaDB Plugins

Password validation• INSTALL SONAME ‘simple_password_check.so';

• a password is required to be at least eight characters, and requires at least one digit, one uppercase character, one lowercase character, and one character that is neither a digit nor a letter.

• INSTALL SONAME 'cracklib_password_check';

Page 8: Cool MariaDB Plugins

SQL Error Logging• Collect errors sent to the client and have it sent to a log file

2015-10-12 13:12:54 msandbox[msandbox] @ localhost [] ERROR 1286: Unknown storage engine 'AMS' : CREATE TABLE test (id int) ENGINE=AMS

2015-10-12 13:17:06 msandbox[msandbox] @ localhost [] ERROR 1126: Can't open shared library '/home/byte/binaries/10.1.7/lib/plugin/sql_errorlog.so' (errno: 11, cannot open shared object file: No such file or directory) : install soname 'sql_errorlog'

Page 9: Cool MariaDB Plugins

Audit Plugin• INSTALL PLUGIN server_audit SONAME ‘server_audit';

• server_audit=FORCE_PLUS_PERMANENT

• 5 types of log records: CONNECTION, QUERY, TABLES, QUERY_DDL (filters CREATE, ALTER, etc.), QUERY_DML (filters INSERT, UPDATE, etc.)

• server_audit_events in my.cnf

• User filtering: server_audit_excl_users=monty

Page 10: Cool MariaDB Plugins

What’s in the query cache?

• See the contents of the query cache, in the I_S database, a new QUERY_CACHE_INFO table

• Acquires the query cache lock, so lock waits for queries using/expiring the cache

Page 11: Cool MariaDB Plugins

Query response time distribution

• Find a large number of queries that each take a very short amount of time to execute

• INSTALL SONAME ‘query_response_time';

• SHOW QUERY_RESPONSE_TIME;

• SET GLOBAL query_response_time_flush=1;

Page 12: Cool MariaDB Plugins

A few more…

• locales - list all compiled-in locales

• metadata_lock_info - show active metadata locks (lock modes, lock type, and table schema)

• wsrep_info - see WSREP_MEMBERSHIP, WSREP_STATUS

Page 13: Cool MariaDB Plugins

feedback=ON

Page 14: Cool MariaDB Plugins

Plugins are cool

• Don’t forget there’s also the enhanced semi-synchronous replication plugin

• SphinxSE is a pluggable “interface” that’s an engine that connects to a sphinx daemon for FTS

• And many engines come in as plugins

Page 15: Cool MariaDB Plugins

Thanks!Colin Charles

[email protected] http://bytebot.net/blog/ | @bytebot on twitter

http://mariadb.org/ | http://mariadb.com/ MySQL NL User Group, Amsterdam, Netherlands

12 October 2015