Friday, May 21, 2021

How to run MySQL Enterprise Edition on Oracle Cloud Infrastructure from Marketplace ?

 Deploy MySQL Enterprise Edition with OCI Market Place Application

In this blog we will look into the process to deploy MySQL Enterprise Edition in to Oracle Cloud Infrastructure.

In this blog we will discuss the below agenda
1. Introduction about MySQL EE and OCI Market place

2. Deploy MySQL EE into Oracle Cloud Infrastructure

3. Accessing MySQL database from On-premises.

4. Licensing/Purchase model of using MySQL EE from OCI marketplace

5. Conclusion

Introduction

If you wanted to run MySQL Enterprise Edition (EE) in Oracle Cloud Compute Instance (VM) then generally what we do is first download the MySQL EE binaries from the oracle website and manually push to the Oracle Cloud Instance where, MySQL EE needed to be installed and follow the steps to get installed.
Another approach is going with MySQL EE image from Oracle Cloud Marketplace.
It automates this manual process to download the binaries and push to oracle cloud and then follow the step to install the MySQL binaries, it is pre-loaded package which by default install below software
 MySQL Server EE
 MySQL Enterprise Backup
 MySQL Shell
 MySQL Router
 MySQL Enterprise Thread pool

The MySQL Enterprise Edition Marketplace Application is an OCI compute instance, running Oracle Linux 7.7, with MySQL EE 8.0.x.
The MySQL EE installation on the deployed image is similar to the RPM installation.

This solutions is user-managed, meaning you are responsible for upgrades and maintenance.

MySQL Enterprise Edition version 8.0 is available in OCI Marketplace. MySQL 5.7 nor 5.6 are not available in Oracle Cloud Infrastructure Marketplace. If the user needs previous versions, you need to create an OCI Compute Linux, download and install MySQL EE by themselves, similar to on-prem.

What is Oracle Cloud Infrastructure Marketplace?
Oracle Cloud Infrastructure Marketplace is an online store that offers solution specifically for customers of Oracle Cloud Infrastructure.
you can find listings for two types of solutions from Oracle and trusted partners:

1. Image
Images are templates of virtual hard drives that determine the operating system and software to run on an instance. You can deploy image listings on an Oracle Cloud Infrastructure Compute instance.

2. Stack

Stacks represent definitions of groups of Oracle Cloud Infrastructure resources that you can act on as a group.
More info:- https://docs.oracle.com/en-us/iaas/Content/Marketplace/Concepts/marketoverview.htm

What is MySQL Enterprise Edition?

MySQL Enterprise Edition is a commercial product. Like MySQL Community Edition, MySQL Enterprise Edition includes MySQL Server, a fully integrated transaction-safe, ACID-compliant database with full commit, rollback, crash-recovery, and row-level locking capabilities. In addition, MySQL Enterprise Edition includes the following components designed to provide monitoring and online backup, as well as improved security and scalability, high availability.

More info:- https://dev.mysql.com/doc/refman/8.0/en/mysql-enterprise.html

Deploy MySQL EE into Oracle Cloud Infrastructure

Prerequisite:-

 Make sure You have have create an account with Oracle Cloud.
 Make sure virtual cloud network(VCN) is created
https://docs.oracle.com/en-us/iaas/Content/GSG/Tasks/creatingnetwork.htm

Step 1:- Create compute instance 





































Step 2 : Change the shape based on the requirements(in terms of CPU , RAM )



Step 03:-Configure the Network


Step 04:- Add SSH key files


Step 05 :- Create the Instance



Step 06:- View the created Instance


Step 07:- Note down the Instance details

Instance Public IP : 140.238.166.106
Instance User Name:   opc
Instance Private IP: 10.0.0.92
MySQL Host Name: localhost
MySQL UserName: root
MySQL Port: 3306


Step 08:- Let’s connect the Instance from On-premises network using Putty


Make sure putty is installed in your local machine, if not then please install by downloading from the web links:- https://www.putty.org/
Enter the correct public IP address as well as .ppk file to connect , refer below screenshot .










































When you click on OPEN, you will see that you are connected to Oracle Cloud Infrastructure.

















Step 09:- Get the temporary password

$sudo grep 'temporary password' /var/log/mysqld.log









Step 10:- Login to MySQL DB























Step 11:- Change the Password for the root user from temporary password to NEW password

alter user root@'localhost' identified by 'MySQL8.0';

Step 12:- Next is you can ready to execute the commands with MySQL Enterprise Edition







That’s it.
You can also connect MySQL Server using MySQL shell utility




So you may noticed that I have not install manually any mysql clients , libraries its dependencies , MySQL shell because it is bundled and available as pre-installed image at Oracle Cloud Marketplace.
It’s easy to plug in and play with MySQL Enterprise Edition.
More info available at MySQL Website:-

https://dev.mysql.com/doc/refman/8.0/en/mysql-oci-marketplace.html


Licensing Model

This is a BYOL (bring your own license) product with there are additional fees for the infrastructure usage."
Hence,

Price of MySQL EE OCI Marketplace = Price of MySQL EE + Price of Oracle Cloud Infrastructure VM usage

