SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
MySQL Performance Monitoring
           with Zabbix

An alternative to the MySQL Enterprise 
                Monitor?

          by Oli Sennhauser

       oli.sennhauser@fromdual.com
           http://www.fromdual.com
               www.fromdual.com           1
How many of you ...
●   … monitor their database servers?
●   … monitor their (MySQL) databases?
●   … monitor performance metrics?
●   … all the others: Why not?




                    www.fromdual.com     2
Linux monitoring




●   Question: What is your favourite Linux monitoring 
    application?
●   1187 votes, April 2010
●   Manipulated?
●   Lit: Linux Journal, [1]
                          www.fromdual.com               3
What to monitor?
●   Devices / Software
    ●   Server, Router, Switches, I/O systems etc.
    ●   Operating System, Networks, Applications, etc.
●   Incidents
    ●   DB down, Replication stopped, Server not reachable, etc.
●   Critical Events
    ●   Disk more than n% full or less than m Gbyte free, 
        Replication more than n seconds lagging, Data node down, 
        100% CPU utilization, etc.
    → Alert, immediate intervention, fire fighting
                             www.fromdual.com                      4
What to monitor?
●   Trends (includes time!)
    → Graphs
●   How long does it take until …
    ●   … my disk is full?
    ●   … my Index Memory is filled up?
●   When does it happen?
    ●   Peak? Backup?
●   How often does it happen? Does it happen periodically?
    ●   Once a day? Always at Sunday night?
●   How does it correlate to other informations?
    ●   I/O problems during our backup window?
●   Reading the patterns!
    → this can help us to find the root cause of problems…
                                          www.fromdual.com   5
How to monitor?
●   Basic solutions:
    ●   top, vmstat, iostat, mytop, innotop, SHOW 
        GLOBAL STATUS, SHOW INNODB STATUS
    ●   CLI!, no graphs, no log term information, but 
        good for adhoc analysis!
●   Graphical solutions
    ●   Nagios, Cactii, Zabbix, …
    ●   Typically NOT specialised in DB monitoring...

                         www.fromdual.com                6
Focus
●   Database + Server
●   Trends


    Not the other stuff...


●   Problem:
    ●   Monitoring solutions are generic
    ●   A database is a specific application!
                           www.fromdual.com     7
MySQL monitoring




●   Question: What monitoring software do you use?
●   907 votes, January 2005
●   Pre­MySQL Enterprise Monitor era
●   Lit: MySQL, [1]
                        www.fromdual.com             8
The MySQL Enterprise Monitor [4]




             www.fromdual.com   9
The MySQL Enterprise Monitor
●   Pros
    ●   Tailored for MySQL
    ●   Easy install
    ●   Handy GUI
    ●   Query Analyser (caution!)
    ●   Replication Monitor
●   Cons
    ●   Only for paying customers
    ●   Proprietary code
    ●   Does NOT monitor MySQL Cluster yet [2], [3]
    ●   Very resource intensive (Java App Server!)
    ●   Future: Integration into Oracle Enterprise Manager???
    ●   MariaDB, Aria, XtraDB, PBXT, Drizzle, Sphinx SE, … ?
                                     www.fromdual.com           10
Kontrollbase [5]




              www.fromdual.com   11
Kontrollbase
●   Pros
    ●   Tailored for MySQL
    ●   Lightweight application (PHP)
    ●   Open Source (New BSD)
    ●   Easy install ???
    ●   Replication Monitor
