Bobcares

Newrelic Monitor MySQL: How to?

by | Aug 31, 2022

Let us learn more about how to use the Newrelic to monitor MySQL in a few simple steps with the support of our MySQL support services at Bobcares.

Newrelic Monitor MySQL

newrelic monitor mysql

The MySQL NewRelic integration collects and sends performance information from the MySQL database to our platform via the New Relic Infrastructure agent. We can view the database server’s health and examine metric data to quickly identify the source of any issues.

Please note that the integration works with MySQL versions 5.6 and up.

With the example below, we can see how to configure Infrastructure Monitoring with newrelic for an Ubuntu server running MySQL. Check the agent documentation for alternative instructions if we have a different host OS. MySQL can also be monitored as a service in Kubernetes or ECS. Follow the steps given below to us Newrelic to monitor MySQL.

Install the agent and integration on an Ubuntu server

  1. Firstly, navigate to the account drop-down (in the top-right corner of New Relic One) and select Add new data.
  2. After that, choose the operating system. After that follow the prompts to obtain the license key and the Ubuntu version.
  3. Thirdly, run the commands on the server to install the Infrastructure agent and the MySQL integration:

    curl -s https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg |

  4. After that, import the GPG key for the Infrastructure agent.

    sudo apt-key add -

  5. Add the New Relic repository:

    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt bionic main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list

  6. Finally, install the newrelic-infra infrastructure agent and MySQL integration (nri-mysql).

    sudo apt-get update newrelic-infra nri-mysql && sudo apt-get install -y newrelic-infra nri-mysql.

Configure the MySQL integration for newrelic monitor MySQL

Follow the steps given below to configure MySQL for NewRelic monitoring:

  • Firstly, in MySQL, create a monitoring user.  mysql -e “CREATE USER ‘newrelic’@’localhost’ IDENTIFIED BY ‘MONITOR_USER_PASSWORD’;” mysql -e “GRANT REPLICATION CLIENT ON *.* TO ‘newrelic’@’localhost’;”
  • After that, set up the MySQL integration. cd /etc/newrelic-infra/integrations.d sudo cp mysql-config.yml.sample mysql-config.yml sudo nano mysql-config.yml
  • Enter the password. hostname: hostname: localhost port: 3306 username: newrelic password: MONITOR_USER_PASSWORD
  • After that, Set remote_monitoring to true.
  • Capture extended_metrics and extended_innodb_metrics. extended_metrics: 1 extended_innodb_metrics: 1
  • Set extended MyIsam metrics if we have MyISAM tables: extended_MyIsam_metrics: 1
  • Finally, to finish the installation, restart the infrastructure agent. restart newrelic-infrasystemctl.

View MySQL data in NewRelic

To use NewRelic to monitor MySQL, navigate to Infrastructure in New Relic One to observe the incoming server data. Navigate to Infrastructure > Third-party Services > MySQL Dashboard to begin monitoring the MySQL databases.

Here are a few examples of charts generated based on the settings of the integration to view the MySQL data on NewRelic:

  • A QPS graph assesses the database’s raw efficiency.
  • The Slow Queries chart will indicate the time to optimize the database.
  • To fine-tune max connections, use the Max Connections graph.
  • Use the I/O activity for the network and disk to identify system bottlenecks.

[Need assistance with similar queries? We are here to help]

Conclusion

To conclude we have now learned to use the newrelic to monitor MySQL by configuring the MySQL integration with the NewRelic with the support of our MySQL Support services.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.