Price for MySQL EE goes via MySQL Sales , you can talk with sales to get the details pricing matrix(https://www.mysql.com/about/contact/).

More info :- https://www.mysql.com/products/

Price of Oracle Cloud Infrastructure VM usage, it depends on kind of shape (comprises of OCPU, RAM, Storage) you are going to configured to run MySQL Enterprise Edition (EE).

You can calculate using OCI cost estimator: - https://www.oracle.com/in/cloud/cost-estimator.html

If you are bringing your “on-premise license”, so this offering is available at no additional charge. Fees for usage of Oracle infrastructure resources, such as compute instances, are charged separately and based on the rate of usage. Learn about pricing" linked to

https://www.oracle.com/cloud/compute/pricing.html


Conclusion:-

MySQL Enterprise Edition include most comprehensive set of advanced features (solutions for scalability, performance, high availability, securities), management tools (unified monitoring and hot/online backup) and technical supports(24*7 support backed by MySQL engineering team)
It’s easy to deploy on private cloud , public cloud and available as “Managed Service” at Oracle Cloud named as MySQL Database Service (MDS).
MySQL Enterprise Edition is BYOL product and it is annual subscription product which has to be renewed annually.


Monday, September 14, 2020

How to Launch MySQL Database Service ?

 Launching Your First MySQL DB System

Step 1 - Pre-requisites

1.    1.     Create a compartment and user group to organize the resources and access. In this example, we create a compartment named as MySQL_Sandbox, and a group MySQL_Test_Group. Log-in the Console as an Administrator, under the Identity menu, create a MySQL_Sandbox compartment, and a group MySQL_Test_Group. Add the OCI user you will use to work with MySQL Database Service to the group.

2.     Define the required MySQL Database Service policies (Identity menu). In our example, if your user is in the group MySQL_Test_Group and you want to restrict your MySQL DB Systems to the compartment MySQL_Sandbox, add the following policy statements:

a.      Policy statement 1:

Allow group MySQL_Test_Group to manage mysql-family in compartment MySQL_Sandbox

b.     Policy statement 2:

Allow group MySQL_Test_Group to {SUBNET_READ, SUBNET_ATTACH, SUBNET_DETACH, VCN_READ, COMPARTMENT_INSPECT} in compartment MySQL_Sandbox

3.     The following policy statement is also required for Console use if you would like to list tag namespaces when creating new DB System resources:

a.      Policy statement 3:

Allow group MySQL_Test_Group to inspect tag-namespaces in tenancy

C   create a Virtual Cloud Network (VCN). Just click on the "Start VCN Wizard" button, choose "VCN with Internet Connectivity", give a name, confirm the compartment, keep the default CIDR blocks (10.0.0.0/16, 10.0.0.0/24, 10.0.1.0/24) and DNS Resolution options, then click the buttons "Next", and finally "Create".

Step 2 - Create a MySQL DB System

1.     Using the Console, select the menu Database > MySQL > DB Systems > Create MySQL DB System.


1.  Inform your DB System preferences, ensuring you choose the compartment where your VCN and Subnets are configured from the pre-requisites. Give your DB System a name, select the Availability Domain and Fault Domain you want to place your DB System. Then you can choose a configuration, as the VM.Standard.E2.1.Built-in, define the Storage Size and click the "Next" button.

   


1.     You will now provide the Database information: MySQL Administrator credentials, and confirm where the network information, and click "Next". 

1.     Finally, just confirm if you want to enable Automatic Backups and click "Create".

1.     Your new MySQL DB System will be ready to use after a few minutes. You can perform the following Step 3 in parallel while waiting.

1.     The state Creating will change to Active, indicating that your DB System is ready to use. When the DB System is Active, click on the left "Endpoints" resources and check the Address to connect to the DB System.



Step 3 - Configure the client Virtual Machine to connect to MySQL

You will need a client machine to connect to your brand new MySQL database. If you still don't have a Linux VM in the same VCN mentioned in the pre-requisites, you can create one right now. To launch a Linux Compute instance, you go to the Console, menu Compute, Instances, and click "Create Instance". Ensure you choose the same VCN from the pre-requisites, and it is in a Public Subnet with a public IP address assigned

1.     Configure the Private Subnet to accept traffic on MySQL port(s). In the Console, got to Networking, Virtual Cloud Networks, <your VCN name>, Security Lists, Security List for Private Subnet, and add an Ingress Rule with Source CIDR 0.0.0.0/0 to Destination Port 3306. (Optional) Add another Ingress

Rule to port 33060 if you want to use MySQL Document Store.


1.     Connect to the Compute instance using SSH. For example, using the Terminal:

$ ssh -i ~/.ssh/id_rsa opc@<your_compute_instance_ip>

2.     You will need a MySQL client tool to connect to your new MySQL DB System from your client machine. For example, to install MySQL Shell just run:

3.  sudo su root

4.  sudo yum update

5.  sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

6.  rpm -Uhv mysql80-community-release-el7-3.noarch.rpm

7.  yum update

8.  yum install mysql

9.  yum install mysql-shell

Step 4 - Connect to MySQL

In case you wanted to connect with Putty