Various Tutorials
  • About
  • Tutorials
    • 1. Instance for deployment
      • Create instance
      • Install and configure OCI CLI
      • OCI CLI small test
      • Install and configure Terraform
      • Terraform - small test
    • 2. OCI Networking &Terraform
      • 2.1 VCN (basics)
        • 2.1.1 Create a virtual network using Start VCN Wizard
        • 2.1.2 VCN & public subnet (step-by-step in Terraform)
        • 2.1.3 VCN & public subnet (new compartment)
        • 2.1.4 VCN, Terraform and Ansible (Nginx example)
        • 2.1.5 VCN & private subnet (step-by-step in Terraform)
      • 2.2
      • 2.3
    • 3. Untitled
    • 4. Untitled
    • 5. ATP and APEX
      • Setup Autonomous Database
        • Deploying ATP using OCI Interface
        • Deploy with OCI CLI
      • Setup APEX on ATP
      • Connect remotely to ATP
      • ATP, APEX and Jupyter
      • Demo
    • 6. MySQL
      • 6.1. The basics - OCI UI (MySQL DB System)
      • 6.2 The basics - OCI CLI (MySQL DB System)
      • 6.3 Access MySQL DB System
      • 6.4 HeatWave and MySQL DB Service
      • 6.5 Python SDK
      • 6.6 MySQL Replication (Compute Instances)
      • 6.7 Monitoring MySQL instances
        • Deploy MySQL instances
        • Monitoring tools
          • 1. Networking setup
          • 2. Prometheus setup
          • 3. MySQL Prometheus Exporter Setup
          • 4. Grafana setup
          • 5. Grafana metric graphs
    • 7. MySQL OCI &Terraform
      • 7.1 Deploy MySQL DB System with Terraform (basic tutorial)
      • 7.2 Deploy MySQL DB System with Terraform and access the system
      • 7.3 Endpoints
      • 7.4 Channels (troubleshooting)
        • Fixed MySQL source - MDS replication
      • 7.5 Channels (code)
Powered by GitBook
On this page
  1. Tutorials
  2. 6. MySQL
  3. 6.7 Monitoring MySQL instances

Deploy MySQL instances

Previous6.7 Monitoring MySQL instancesNextMonitoring tools

Last updated 4 years ago

Deploying three MySQL instances with the help of OCI CLI (for more details on how to proceed with OCI CLI creation for MySQL instance, review )

Each of the three database has been deployed in a different Availability Domain; Each of these three databases have the same compartmentID and subnetID

Json file for deploying 1st DB database:

root@deploymentmachine:/home/tests/mydb# more mydb1.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-1",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest1",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}

Deploy 1st DB with command:

root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb1.json

Json file for deploying 2nd DB database:

root@deploymentmachine:/home/tests/mydb# more mydb2.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-2",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a 2nd small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest2",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}

Deploy 2nd DB with command:

root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb2.json

Json file for deploying 3rd DB instance:

root@deploymentmachine:/home/tests/mydb# more mydb3.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-3",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a 3rd small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest3",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}

Deploy 3rd DB with command:

root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb3.json

If no output errors after running command "oci mysql db-system create", check the Oracle Cloud UI:

Do not forget the Ingress rules for MySQL services:

The deployed instances have following private IPs:

10.0.0.28, 10.0.0.30, respectively 10.0.0.32

"The basics OCI CLI"