Saturday, May 16, 2020

How to Install MySQL Enterprise Edition on Docker and Monitor it with MySQL Enterprise Monitor(MEM)?



Introduction

Before I talk about installation of MySQL inside docker, it's more important to know
what is Docker?
- Docker is a tool designed to create , deploy ,and run an application any where.
-It allow us to package up application with all requirements such as libraries and other dependencies and ship it all as a PACKAGE.
who uses Docker?
Developer : Docker enables developer to develop application without spending much time on IT infrastructure.
Sysadmin :-Docker enables sysadmin to streamline the software delivery, such as develop and deploy bug fixes and new features without any roadblock. 
Enterprise :-Docker works in the cloud , on premise ,and supports both traditional and micro services deployments.
why Docker?
-Easily adapts to your working environment.
-Simple to use.
- Eliminate friction in development life cycle.

More info at :- https://docs.docker.com/engine/docker-overview/

Let's Install MySQL Enterprise Edition 8.0.19 with Docker

WarningThe MySQL Docker images maintained by the MySQL team are built specifically for Linux platforms. Other platforms are not supported, and users using these MySQL Docker images on them are doing so at their own risk. See the discussion here for some known limitations for running these containers on non-Linux operating systems.

More about MySQL Enterprise Edition:- https://www.mysql.com/products/enterprise/
Step 1 :- Download MySQL EE binaries from MOS portal->patch & Updates
Step 2:- Download the Binaries by clicking on product name and unzip to obtain tarball inside.
              See at step-1 in yellow color.
Step 3:-Load the image by running below command
             # docker load -i mysql-enterprise-server-8.0.19.tar
Suppose you have downloaded mysql-enterprise-server-8.0.19.tar file into windows laptop then push it into Linux Machine where Docker is running, then go to the directory and load the 
mysql-enterprise-server-8.0.19.tar file.
Step 4:-  to verify
#docker images

Step 5:- Starting MySQL Server Instance
#docker run --name MySQLEnterpriseContainer -d  -p 3306:3306  mysql/enterprise-server:8.0

The --name option, for supplying a custom name for your server container, is optional; if no container name is supplied, a random one is generated.
mysql/enterprise-server:8.0 :- image_name:tag

Note:- Don’t give full version 8.0.19. TAG has to be 8.0 or else below error will generated.
Step 6:- To verify
#docker ps

Step 7:- Get Random Password by typing below command
#docker logs MySQLEnterpriseContainer 2>&1 | grep GENERATED

Step 8:-Connecting to MySQL Server from within the Container
docker exec -it MySQLEnterpriseContainer mysql -uroot –p
Enter Generated Password : HOpnuMIxibVYMijv3syRYK4KjEc
Step 9:-Change Temporary Password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MySQL8.0';

Step 10:- Change Create Table and Insert Records to test...

Create database test;
Create table test.sales(Empname Varchar(20), CountryName Varchar(20));
Insert into test.sales select 'Ram','Delhi';
Insert into test.sales select 'Radha','Delhi';
Insert into test.sales select 'Rakesh','Mumbai';
Insert into test.sales select 'Rajesh','Mumbai';


Extra Commands to play...




TO Get into the Docker Container to find the data directory , base directory , executing linux bash commands etc.

shell> docker exec -it MySQLEnterpriseContainer bash


bash-4.2#ls /var/lib/mysql

To stop the MySQL Server container we have created, use this command:

docker stop MySQLEnterpriseContainer
docker start MySQLEnterpriseContainer
docker restart MySQLEnterpriseContainer

To delete the MySQL container, stop it first, and then use the docker rm command:
docker stop MySQLEnterpriseContainer
docker rm MySQLEnterpriseContainer

Accessing Docker MySQL Database from Physical Host through MySQL Workbench Tool

Assume MySQL Enterprise Workbench is installed on Windows Machine : 192.168.0.3
Docker MySQL is Installed on Docker Host : 192.168.227.128 
Step 1:- Make Sure MySQL is able to communicate with remote host.
update mysql.user set host='%' where user='root';

flush privileges;
Step 2:- Make sure Docker MySQL port is published out side hosts. 
                see Step 05  -p 3306:3306

Step 3:-Connect MySQL Enterprise Workbench to Docker MySQL DB.
             

Monitoring Docker MySQL Database from MySQL Enterprise Monitor

Assume MySQL Enterprise Monitor is istalled on Windows Machine and already monitoring many On-premises DB and Cloud Instances and NOW we want to also monitor MySQL DB which is running in DOCKER.
Assume MySQL Enterprise Workbench is installed on Windows Machine : 192.168.0.3

Docker MySQL is Installed on Docker Host : 192.168.227.128 

Login to MySQL Enterprise Monitor-->Add Instances.

To Monitor SQL Statements:-

Know More about MySQL Enterprise Monitor:-

Conclusion:-


Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.
Running MySQL is quite easy when ever environment demands Running multiple MySQL instances into single server DOCKER is best fit.

1 comment:

  1. Mysql Solutions - On Premises And Cloud.: How To Install Mysql Enterprise Edition On Docker And Monitor It With Mysql Enterprise Monitor(Mem)? >>>>> Download Now

    >>>>> Download Full

    Mysql Solutions - On Premises And Cloud.: How To Install Mysql Enterprise Edition On Docker And Monitor It With Mysql Enterprise Monitor(Mem)? >>>>> Download LINK

    >>>>> Download Now

    Mysql Solutions - On Premises And Cloud.: How To Install Mysql Enterprise Edition On Docker And Monitor It With Mysql Enterprise Monitor(Mem)? >>>>> Download Full

    >>>>> Download LINK kk

    ReplyDelete