●   Cons
    ●   Did not work for me (non default installations :­( )!
    ●   Answer from developer: “it works for me and my customers...”
    ●   Found a few “bugs”.
    ●   Does NOT monitor MySQL Cluster?
    ●   Query Analyser
    ●   MariaDB, Aria, XtraDB, PBXT, Drizzle, Sphinx SE, … ?
                                        www.fromdual.com               12
And now?
●   MEM → €€€ → nogo
●   Kontrollbase → no work → nogo
●   Self written? → no time → nogo
●   Nagios? → complicated? Shudder... → nogo
●   Other solutions?


●   A friend told me that he will evaluate
    Zabbix for monitoring MySQL...
                       www.fromdual.com        13
Zabbix [6]
    It claims: [7]                                   ●   Commercial support
                                                             Annual support agreements
                                                         ●


                                                         ●   Trouble­free deployment
●   All in one solution                                  ●   Professional Services

    ●   Open Source                                      ●   Technical Account Manager
                                                             Zabbix Training
    ●   Performance monitoring                           ●


                                                             Upgrade Services
        Agents for all platforms
                                                         ●
    ●


    ●   Availability and SLA reporting
    ●   Collection of any data
    ●   Great graphs and network maps
                                                         etc, etc... Wow!
●   Scalability
    ●   Up­to 100k monitored devices
    ●   Up­to 1M of metrics
    ●   Thousands of checks per second
    ●   Small to large distributed setups
    ●   Easy maintenance

                                            www.fromdual.com                             14
Zabbix architecture
●    Zabbix is a typical Agent – Server set­up:
  zabbix_       zabbix_          zabbix_      zabbix_                       zabbix_
agentd.conf   agentd.conf       proxy.conf   proxy.log                    server.conf        Web browser
                                                                        zabbix_
     zabbix_
      zabbix_                        zabbix_
       zabbix_
                                                                       server.log       Server A       Server C
     agentd
      agentd                          proxy
       agentd                                                                            zabbix_         Apache
                                                                                          server
    Server Z                                                                                                  PHP
                                                                                        zabbix_get

                  zabbix_
                  agentd                                                                Server B
                                 zabbix_

                       Device
                                 sender                                                       Repository
                      Device
     MySQL
                     Device                                                                    Database
                                                                                                  (MySQL,
    Database           Application
                      Application                                                               PostgreSQL,
                     Application
                                                                                                   Oracle,
                                                                                                  SQLlite)


                                                    www.fromdual.com                                                15
Installation of Zabbix
●   Download
    ●   http://www.zabbix.com/download.php
    ●   Server (Source only, for Linux and Windows only)
    ●   Agent (Binaries for: AIX, FreeBSD, HP­UX, Linux, OpenBSD, Solaris, 
        Windows)
    ●   Packages from your favourite Linux Distro
●   Documentation
    ●   http://www.zabbix.com/documentation/1.8/manual/installation
    ●   http://www.howtoforge.com/zabbix_network_monitoring
●   Recommendation:
    ●   One thing after the other
    ●   Server first, Web interface next, then agents
                                    www.fromdual.com                          16
Install Zabbix server
●   Create zabbix user
●   Untar source tarball
●   Create zabbix database and populate it
    ●   A MySQL (PostgreSQL, …) installation is needed...
●   ./configure ; make ; make install
    ●   Some packages may be missing...
    ●   Does not take too long (< 10 min)
●   Create configuration file for zabbix server
    ●   (misc/conf/zabbix_server.conf)
●   Start the zabbix server
                               www.fromdual.com             17
Install the Zabbix web interface
●   Apache/PHP is required
●   Copy PHP files to $DocumentRoot/zabbix
●   http://localhost/zabbix
●   Change php.ini
    ●   Default settings are by
        far not enough!
    ●   date.timezone =
        Europe/Zurich
●   Restart webserver
●   Finish configuration
●   Login with admin/zabbix
                                  www.fromdual.com   18
The Zabbix Web Interface
●   It works!




                www.fromdual.com   19
The Zabbix agent
●   Either from compiling or use the provided 
    binary
●   Create zabbix user
●   Create configuration file for zabbix agent
    ●   (misc/conf/zabbix_agentd.conf)
●   Start the zabbix agent
    ●   Use zabbix_agentd NOT zabbix_agent
    ●   Also install an agent on the server machine!
                         www.fromdual.com              20
The Zabbix Agent
●   And now… Hurray!
●   Ups, it does NOT work :­(
●   Configuration →
    Hosts → Status →
    Click on “Not Moni­
    tored” to enable...
●   Happened sometimes
    to me
●   Patience helps...
                        www.fromdual.com   21
We want Graphs!




            www.fromdual.com   22
Screens




          www.fromdual.com   23
Latest data




              www.fromdual.com   24
The database
●   Nice, but what about my Database?

    # /etc/zabbix/zabbix_agentd.conf

    ### Set of parameters for monitoring MySQL server (v3.23.42 and later)
    ### Change ­u<username> and add ­p<password> if required
    #UserParameter=mysql.ping,mysqladmin ­uroot ping|grep alive|wc ­l
    #UserParameter=mysql.uptime,mysqladmin ­uroot status|cut ­f2 ­d":"|cut ­f1 ­d"T"
    #UserParameter=mysql.threads,mysqladmin ­uroot status|cut ­f3 ­d":"|cut ­f1 ­d"Q"
    #UserParameter=mysql.questions,mysqladmin ­uroot status|cut ­f4 ­d":"|cut ­f1 ­d"S"
    #UserParameter=mysql.slowqueries,mysqladmin ­uroot status|cut ­f5 ­d":"|cut ­f1 ­d"O"
    #UserParameter=mysql.qps,mysqladmin ­uroot status|cut ­f9 ­d":"
    #UserParameter=mysql.version,mysql ­V



●   Enable those and restart the agent...
●   → Nothing will happen!
●   We have to add a template to the server first
    ●   Template_App_MySQL
                                          www.fromdual.com                                  25
MySQL Latest Data




            www.fromdual.com   26
MySQL Queries per second




            www.fromdual.com   27
st
1  impression
●    Not really much data for MySQL :­(
●    No efficient gathering method
●    No nice graphs
●    Is that all?

     → Zabbix seems to be very flexible, so let's 
     do it ourself!

                      www.fromdual.com               28
Requirements
●   Fit into Zabbix architecture
●   Must support several mysqld per server
●   Should provide much more information
●   Must support other Storage Engines as well
    ●   MySQL Cluster, XtraDB, Aria, PBXT, Sphinx SE
●   Simple
●   Flexible
●   Modular
●   Work on Unixoides (and Windows?)
                            www.fromdual.com           29
FromDual Performance Monitor 
for MySQL / Zabbix Architecture




             www.fromdual.com     30
Available modules [10]
●   Aria (for Aria SE, ex. Maria SE (crash­safe MyISAM))
●   InnoDB (commercial)
●   Master (for Master – Slave replication)
●   MyISAM (for MyISAM SE)
●   MySQL (non SE related stuff for MariaDB and MySQL)
●   NDB (commercial, for MySQL Cluster SE, pre 7.1 and 7.1)
●   PBXT (for PBXT SE)
●   Process (for UNIX processes)
●   Slave (for Master – Slave replication)
●   XtraDB (for XtraDB SE (derivat of InnoDB)) 
●   Sphinx (for the Sphinx SE plug­in (in planning)
●   Other modules on request...
                                   www.fromdual.com           31
FromDual Monitor for Zabbix
●   Install Zabbix as described before.
●   Download FromDual Performance Monitor for MySQL [9]
●   Read installation documentation [10]
●   Load the FromDual templates
●   Create a host group (optional)
●   Create a host (= database!)
    ●   Careful! Hostname MUST match the name in the FromDual agent configuration file!!!
●   Link the chosen templates to the host
●   Configure FromDual agent
●   Hook FromDual agent into Zabbix agent:

           # /etc/zabbix/zabbix_agentd.conf

           UserParameter=FromDual.MySQL.check,/etc/zabbix/FromDualMySQLagent.pl 
           /etc/zabbix/FromDualMySQLagent.conf

●   Restart Zabbix agent

                                            www.fromdual.com                                32
Templates




            www.fromdual.com   33
Host configuration




             www.fromdual.com   34
Overview / Dashboard




            www.fromdual.com   35
Triggers




           www.fromdual.com   36
Events




         www.fromdual.com   37
Latest data




              www.fromdual.com   38
Raw graph from latest data




             www.fromdual.com   39
Maps for scale­out set­ups




             www.fromdual.com   40
Screen for MySQL Cluster




             www.fromdual.com   41
Graph (MySQL Network traffic)




             www.fromdual.com   42
Graph (MySQL statements)




            www.fromdual.com   43
Screen (InnoDB buffer pool)




             www.fromdual.com   44
Graph (PBXT file read/write)




              www.fromdual.com   45
Problems / Discussion
●   One can do nearly everything (!)
●   It is a lot of work until everything is in place.
●   The whole set­up is tricky and needs some time until understood.
●   It is not so smooth like MEM. Installation is more labourish.
●   There is no Query Analyser (QUAN) yet. Zabbix developer say it could be 
    possible with v2.0!
●   Usability is not perfect yet (links are not ending up where I expect it).
●   No binaries available for server, only commercial!
●   Installation docu is not fool­prove?
●   Needs some experience to find problems
    → but, its cool, give it a try if you have no solution in place yet!


                                    www.fromdual.com                            46
Literature
●   [1] MySQL Monitoring solutions: http://www.fromdual.com/mysql­monitoring­solutions
●   [2] Cluster Monitoring CMON: 
    http://johanandersson.blogspot.com/2008/08/cluster­monitoring­cmon.html
●   [3] Configure MySQL Enterprise Monitor to monitor MySQL Cluster: 
    http://www.clusterdb.com/mysql­cluster/configure­mysql­enterprise­monitor­to­monitor­mysql­cluster/
●   [4] The MySQL Enterprise Monitor: http://www.mysql.com/products/enterprise/monitor.html
●   [5] Kontrollbase: http://kontrollsoft.com/software­kontrollbase, 
    http://code.google.com/p/kontrollbase/
●   [6] Zabbix: http://www.zabbix.org/
●   [7] Zabbix features: http://www.zabbix.org/features.php
●   [8] Zabbix documentation: http://www.zabbix.com/documentation.php
●   [9] Download MySQL Performance Monitor: http://www.fromdual.com/download
●   [10] Installation documentation: http://www.fromdual.com/mysql­performance­monitor




                                            www.fromdual.com                                    47

Contenu connexe

Tendances

Tendances (20)

Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
 
Monitoramento Enterprise com Zabbix+RHEL
Monitoramento Enterprise com Zabbix+RHELMonitoramento Enterprise com Zabbix+RHEL
Monitoramento Enterprise com Zabbix+RHEL
 
Fluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at ScaleFluent Bit: Log Forwarding at Scale
Fluent Bit: Log Forwarding at Scale
 
Zabbix introduction ( RadixCloud Radix Technologies SA)
Zabbix introduction ( RadixCloud Radix Technologies SA)Zabbix introduction ( RadixCloud Radix Technologies SA)
Zabbix introduction ( RadixCloud Radix Technologies SA)
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
Alexei Vladishev - Zabbix - Monitoring Solution for Everyone
Alexei Vladishev - Zabbix - Monitoring Solution for EveryoneAlexei Vladishev - Zabbix - Monitoring Solution for Everyone
Alexei Vladishev - Zabbix - Monitoring Solution for Everyone
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
Monitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia Ladislau
Monitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia LadislauMonitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia Ladislau
Monitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia Ladislau
 
Zabbix e o Mistério das Expressões Regulares
Zabbix e o Mistério das Expressões RegularesZabbix e o Mistério das Expressões Regulares
Zabbix e o Mistério das Expressões Regulares
 
Lambda Architecture in the Cloud with Azure Databricks with Andrei Varanovich
Lambda Architecture in the Cloud with Azure Databricks with Andrei VaranovichLambda Architecture in the Cloud with Azure Databricks with Andrei Varanovich
Lambda Architecture in the Cloud with Azure Databricks with Andrei Varanovich
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELK
 
Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0
 
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
 
Weblogic
WeblogicWeblogic
Weblogic
 
ELK introduction
ELK introductionELK introduction
ELK introduction
 
Grafana
GrafanaGrafana
Grafana
 

En vedette

Zabbix 2.0 - New Features and Improvements
Zabbix 2.0 - New Features and ImprovementsZabbix 2.0 - New Features and Improvements
Zabbix 2.0 - New Features and Improvements
Zabbix
 
VMware vSphere technical presentation
VMware vSphere technical presentationVMware vSphere technical presentation
VMware vSphere technical presentation
aleyeldean
 

En vedette (20)

How to Monitor MySQL
How to Monitor MySQLHow to Monitor MySQL
How to Monitor MySQL
 
Zabbix monitoring in 5 pictures
Zabbix monitoring in 5 pictures  Zabbix monitoring in 5 pictures
Zabbix monitoring in 5 pictures
 
ChinaNetCloud - Zabbix Monitoring System Overview
ChinaNetCloud - Zabbix Monitoring System OverviewChinaNetCloud - Zabbix Monitoring System Overview
ChinaNetCloud - Zabbix Monitoring System Overview
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
Monitoring all Elements of Your Database Operations With Zabbix
Monitoring all Elements of Your Database Operations With ZabbixMonitoring all Elements of Your Database Operations With Zabbix
Monitoring all Elements of Your Database Operations With Zabbix
 
Zabbix 3.0 and beyond - FISL 2015
Zabbix 3.0 and beyond - FISL 2015Zabbix 3.0 and beyond - FISL 2015
Zabbix 3.0 and beyond - FISL 2015
 
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
ChinaNetCloud - The Zabbix Database - Zabbix Conference 2014
 
Zabbix 2014 Conference : Implementing Zabbix in large Banking Environment
Zabbix 2014 Conference : Implementing Zabbix in large Banking EnvironmentZabbix 2014 Conference : Implementing Zabbix in large Banking Environment
Zabbix 2014 Conference : Implementing Zabbix in large Banking Environment
 
Zabbix
Zabbix Zabbix
Zabbix
 
Zabbix in PPTV
Zabbix in PPTVZabbix in PPTV
Zabbix in PPTV
 
Zabbix 2.0 - New Features and Improvements
Zabbix 2.0 - New Features and ImprovementsZabbix 2.0 - New Features and Improvements
Zabbix 2.0 - New Features and Improvements
 
Using Zabbix API from Drupal
Using Zabbix API from DrupalUsing Zabbix API from Drupal
Using Zabbix API from Drupal
 
Reporting Large Environment Zabbix Database
Reporting Large Environment Zabbix DatabaseReporting Large Environment Zabbix Database
Reporting Large Environment Zabbix Database
 
The hidden power of network maps on Zabbix
The hidden power of network maps on ZabbixThe hidden power of network maps on Zabbix
The hidden power of network maps on Zabbix
 
MySQL Monitoring Shoot Out
MySQL Monitoring Shoot OutMySQL Monitoring Shoot Out
MySQL Monitoring Shoot Out
 
Zabbix Performance Tuning
Zabbix Performance TuningZabbix Performance Tuning
Zabbix Performance Tuning
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
VMware vSphere 5.1 Overview
VMware vSphere 5.1 OverviewVMware vSphere 5.1 Overview
VMware vSphere 5.1 Overview
 
VMware vSphere technical presentation
VMware vSphere technical presentationVMware vSphere technical presentation
VMware vSphere technical presentation
 
VMware Presentation
VMware PresentationVMware Presentation
VMware Presentation
 

Similaire à MySQL Monitoring with Zabbix

Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Opersys inc.
 
LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprint
hastexo
 
гибридная облачная модель на базе System center 2012 sp1
гибридная облачная модель на базе System center 2012 sp1гибридная облачная модель на базе System center 2012 sp1
гибридная облачная модель на базе System center 2012 sp1
Expolink
 

Similaire à MySQL Monitoring with Zabbix (20)

mtl_rubykaigi
mtl_rubykaigimtl_rubykaigi
mtl_rubykaigi
 
The New MariaDB Offering: MariaDB 10, MaxScale and More
The New MariaDB Offering: MariaDB 10, MaxScale and MoreThe New MariaDB Offering: MariaDB 10, MaxScale and More
The New MariaDB Offering: MariaDB 10, MaxScale and More
 
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit FrameworkUnmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework
 
Alexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With ZabbixAlexei vladishev - Open Source Monitoring With Zabbix
Alexei vladishev - Open Source Monitoring With Zabbix
 
PostgreSQL and MySQL
PostgreSQL and MySQLPostgreSQL and MySQL
PostgreSQL and MySQL
 
Monitoring your VM's at Scale
Monitoring your VM's at ScaleMonitoring your VM's at Scale
Monitoring your VM's at Scale
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprint
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and more
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
MariaDB 10 and Beyond
MariaDB 10 and BeyondMariaDB 10 and Beyond
MariaDB 10 and Beyond
 
Practice and challenges from building IaaS
Practice and challenges from building IaaSPractice and challenges from building IaaS
Practice and challenges from building IaaS
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
 
MariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UN
MariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UNMariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UN
MariaDB 10.2 & MariaDB 10.1 by Michael Monty Widenius at Database Camp 2016 @ UN
 
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
 
гибридная облачная модель на базе System center 2012 sp1
гибридная облачная модель на базе System center 2012 sp1гибридная облачная модель на базе System center 2012 sp1
гибридная облачная модель на базе System center 2012 sp1
 
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012Hands on Virtualization with Ganeti (part 1)  - LinuxCon 2012
Hands on Virtualization with Ganeti (part 1) - LinuxCon 2012
 
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
Como creamos QuestDB Cloud, un SaaS basado en Kubernetes alrededor de QuestDB...
 
OSMC 2012 | Zabbix 2.0: Even Better by Rihards Olups
OSMC 2012 | Zabbix 2.0: Even Better by Rihards OlupsOSMC 2012 | Zabbix 2.0: Even Better by Rihards Olups
OSMC 2012 | Zabbix 2.0: Even Better by Rihards Olups
 

Plus de FromDual GmbH

Plus de FromDual GmbH (20)

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?
 
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New Features
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New Features
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New Features
 
PERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaPERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schema
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA's
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/Recovery
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und Cluster
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA's
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für Entwickler
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprints
 
High-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQLHigh-availability with Galera Cluster for MySQL
High-availability with Galera Cluster for MySQL
 
MySQL always-up with Galera Cluster
MySQL always-up with Galera ClusterMySQL always-up with Galera Cluster
MySQL always-up with Galera Cluster
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

MySQL Monitoring with Zabbix

  • 1. MySQL Performance Monitoring with Zabbix An alternative to the MySQL Enterprise  Monitor? by Oli Sennhauser oli.sennhauser@fromdual.com http://www.fromdual.com www.fromdual.com 1
  • 2. How many of you ... ● … monitor their database servers? ● … monitor their (MySQL) databases? ● … monitor performance metrics? ● … all the others: Why not? www.fromdual.com 2
  • 3. Linux monitoring ● Question: What is your favourite Linux monitoring  application? ● 1187 votes, April 2010 ● Manipulated? ● Lit: Linux Journal, [1] www.fromdual.com 3
  • 4. What to monitor? ● Devices / Software ● Server, Router, Switches, I/O systems etc. ● Operating System, Networks, Applications, etc. ● Incidents ● DB down, Replication stopped, Server not reachable, etc. ● Critical Events ● Disk more than n% full or less than m Gbyte free,  Replication more than n seconds lagging, Data node down,  100% CPU utilization, etc. → Alert, immediate intervention, fire fighting www.fromdual.com 4
  • 5. What to monitor? ● Trends (includes time!) → Graphs ● How long does it take until … ● … my disk is full? ● … my Index Memory is filled up? ● When does it happen? ● Peak? Backup? ● How often does it happen? Does it happen periodically? ● Once a day? Always at Sunday night? ● How does it correlate to other informations? ● I/O problems during our backup window? ● Reading the patterns! → this can help us to find the root cause of problems… www.fromdual.com 5
  • 6. How to monitor? ● Basic solutions: ● top, vmstat, iostat, mytop, innotop, SHOW  GLOBAL STATUS, SHOW INNODB STATUS ● CLI!, no graphs, no log term information, but  good for adhoc analysis! ● Graphical solutions ● Nagios, Cactii, Zabbix, … ● Typically NOT specialised in DB monitoring... www.fromdual.com 6
  • 7. Focus ● Database + Server ● Trends Not the other stuff... ● Problem: ● Monitoring solutions are generic ● A database is a specific application! www.fromdual.com 7
  • 8. MySQL monitoring ● Question: What monitoring software do you use? ● 907 votes, January 2005 ● Pre­MySQL Enterprise Monitor era ● Lit: MySQL, [1] www.fromdual.com 8
  • 10. The MySQL Enterprise Monitor ● Pros ● Tailored for MySQL ● Easy install ● Handy GUI ● Query Analyser (caution!) ● Replication Monitor ● Cons ● Only for paying customers ● Proprietary code ● Does NOT monitor MySQL Cluster yet [2], [3] ● Very resource intensive (Java App Server!) ● Future: Integration into Oracle Enterprise Manager??? ● MariaDB, Aria, XtraDB, PBXT, Drizzle, Sphinx SE, … ? www.fromdual.com 10
  • 11. Kontrollbase [5] www.fromdual.com 11
  • 12. Kontrollbase ● Pros ● Tailored for MySQL ● Lightweight application (PHP) ● Open Source (New BSD) ● Easy install ??? ● Replication Monitor ● Cons ● Did not work for me (non default installations :­( )! ● Answer from developer: “it works for me and my customers...” ● Found a few “bugs”. ● Does NOT monitor MySQL Cluster? ● Query Analyser ● MariaDB, Aria, XtraDB, PBXT, Drizzle, Sphinx SE, … ? www.fromdual.com 12
  • 13. And now? ● MEM → €€€ → nogo ● Kontrollbase → no work → nogo ● Self written? → no time → nogo ● Nagios? → complicated? Shudder... → nogo ● Other solutions? ● A friend told me that he will evaluate Zabbix for monitoring MySQL... www.fromdual.com 13
  • 14. Zabbix [6] It claims: [7] ● Commercial support Annual support agreements ● ● Trouble­free deployment ● All in one solution ● Professional Services ● Open Source ● Technical Account Manager Zabbix Training ● Performance monitoring ● Upgrade Services Agents for all platforms ● ● ● Availability and SLA reporting ● Collection of any data ● Great graphs and network maps etc, etc... Wow! ● Scalability ● Up­to 100k monitored devices ● Up­to 1M of metrics ● Thousands of checks per second ● Small to large distributed setups ● Easy maintenance www.fromdual.com 14
  • 15. Zabbix architecture ● Zabbix is a typical Agent – Server set­up: zabbix_ zabbix_ zabbix_ zabbix_ zabbix_ agentd.conf agentd.conf proxy.conf proxy.log server.conf Web browser zabbix_ zabbix_ zabbix_ zabbix_ zabbix_ server.log Server A Server C agentd agentd proxy agentd zabbix_ Apache server Server Z PHP zabbix_get zabbix_ agentd Server B zabbix_ Device sender Repository Device MySQL Device Database (MySQL, Database Application Application PostgreSQL, Application Oracle, SQLlite) www.fromdual.com 15
  • 16. Installation of Zabbix ● Download ● http://www.zabbix.com/download.php ● Server (Source only, for Linux and Windows only) ● Agent (Binaries for: AIX, FreeBSD, HP­UX, Linux, OpenBSD, Solaris,  Windows) ● Packages from your favourite Linux Distro ● Documentation ● http://www.zabbix.com/documentation/1.8/manual/installation ● http://www.howtoforge.com/zabbix_network_monitoring ● Recommendation: ● One thing after the other ● Server first, Web interface next, then agents www.fromdual.com 16
  • 17. Install Zabbix server ● Create zabbix user ● Untar source tarball ● Create zabbix database and populate it ● A MySQL (PostgreSQL, …) installation is needed... ● ./configure ; make ; make install ● Some packages may be missing... ● Does not take too long (< 10 min) ● Create configuration file for zabbix server ● (misc/conf/zabbix_server.conf) ● Start the zabbix server www.fromdual.com 17
  • 18. Install the Zabbix web interface ● Apache/PHP is required ● Copy PHP files to $DocumentRoot/zabbix ● http://localhost/zabbix ● Change php.ini ● Default settings are by far not enough! ● date.timezone = Europe/Zurich ● Restart webserver ● Finish configuration ● Login with admin/zabbix www.fromdual.com 18
  • 19. The Zabbix Web Interface ● It works! www.fromdual.com 19
  • 20. The Zabbix agent ● Either from compiling or use the provided  binary ● Create zabbix user ● Create configuration file for zabbix agent ● (misc/conf/zabbix_agentd.conf) ● Start the zabbix agent ● Use zabbix_agentd NOT zabbix_agent ● Also install an agent on the server machine! www.fromdual.com 20
  • 21. The Zabbix Agent ● And now… Hurray! ● Ups, it does NOT work :­( ● Configuration → Hosts → Status → Click on “Not Moni­ tored” to enable... ● Happened sometimes to me ● Patience helps... www.fromdual.com 21
  • 22. We want Graphs! www.fromdual.com 22
  • 23. Screens www.fromdual.com 23
  • 24. Latest data www.fromdual.com 24
  • 25. The database ● Nice, but what about my Database? # /etc/zabbix/zabbix_agentd.conf ### Set of parameters for monitoring MySQL server (v3.23.42 and later) ### Change ­u<username> and add ­p<password> if required #UserParameter=mysql.ping,mysqladmin ­uroot ping|grep alive|wc ­l #UserParameter=mysql.uptime,mysqladmin ­uroot status|cut ­f2 ­d":"|cut ­f1 ­d"T" #UserParameter=mysql.threads,mysqladmin ­uroot status|cut ­f3 ­d":"|cut ­f1 ­d"Q" #UserParameter=mysql.questions,mysqladmin ­uroot status|cut ­f4 ­d":"|cut ­f1 ­d"S" #UserParameter=mysql.slowqueries,mysqladmin ­uroot status|cut ­f5 ­d":"|cut ­f1 ­d"O" #UserParameter=mysql.qps,mysqladmin ­uroot status|cut ­f9 ­d":" #UserParameter=mysql.version,mysql ­V ● Enable those and restart the agent... ● → Nothing will happen! ● We have to add a template to the server first ● Template_App_MySQL www.fromdual.com 25
  • 26. MySQL Latest Data www.fromdual.com 26
  • 27. MySQL Queries per second www.fromdual.com 27
  • 28. st 1  impression ● Not really much data for MySQL :­( ● No efficient gathering method ● No nice graphs ● Is that all? → Zabbix seems to be very flexible, so let's  do it ourself! www.fromdual.com 28
  • 29. Requirements ● Fit into Zabbix architecture ● Must support several mysqld per server ● Should provide much more information ● Must support other Storage Engines as well ● MySQL Cluster, XtraDB, Aria, PBXT, Sphinx SE ● Simple ● Flexible ● Modular ● Work on Unixoides (and Windows?) www.fromdual.com 29
  • 31. Available modules [10] ● Aria (for Aria SE, ex. Maria SE (crash­safe MyISAM)) ● InnoDB (commercial) ● Master (for Master – Slave replication) ● MyISAM (for MyISAM SE) ● MySQL (non SE related stuff for MariaDB and MySQL) ● NDB (commercial, for MySQL Cluster SE, pre 7.1 and 7.1) ● PBXT (for PBXT SE) ● Process (for UNIX processes) ● Slave (for Master – Slave replication) ● XtraDB (for XtraDB SE (derivat of InnoDB))  ● Sphinx (for the Sphinx SE plug­in (in planning) ● Other modules on request... www.fromdual.com 31
  • 32. FromDual Monitor for Zabbix ● Install Zabbix as described before. ● Download FromDual Performance Monitor for MySQL [9] ● Read installation documentation [10] ● Load the FromDual templates ● Create a host group (optional) ● Create a host (= database!) ● Careful! Hostname MUST match the name in the FromDual agent configuration file!!! ● Link the chosen templates to the host ● Configure FromDual agent ● Hook FromDual agent into Zabbix agent: # /etc/zabbix/zabbix_agentd.conf UserParameter=FromDual.MySQL.check,/etc/zabbix/FromDualMySQLagent.pl  /etc/zabbix/FromDualMySQLagent.conf ● Restart Zabbix agent www.fromdual.com 32
  • 33. Templates www.fromdual.com 33
  • 34. Host configuration www.fromdual.com 34
  • 35. Overview / Dashboard www.fromdual.com 35
  • 36. Triggers www.fromdual.com 36
  • 37. Events www.fromdual.com 37
  • 38. Latest data www.fromdual.com 38
  • 39. Raw graph from latest data www.fromdual.com 39
  • 40. Maps for scale­out set­ups www.fromdual.com 40
  • 41. Screen for MySQL Cluster www.fromdual.com 41
  • 42. Graph (MySQL Network traffic) www.fromdual.com 42
  • 43. Graph (MySQL statements) www.fromdual.com 43
  • 44. Screen (InnoDB buffer pool) www.fromdual.com 44
  • 45. Graph (PBXT file read/write) www.fromdual.com 45
  • 46. Problems / Discussion ● One can do nearly everything (!) ● It is a lot of work until everything is in place. ● The whole set­up is tricky and needs some time until understood. ● It is not so smooth like MEM. Installation is more labourish. ● There is no Query Analyser (QUAN) yet. Zabbix developer say it could be  possible with v2.0! ● Usability is not perfect yet (links are not ending up where I expect it). ● No binaries available for server, only commercial! ● Installation docu is not fool­prove? ● Needs some experience to find problems → but, its cool, give it a try if you have no solution in place yet! www.fromdual.com 46
  • 47. Literature ● [1] MySQL Monitoring solutions: http://www.fromdual.com/mysql­monitoring­solutions ● [2] Cluster Monitoring CMON:  http://johanandersson.blogspot.com/2008/08/cluster­monitoring­cmon.html ● [3] Configure MySQL Enterprise Monitor to monitor MySQL Cluster:  http://www.clusterdb.com/mysql­cluster/configure­mysql­enterprise­monitor­to­monitor­mysql­cluster/ ● [4] The MySQL Enterprise Monitor: http://www.mysql.com/products/enterprise/monitor.html ● [5] Kontrollbase: http://kontrollsoft.com/software­kontrollbase,  http://code.google.com/p/kontrollbase/ ● [6] Zabbix: http://www.zabbix.org/ ● [7] Zabbix features: http://www.zabbix.org/features.php ● [8] Zabbix documentation: http://www.zabbix.com/documentation.php ● [9] Download MySQL Performance Monitor: http://www.fromdual.com/download ● [10] Installation documentation: http://www.fromdual.com/mysql­performance­monitor www.fromdual.com 47