Akanksha Iyer
Akanksha Iyer

Reputation: 11

Monitoring MySQL database running in AWS EC2 instance

I have MySQL database running in an EC2 ubuntu 18.04 instance. I want to monitor the MySQL database using Percona. Since I heard Percona is a free tool, I want to monitor my DB using it.

Can anyone help me with the steps to configure and use it?

Thanks in Advance

Upvotes: 0

Views: 586

Answers (1)

vansh madan
vansh madan

Reputation: 178

I am familiar with PMM(Persona Monitoring and Management) docker installation on ec2 instance

Firstly you need to install Docker 1.12.6 or higher to carry out this installation

Steps:

  1. Pull docker image
docker pull percona/pmm-server:2
  1. Create persistent data container
docker create --volume /srv \
--name pmm-data \
percona/pmm-server:2 /bin/true

3)Run the image

docker run --detach --restart always \
--publish 443:443 \
--volumes-from pmm-data \
--name pmm-server \
percona/pmm-server:2

Then you can access the pmm-ui/interface on http://public-ip-ec2-instace:80 or https://public-ip-ec2-instance:443

Further you need to install Pmm-agent for mysql on mysql-database ec2 instance, also create user for Pmm on mysql

  1. Create user on mysql
MySQL> CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
MySQL> GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@'localhost';
  1. Install Pmm-agent/client
# yum list all | grep pmm
# yum install pmm2-client -y
  1. Verify it using below command
pmm-admin
 pmm-admin --version
  1. Connect your ec2 with Pmm-server and add mysql service to pmm server us
pmm-admin config --server-insecure-tls --server-url=https://admin:admin@<pmm-server-ip>:443 # Pmm-server credentials
pmm-admin add mysql --username=pmm --password=pass --query-source=perfschema # Using credentials created for mysql user

Upvotes: 1

Related Questions