diff --git a/enterprise-manager/emcc/prepare-setup/prepare-setup.md b/enterprise-manager/emcc/prepare-setup/prepare-setup.md index 0ecd9a72..1e4471f8 100644 --- a/enterprise-manager/emcc/prepare-setup/prepare-setup.md +++ b/enterprise-manager/emcc/prepare-setup/prepare-setup.md @@ -50,7 +50,7 @@ This lab assumes you have: - [emcc-mkplc-lifecycle.zip](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/em-omc/emcc-mkplc-lifecycle.zip) - - [emcc-mkplc-migration-workbench.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/tIfVdCiZsEO9_8FwmL6GZrXpViDWF7K5VBvwsIMXkadmSnZXWhVCIN6iut2z3oEV/n/c4u02/b/hosted_workshops/o/stacks/emcc-mkplc-migration-workbench.zip) + - [emcc-mkplc-migration-workbench.zip](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/em-omc/emcc-mkplc-migration-workbench-v1.3.zip) - [emcc-mkplc-migration-workbench-adb.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/zqv4ccIzpSf1XX2xm50vy6buPjOjKa-ABMWyuPeh96N7WIJWqx4wMAPSP-8UXt9e/n/c4u02/b/hosted_workshops/o/stacks/emcc-mkplc-migration-workbench-adb.zip) @@ -61,6 +61,10 @@ This lab assumes you have: - [emcc-mkplc-rat-overview.zip](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/em-omc/emcc-mkplc-rat-overview.zip) + + - [emcc-mkplc-hybrid-pdbaas.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/-JqErQC8a-AiGJnd9ICNRE9dy8AiA-GEjYLAZEffy9qlGQMl0dOq34LPDhsVy_XS/n/omcinternal/b/EMWorkshopBucket/o/emcc-mkplc-hybrid-pdbaas.zip) + + 2. Save in your downloads folder. diff --git a/mysql/oci-oraca-mysql/a-introduction/introduction-ocw.md b/mysql/oci-oraca-mysql/a-introduction/introduction-ocw.md new file mode 100644 index 00000000..5e5d3cef --- /dev/null +++ b/mysql/oci-oraca-mysql/a-introduction/introduction-ocw.md @@ -0,0 +1,50 @@ +# Introduction + +## About this Workshop + +This workshop guides you through the process of provisioning a MySQL HeatWave database on OCI, enhancing a Spring Boot application, incorporating OpenTelemetry instrumentation, and deploying the application on an Oracle Kubernetes cluster. You will learn how to monitor the application using the Oracle Application Performance Management Service, leveraging traces and metrics for comprehensive end-to-end monitoring and diagnostics. Additionally, the workshop covers the utilization of Oracle Cloud Infrastructure (OCI) Database Management to monitor the MySQL HeatWave database and Logging Analytics for Kubernetes and application logs. + + +Estimated Time: 90 minutes + +*MySQL Heatwave Database* + +MySQL Heatwave is a fully-managed database service, powered by the integrated HeatWave in-memory query accelerator. It is the only cloud-native database service that combines transactions, analytics, and machine learning services into MySQL Heatwave, delivering real-time, secure analytics without the complexity, latency, and cost of ETL duplication. + +*Observability and Management Services* + +Monitor, analyze, and manage multicloud applications and infrastructure environments with full-stack visibility, prebuilt analytics, and automation using Oracle Cloud Observability and Management Platform. + +- Database Management + + Database management provides unified console for on-premises and cloud databases with lifecycle database management capabilities for monitoring, performance management, tuning, and administration. With Performance Hub, developers can improve SQL code during active development as well as continuously monitor and tune queries running on production systems. For more information on MySQL HeatWave Database Management > **[Use Database Management for MySQL HeatWave](https://blogs.oracle.com/mysql/post/database-management-for-mysql-heatwave)** + +- Application Performance Management + + Among other capabilities, OCI APM includes an implementation of a Distributed Tracing system. It collects and processes transaction trace data (spans) from the monitored application and makes it available for viewing, dashboarding, exploration, alerts, etc. For more information on APM and Trace Explorer please refer to Application Performance Monitoring > **[Use Trace Explorer](https://docs.oracle.com/en-us/iaas/application-performance-monitoring/doc/use-trace-explorer.html)** section in the OCI Documentation. + +- Logging Analytics + + Cloud Infrastructure (OCI) Logging Analytics lets you index, enrich, aggregate, explore, search, analyze, correlate, visualize and monitor all log data from your applications and system infrastructure on cloud or on-premises. Oracle Logging Analytics provides a one-click end-to-end Kubernetes monitoring solution for the underlying infrastructure, Kubernetes platform and cloud native applications. For more information on Logging Analytics and log Explorer please refer to Observability and Management > **[Use Logging Analytics to monitor Kubernetes](https://docs.oracle.com/en/solutions/kubernetes-oke-logging-analytics/index.html)**. + + +### Objectives + +In this workshop, you will: +* Create Oracle Kubernetes cluster +* Create MySQL HeatWave Database +* Use APM Trace Explorer to view traces, spans, and span dimensions +* Use Database Management to review query performances +* Use Logging analytics to analyze Kubernetes logs + +### Prerequisites + +* This lab requires an [Oracle Cloud account](https://www.oracle.com/cloud/free/). You may use your cloud account, or a Free tier account, a cloud account that you obtained through a trial. + +### Acknowledgements + +* **Author** - Anand Prabhu, Principal Member of Technical Staff, Enterprise and Cloud Manageability +- **Contributors** - +Yutaka Takatsu, Senior Principal Product Manager, +Avi Huber, Vice President, Product Management +* **Last Updated By/Date** - Anand Prabhu, January 2024 \ No newline at end of file diff --git a/mysql/oci-oraca-mysql/b-lab-one-envsetup/environmentsetup-ocw.md b/mysql/oci-oraca-mysql/b-lab-one-envsetup/environmentsetup-ocw.md new file mode 100644 index 00000000..13df4db4 --- /dev/null +++ b/mysql/oci-oraca-mysql/b-lab-one-envsetup/environmentsetup-ocw.md @@ -0,0 +1,161 @@ +# Provision the infrastructure + +## Introduction + +This workshop uses Spring Boot-based Java microservices connecting to a MySQL HeatWave database as a target application to illustrate the capabilities for end-to-end monitoring using OCI Observability and Management Services. In this lab, you will provision an Oracle Container Engine for Kubernetes (OKE) cluster and a MySQL HeatWave DB System through the OCI Console. + +Estimated time: 35 minutes + +### Objectives + +* Create a compartment +* Provision Oracle Container Engine for Kubernetes (OKE) cluster & MySQL HeatWave DB System + +### Prerequisites + +* This lab requires an [Oracle Cloud account](https://www.oracle.com/cloud/free/). You may use your cloud account, or a Free tier account, a cloud account that you obtained through a trial. + + +## Task 1: Create an OCI compartment + +1. Open the navigation menu from the top-left corner (aka. hamburger menu) of the Oracle Cloud console and select **Identity & Security** > **Compartments**. + ![Oracle Cloud console Menu](images/1-1-compartments.png " ") +2. Click **Create Compartment** + ![Oracle Cloud console, Create Compartment](images/1-2-compartments.png " ") +3. Enter the following parameters: +* Compartment name: **devlive24** +* Description: **Compartment for 2024 DevLive Hands-on lab** +* Accept the default values for the other fields, and click, **Create Compartment** + ![Oracle Cloud console, Create Compartment](images/1-3-compartments.png " ") +* Verify that your **devlive24** compartment is created in the table + ![Oracle Cloud console, Create Compartment](images/1-4-compartments.png " ") + +## Task 2: Create a policy for the volume management + +1. Open the navigation menu from the top-left corner (aka. hamburger menu) of the Oracle Cloud console and select **Identity & Security** > **Policies**. + ![Oracle Cloud console Menu](images/1-5-policy.png " ") + +2. Select **root** tenancy from the compartment drop down and then click on **Create Policy** + ![Oracle Cloud console Menu](images/1-6-policy.png " ") + +3. Enter the following parameters: + - Policy name: **OCIVolumeMgmt** + - Description: **OCI Volume Mgmt** + - Compartment: select root compartment + - Click on **Show manual editor** in Policy Builder + - Copy the below policies and paste in the editor + + ```bash + + ALLOW any-user to manage volumes in TENANCY where request.principal.type = 'cluster' + ALLOW any-user to manage volume-attachments in TENANCY where request.principal.type = 'cluster' + + ``` + - click, **Create** + ![Oracle Cloud console Menu](images/1-7-policy.png " ") + ![Oracle Cloud console Menu](images/1-8-policy.png " ") + +## Task 3: Setup up cloud shell and code editor + +1. Click on the below link to open OCI Code Editor and clone the repository + + [Open Code Editor and Clone the repository](https://cloud.oracle.com/?region=home&cs_repo_url=https://github.com/oracle-devrel/oci-devlive-2024.git&cs_branch=main&cs_readme_path=README.md&cs_open_ce=true) + +2. Retrieve the sample code and supporting scripts that will be used in this section + - Click on the **I have reviewed and accepted the Oracle Terms of Use.** checkbox + - Click on **Clone** + + ![Code Editor](images/3-2-1-clone.png " ") + + Repository is successfully cloned and its shown in the code editor + ![Code Editor](images/3-2-2-clone.png " ") + +3. Change orientation of the Cloud Shell and Code Editor + - Click on the **Actions** and then **Tabs** + ![Code Editor](images/3-2-3-codeeditor.png " ") + + - Now Cloud Shell and Code Editors are shown as tabs + ![Code Editor](images/3-2-4-codeeditor.png " ") + + - Now the cloud shell and code editor are set. Proceed to **Task 4** + +## Task 4: Create a Kubernetes Cluster + +1. From the OCI menu, select **Developer Services**, then **Containers & Artifacts > Kubernetes Clusters (OKE)**. + ![Oracle Cloud console Menu](images/3-1-1-nodepool.png " ") + +2. Select the compartment **devlive24** and then click on **Create cluster** + ![Oracle Cloud console Menu](images/3-1-2-nodepool.png " ") + +3. Quick Create pane is pre-selected. Keep the default selection and click **Submit**. + ![Oracle Cloud console Menu](images/3-1-3-nodepool.png " ") + +4. Enter the following parameters: + * Name the cluster: **devlive24-oke** + * Kubernetes API endpoint : Select **Public endpoint** + * Node type : Select **Managed** + ![Oracle Cloud console Menu](images/3-1-4-nodepool.png " ") + * Kubernetes worker nodes : Select **Private workers** + * Shape and image: **Keep default** + ![Oracle Cloud console Menu](images/3-1-5-nodepool.png " ") + * Node count: **1** + * Click **Next** + ![Oracle Cloud console Menu](images/3-1-6-nodepool.png " ") + * Review the configuration, and click **Create cluster**. + ![Oracle Cloud console Menu](images/3-1-7-nodepool.png " ") + * Make sure all verification steps are cleared. Click **Close** + ![Oracle Cloud console Menu](images/3-1-8-nodepool.png " ") + +> **Note:** This will start to create a cluster, and takes 7 to 10 minutes to complete. While waiting for the creation of the cluster, you can proceed to the next task to provision the **MySQL HeatWave Database** + + +## Task 5: Deploy the MySQL Database System + +1. From the OCI menu, select **Databases**, then **MySQL HeatWave > DB Systems**. + ![Oracle Cloud console Menu](images/3-1-mysqlheatwave.png " ") + +2. Select the **devlive24** compartment from the pulldown menu and Click **Create DB System** + ![Oracle Cloud console, DB Systems](images/3-2-mysqlheatwave.png " ") + +3. Choose **Production** and select the **devlive24** compartment and provide name **mysql-appdev** for the MySQL HeatWave Database + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-3-mysqlheatwave.png " ") + +4. Provide MySQL database administrator credentials (store these credentials for the later use) & choose **Standalone** + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-4-mysqlheatwave.png " ") + +5. Choose the VCN **`oke-vcn-quick-devlive24-oke-#########`** and private subnet for the MySQL DB System **`oke-nodesubnet-quick-devlive24-oke-#########-regional`** to allow access to MySQL HeatWave database from Kubernetes nodes and keep placement settings default. + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-5-mysqlheatwave.png " ") + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-6-mysqlheatwave.png " ") + +6. Uncheck **Enable HeatWave** checkbox and keep hardware settings default. + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-6-2-mysqlheatwave.png " ") + +7. Uncheck **Enable automatic backups**, then click _`Show advanced options`_. Uncheck **Delete protected** under **Deletion Plan** Tab and verify if **Database Management** under **Management** Tab is checked and then click on **Create** + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-7-mysqlheatwave.png " ") + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-8-mysqlheatwave.png " ") + +8. This will start to create a MySQL HeatWave Database, and takes 10-15 minutes to complete. While waiting for the creation of the MySQL HeatWave Database, learn more about MySQL HeatWave Database Management through the recorded demos mentioned below. In Lab 2, we will resume the steps to deploy the application connecting to the MySQL HeatWave Database. + + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-9-mysqlheatwave.png " ") + + Watch a video demonstration of monitoring and managing MySQL HeatWave Database + [](youtube:4VlRypYXJ48?si=k68OnLN9XI4KXo9B) + + Watch a video demonstration of tuning MySQL HeatWave DB System queries using  Performance Hub + [](youtube:vXqA8nkcF4c?si=B314cImffyHCfk1b) + +9. Once the MySQL HeatWave Database created successfully,then go to **Connections** tab to copy and save the **Private IP Address** of MySQL HeatWave Database and also database credentails to a text file to use in lab 2 and 3. + + ![Oracle Cloud console, Create MySQL HeatWave Database](images/3-10-mysqlheatwave.png " ") + + +[You may now **proceed to the next lab**.](#next) + + +## Acknowledgements + +* **Author** - Anand Prabhu, Principal Member of Technical Staff, Enterprise and Cloud Manageability +- **Contributors** - +Yutaka Takatsu, Senior Principal Product Manager, +Avi Huber, Vice President, Product Management +* **Last Updated By/Date** - Anand Prabhu, January 2024 \ No newline at end of file diff --git a/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist-ocw.md b/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist-ocw.md new file mode 100644 index 00000000..a5d3dc87 --- /dev/null +++ b/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist-ocw.md @@ -0,0 +1,187 @@ +# Build a new microservice application to extend WineCellar App + +## Introduction + +In this workshop you'll enhance the existing microservice application with a brand new component. Currently, we have a static ad message **2023 Thanks Giving Promotion: Buy 1 get 1!!!!** shown in the storefront. Build a new Spring Boot-based Java app to make ad messages dynamic to fetch from database and integrate it with WineCellar App. New microservice container image has been provided as part of the workshop resources so now it's time to deploy it and integrate it with the main WineCellar App. + +Estimated time: Up to 10 minutes + +### Objectives + +* Update the MySQL HeatWave Database with a new table +* Deploy and integrate new micro service to the WineCellar App + + +## Task 1: Create table **admessage** in the MySQL HeatWave Database + +1. Deploy an OKE Pod containing the MySQL client that will be used to connect to the DB System. + + ```bash + + kubectl run mysql-client --image=iad.ocir.io/axfo51x8x2ap/load-mysql-data:latest -it --rm --restart=Never -- /bin/bash + + ``` + + ![Kubectl command](images/3-1-1-admessage.png " ") + +2. Execute the command below to connect to the MySQL HeatWave Database using the Private IP address of the database and the credentials provided when the DB System was created. + + ```bash + + mysql -h -u -p + + ``` + + ![Kubectl command](images/3-1-2-admessage.png " ") + +3. Execute the command below to connect to the **wine** database + + ```bash + + use wine; + + ``` + + ![Oracle Cloud console, Cloud Shell](images/3-1-3-admessage.png " ") + +4. Execute below sql statement to create the table **admessage**, then insert a new record + + ```bash + + CREATE TABLE admessage (ID INT AUTO_INCREMENT PRIMARY KEY, message VARCHAR(255)); + INSERT INTO admessage (ID, MESSAGE) VALUES (1,'Welcome to MySQL DevLive Event'); + COMMIT; + SELECT * FROM admessage; + + ``` + + ![Oracle Cloud console, Cloud Shell](images/3-1-4-admessage.png " ") + +5. Type **exit** to leave the MySQL client, then **exit** once more to leave and terminate the MySQL Client pod. + + ![Oracle Cloud console, Cloud Shell](images/3-1-5-admessage.png " ") + +## Task 2 - Deploy a new microservice application + +1. Click on the code editor and open the file **OCI-DEVLIVE-2024 > sb-hol > admessage.yaml** in the code editor. + ![Oracle Cloud console, Cloud Shell](images/3-2-3-1-1-admessage.png " ") + ![Oracle Cloud console, Cloud Shell](images/3-2-3-2-1-admessage.png " ") + + - Update the field for the MySQL HeatWave Databae Private IP (line 38) which was saved in a text file when the MySQL HeatWave DB System was created.(Refer Lab 1 > Task 5 > Step 9) + + ![Oracle Cloud console, Cloud Shell](images/3-2-3-3-1-admessage.png " ") + - Click on **File > Save All** + ![Oracle Cloud console, Cloud Shell](images/3-2-3-4-1-admessage.png " ") + + +2. Go to cloud shell and execute and execute the command below to deploy the **AdMessage** application to the cluster. + + ``` bash + + cd ~/oci-devlive-2024/sb-hol + kubectl apply -f admessage.yaml + + ``` + + Verify the 2 services and 2 stateful sets are created + + ![Oracle Cloud console, Cluster details](images/3-2-3-4-admessage.png " ") + +3. Run the kubectl command below to display the status of the pod creation. Wait until the statuses become 'Running'. This may take a few minutes. + + ``` bash + + kubectl get pods + + ``` + ![Oracle Cloud console, Cloud Shell](images/3-2-3-5-admessage.png " ") + +4. Run the kubectl command below to display the deployed services. + + ``` bash + + kubectl get svc + + ``` + ![Oracle Cloud console, Cloud Shell](images/3-2-3-6-admessage.png " ") + +[You may now **proceed to the Task 3**.] + +## Task 3: Integrate the AdMessage API with the main Wine App + +1. Click on the code editor and open the file **OCI-DEVLIVE-2024 > sb-hol > wstore.yaml** in the code editor. + ![Oracle Cloud console, Cloud Shell](images/3-3-1-1-admessage.png " ") + + - Update value of parameter **winStore.services.adservice** with **AdMessage Endpoint** mentioned below. New endpoint is `adapi/admessage` (line 55) + + ``` bash + + http://${ADMESSAGE_SERVICE_HOST}:${ADMESSAGE_SERVICE_PORT}/adapi/admessage/ + + ``` + + ![Oracle Cloud console, Cloud Shell](images/3-3-1-2-admessage.png " ") + + - Click on **File > Save All** + ![Oracle Cloud console, Cloud Shell](images/3-3-1-3-admessage.png " ") + + +2. Go to cloud shell and execute the command below to deploy the application to the cluster. + + ``` bash + + cd ~/oci-devlive-2024/sb-hol + kubectl apply -f wstore.yaml + + ``` + ![Oracle Cloud console, Cloud Shell](images/3-3-3-admessage.png " ") + +3. Run the kubectl command below to display the status of the pod creation. Wait until the statuses become 'Running'. This may take a few minutes. + + ``` bash + + kubectl get pods + + ``` + ![Oracle Cloud console, Cloud Shell](images/3-3-4-admessage.png " ") + +4. Run the kubectl command below to display the deployed services. + + ``` bash + + kubectl get svc + + ``` + ![Oracle Cloud console, Cloud Shell](images/3-3-5-admessage.png " ") + +5. Refer to the example below and construct a URL, then paste it into the address bar of a new browser tab. Replace Public IP of the wstore-frontend service with the EXTERNAL-IP retrieved in the previous **step 4**. + + ``` bash + + http:///winestore/ + + ``` + + ![Oracle Cloud console, Cloud Shell](images/3-3-6-admessage.png " ") + +6. **Additional task:** Update table **admessage** to see how the admessage changes on update of table and refreshing the winestore url in the browser. + + ``` bash + + UPDATE admessage SET message="Successfully Deployed and Integrated AdMessage API" WHERE ID=1; + COMMIT; + SELECT * FROM admessage; + + + ``` + +[You may now **proceed to the next lab**.](#next) + +## Acknowledgements + +* **Author** - Wojciech Pluta, Principal Staff Developer +- **Contributors** - +Anand Prabhu, Principal Member of Technical Staff, Enterprise and Cloud Manageability +Victor Martin, Product Strategy Directory +Eli Schilling, Developer Advocate +* **Last Updated By/Date** - Anand, March 2024 diff --git a/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist.md b/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist.md index 5af42766..6f5fb655 100644 --- a/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist.md +++ b/mysql/oci-oraca-mysql/d-lab-three-extend&deploy-app-oraca/oraca-codeassist.md @@ -341,7 +341,7 @@ Estimated time: Up to 20 minutes ![Oracle Cloud console, Cloud Shell](images/3-2-3-4-1-admessage.png " ") -3. Go to cloud shell and execute and execute the command below to deploy the **AdMessage** application to the cluster. +2. Go to cloud shell and execute and execute the command below to deploy the **AdMessage** application to the cluster. ``` bash @@ -354,7 +354,7 @@ Estimated time: Up to 20 minutes ![Oracle Cloud console, Cluster details](images/3-2-3-4-admessage.png " ") -4. Run the kubectl command below to display the status of the pod creation. Wait until the statuses become 'Running'. This may take a few minutes. +3. Run the kubectl command below to display the status of the pod creation. Wait until the statuses become 'Running'. This may take a few minutes. ``` bash @@ -363,7 +363,7 @@ Estimated time: Up to 20 minutes ``` ![Oracle Cloud console, Cloud Shell](images/3-2-3-5-admessage.png " ") -5. Run the kubectl command below to display the deployed services. +4. Run the kubectl command below to display the deployed services. ``` bash diff --git a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services-ocw.md b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services-ocw.md new file mode 100644 index 00000000..b23bc3f0 --- /dev/null +++ b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services-ocw.md @@ -0,0 +1,300 @@ +# Enable application monitoring using Observability and Management Services + +## Introduction + +In this lab, you'll enable OCI Logging Analytics Service to monitor Oracle Kubernetes Engine and OCI Application Performance Management (APM) for application monitoring and also OCI Database Management for monitoring MySQL HeatWave Database to get end to end visibility of the application and its stack. + +Estimated Time: 40 minutes + +### Objectives + +In this lab, you will see step-by-step instructions to: + - Enable APM & Logging Analytics Service + - Complete visibility into the application using O&M Services + +## Task 1: Monitor MySQL HeatWave Database + +1. From the OCI menu, select **Observability & Management** -> **Database Management** then **Diagnostics & Management**. + + ![Oracle Cloud console Menu](images/4-0-1-dbm.png " ") + +2. Select compartment **devliv24** and click on "MySQL HeatWave" to see the fleet Summary - showing MySQL HeatWave Database systems inventory, monitoring status, resource usage & alarms. + + ![Oracle Cloud console Menu](images/4-0-2-dbm.png " ") + +3. Click on **mysql-appdev** MySQL HeatWave DB system from the list of monitored deployments + + ![Oracle Cloud console Menu](images/4-0-3-dbm.png " ") + +4. Monitor MySQL HeatWave Database + + - Alarms section allows drill down to specific errors to quickly resolve any issues + - Monitoring status timeline: Shows if Database Management can collect monitoring metrics for the resource + - Monitor database performance attributes in the Summary section + + ![Oracle Cloud console Menu](images/4-0-4-dbm.png " ") + +5. Performing MySQL HeatWave DB System Performance Diagnostics + + - Click on **Performance Hub** tab + ![Oracle Cloud console Menu](images/4-0-5-dbm.png " ") + + - Performance Hub provides holistic performance management capabilities providing a single view of the database performance using a varied set of features, such as Active statement latency, statement count charts, top 100 queries sorted by metrics, and the ability to drill down into specific SQL details. + + ![Oracle Cloud console Menu](images/4-0-6-dbm.png " ") + + - Click on any one of the top query. To see the performance of the query. For example clicking on **UPDATE 'A1P_USERS'** shows the following - your environment may be different. + + ![Oracle Cloud console Menu](images/4-0-7-dbm.png " ") + + Total of 8 executions and all 8 executions got failed. This allows us to quickly identify the database query performance issues using OCI Database Management Service. + + **Note: The following tasks in the lab are optional. Proceed only if you have time left to complete them. If not, please watch the pre-recorded demo below, where we will show how OCI Application Performance Monitoring, Logging Analytics, and Database Management services help achieve end-to-end visibility for the Wine Cellar application** + + Watch a video demonstration of end to end visibility of the application and its stack + [](youtube:7FbQWNoOykA) + + +## Task 2: Create an APM domain + +1. From the OCI menu, select **Observability & Management** -> **Application Performance Monitoring** then **Administration**. + ![Oracle Cloud console Menu](images/5-1-1-apmdomain.png " ") + +2. Select the **devlive24** compartment from the dropdown and click Create APM domain + ![Oracle Cloud console Menu](images/5-1-2-apmdomain.png " ") + +3. Name your APM domain as **apm-appdev** and select **devlive24** compartment from the dropdown. click **Create**. + ![Oracle Cloud console, Create APM Domain](images/5-1-3-apmdomain.png " ") + +4. Press the refresh button periodically to check the status. This may take a few minutes. + ![Oracle Cloud console, Create APM Domain](images/5-1-4-apmdomain.png " ") + +5. Once the job is completed, the status turns to Active with a green icon. + ![Oracle Cloud console, Create APM Domain](images/5-1-5-apmdomain.png " ") + + +## Task 3: Obtain Data Upload Endpoint and Private and Public Data Keys + +To upload tracing data to an APM domain, Data Upload Endpoint and both Private and Public Data Keys must be configured in the application’s configuration files. + +1. Click the link to the APM domain. + ![Oracle Cloud console, APM Domain](images/5-1-5-apmdomain.png " ") + + + +2. In the **APM Domain Information** tab, find **Data Upload Endpoint** + - Under **Resources**, click **Data Keys**. + - find **auto\_generated\_private_data\_key**. + - find **auto\_generated\_public_data\_key**. + + Copy data upload endpoint and data keys (private and public) to a file to be used in later tasks in the workshop. + + ![Oracle Cloud console, APM Domain](images/5-1-6-apmdomain.png " ") + + +## Task 4: Enable APM for the **Wine Cellar** application + +1. Open Code Editor and then open file **OCI-DEVLIVE-2024 > sb-hol >customapmresource.yaml** + + ![Oracle Cloud console, Cloud Shell](images/4-3-1-1-appmon.png " ") + ![Oracle Cloud console, Cloud Shell](images/4-3-2-2-appmon.png " ") + +2. Update and save the file **customapmresource.yaml** with apm endpoint and private data key + - Update field **** (line 11) with APM upload end point obtained from task 3. + - Update field **** (line 13) with private data key obtained from task 3. + ![Oracle Cloud console, Cloud Shell](images/4-3-3-3-appmon.png " ") + - save the file + ![Oracle Cloud console, Cloud Shell](images/4-3-4-4-appmon.png " ") + +3. Open cloud shell and run **enableapm.sh** to enable APM for the Kubernetes cluster + + enableapm.sh + - Installs required libraries to enable K8 Open Telemetry operator + - Maps K8 Open Telemetry operator to inject APM java agent + - Injects APM java agent at the K8 namespace level through the K8 operator + + ``` bash + + cd ~/oci-devlive-2024/sb-hol + chmod 755 enableapm.sh + ./enableapm.sh + + ``` + + ![Oracle Cloud console, Cloud Shell](images/4-3-3-appmon.png " ") + + +4. Verify if the APM is enabled by executing the below command and check for OTEL parameters in the pod parameters. + + ``` bash + + kubectl get pod wstore-front-0 -o yaml + + ``` + + ![Oracle Cloud console, Cloud Shell](images/4-3-4-appmon.png " ") + Now the APM is enabled for the application proceed to the next task. + +## Task 5: Generate workload by navigating to the app + +1. Click **Login**. + + ![WineCellar Demo App](images/4-1-1-wstore.png " ") + + +2. Enter your name (or john) as username, leave the password blank, and click **Login**. + + ![WineCellar Demo App](images/4-1-2-wstore.png " ") + + +3. Then click around the buttons in the pages, as in the example flow shown below. + + >**Note:** Do not worry if you see the "Failed" messages, or if it takes a long time for the pages to respond. Those are expected because the app is designed to fail every once and often for demo purposes. + + Click **Add** on a couple of products then hit **Shopping Cart**. Then Click **Checkout**. + ![WineCellar Demo App](images/4-1-3-wstore.png " ") + ![WineCellar Demo App](images/4-1-4-wstore.png " ") + + Click **Confirm Order**. + ![WineCellar Demo App](images/4-1-5-wstore.png " ") + + Click **Logout**. + ![WineCellar Demo App](images/4-1-6-wstore.png " ") + + +## Task 6: Examine traces in APM Trace Explorer + +1. From the OCI menu, select **Observability & Management** > **Trace Explorer** + + ![Oracle Cloud, Navigation Menu](images/5-1-1-traces.png " ") + +2. On the Trace Explorer page, select **devlive24** for the **Compartment** and **apm-appdev** for the **APM Domain**. + + ![Oracle Cloud, Trace Explorer](images/5-1-2-traces.png " ") + +3. By default, traces are displayed in the order by the start time. Right mouse click on the **Duration** column, select **Sort Descending** to show the traces by duration in descending order. This will bring the slowest trace to the top of the list. + + ![Oracle Cloud, Trace Explorer](images/5-1-3-traces.png " ") + +4. Hover the mouse over the bar in the **Spans** column at the top row. Verify three services are included in the trace, and each color represents a service: wstore-back, wstore-front, and wstore-web + + ![Oracle Cloud, Trace Explorer](images/5-1-4-0-traces.png " ") + +5. Click on the trace **wstore-web: Full Update /winestore/confirm** under Service:Operation name column. + + ![Oracle Cloud, Trace Explorer](images/5-1-4-1-traces.png " ") + + >**Note:** If you do not see a **wstore-web: Full Update /winestore/confirm** trace, you can navigate the WineStore demo app to perform the checkout operation. + +6. **Trace Details** page opens. Review the trace information on the upper screen. E.g., Status, Trace ID, Whether it has an error or not, how many spans and services are involved, or the duration of the trace. + ![Oracle Cloud, Trace Explorer](images/5-1-5-traces.png " ") + +7. In the **Topology** view, you can see how the operations are connected within the trace. Different colors indicate different services. Hover the mouse on the icons and the arrows that connect the icons. Review the information in the callouts. + ![Oracle Cloud, Trace Explorer](images/5-1-6-traces.png " ") + + >**Note:** The operations may look differently in the trace you selected. + +8. Scroll down the page to show the **Spans** view. Spans in the trace are displayed in a Gantt chart. A span at the top of the list is the root span, and the child spans are nested below the root span. + + ![Oracle Cloud, Trace Explorer](images/5-1-7-traces.png " ") + +9. **Trace Details** shows one span error and find the span that has errored, now lets click on that span to understand the reason for the error. + + ![Oracle Cloud, Trace Explorer](images/5-1-8-traces.png " ") + +Span error message shows that the table **A1P_USERS** is missing in the wine database which resulted in the error in this particular trace. + + >**Note:** With APM its easy to query the trace and span data using the trace query language. Explore other tabs (Users, SQLs, Web Apps, Sessions, etc..) in trace explorer to get quick insights into application performance. + + +## Task 7: Enable Logging Analytics Service + +1. Navigate to Observability & Management and click Logging Analytics. + + - From Navigation Menu ![navigation-menu](images/4-1-1-okela.png) > **Observability & Management** > **Logging Analytics**. + + - Click **Start Using Logging Analytics**. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-2-okela.png " ") + + - Review the policies that are automatically created and click **Next**. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-3-okela.png " ") + + - Enable OCI audit log analysis and Click **Next**. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-4-okela.png " ") + + - Logging Analytics Service is enabled in the tenancy. Click **Close**. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-5-okela.png " ") + +2. Enable Logging Analytics OKE Solutions + + - From Navigation Menu ![navigation-menu](images/4-1-6-okela.png) > **Observability & Management** > **Logging Analytics** > **Solutions**. + + - Click on **Kubernetes** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-7-okela.png " ") + + - Click on **Connect clusters** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-8-okela.png " ") + + - Click on **Oracle OKE** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-9-okela.png " ") + + - Select the **devlive24-oke** created in lab 1 and click **Next** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-10-okela.png " ") + + - Accept defaults and click on **Configure log collection** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-11-okela.png " ") + + - Configured OKE **devlive24-oke** for monitoring. Click on **Take me to Kubernetes** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-12-okela.png " ") + + - Collection of metrics and log data is still in progress - wait for 4 to 5 mins for collection to complete + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-13-okela.png " ") + + - Once the collection is complete it shows CPU, memory and latest telemetry data for the cluster + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-14-okela.png " ") + +## Task 8: Explore the Logging Analytics solutions for OKE Clusters + +1. Click on the cluster **devlive24-oke** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-15-okela.png " ") + +2. Overview of the cluster **devlive24-oke** is shown + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-16-okela.png " ") + +3. Filter by namespaces in the cluster + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-17-okela.png " ") + +4. Wine Cellar application is deployed on default namespace on filtering by namespace it shows the topology, usuage metrics which makes it easy to quickly identify the issues + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-18-okela.png " ") + +5. Dedicated events tab shows all the events occured on the specific namespace + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-19-okela.png " ") + +6. Analyze further based on cluster, workload, node and pod + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-20-okela.png " ") + +7. On the right we can see metric widgets as shown below which help us further understand how OKE is performing. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-21-okela.png " ") + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-22-okela.png " ") + +8. Analyze different metrics together to understand the workload patterns, resource utilization and also for effective troubleshooting. + * Click on the expand button which shows when you hover the mouse on a particular metric. Lets select metric **CPU cores(used/allocatable)** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-23-okela.png " ") + * Click on **Metrics to analyze** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-24-okela.png " ") + * Click on metrics of interest to analyze together (Maximum of 3 metrics are allowed to analyze together). Lets select the metric **Memory Used** + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-25-okela.png " ") + * Click again on **Metrics to analyze** and select the metric **Total API server requests**. Now all the three metrics can be analyzed together to understand workload patterns or for the effective troubleshooting. + ![Oracle Cloud console, Enable Logging Analytics](images/4-1-26-okela.png " ") + +>Note: OCI Logging Analytics provides one-click end-to-end Kubernetes monitoring solution for the underlying infrastructure, Kubernetes platform and cloud native applications. + +[You may now **proceed to the next lab**.](#next) + +## Acknowledgements + +* **Author** - Anand Prabhu, Principal Member of Technical Staff, Enterprise and Cloud Manageability +- **Contributors** - +Yutaka Takatsu, Senior Principal Product Manager, +Avi Huber, Vice President, Product Management +* **Last Updated By/Date** - Anand Prabhu, January 2024 diff --git a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services.md b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services.md index 0ef914e9..17f88b52 100644 --- a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services.md +++ b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/enbale_om_services.md @@ -14,11 +14,11 @@ In this lab, you will see step-by-step instructions to: ## Task 1: Monitor MySQL HeatWave Database -1. From the OCI menu, select **Observability & Management** -> **Database Management** then **MySQL HeatWave**. +1. From the OCI menu, select **Observability & Management** -> **Database Management** then **Diagnostics & Management**. ![Oracle Cloud console Menu](images/4-0-1-dbm.png " ") -2. Select compartment **devliv24** to see the fleet Summary - showing MySQL HeatWave Database systems inventory, monitoring status, resource usage & alarms. +2. Select compartment **devliv24** and click on "MySQL HeatWave" to see the fleet Summary - showing MySQL HeatWave Database systems inventory, monitoring status, resource usage & alarms. ![Oracle Cloud console Menu](images/4-0-2-dbm.png " ") @@ -57,13 +57,13 @@ In this lab, you will see step-by-step instructions to: 2. Select the **devlive24** compartment from the dropdown and click Create APM domain ![Oracle Cloud console Menu](images/5-1-2-apmdomain.png " ") -4. Name your APM domain as **apm-appdev** and select **devlive24** compartment from the dropdown. click **Create**. +3. Name your APM domain as **apm-appdev** and select **devlive24** compartment from the dropdown. click **Create**. ![Oracle Cloud console, Create APM Domain](images/5-1-3-apmdomain.png " ") -5. Press the refresh button periodically to check the status. This may take a few minutes. +4. Press the refresh button periodically to check the status. This may take a few minutes. ![Oracle Cloud console, Create APM Domain](images/5-1-4-apmdomain.png " ") -6. Once the job is completed, the status turns to Active with a green icon. +5. Once the job is completed, the status turns to Active with a green icon. ![Oracle Cloud console, Create APM Domain](images/5-1-5-apmdomain.png " ") diff --git a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-1-dbm.png b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-1-dbm.png index 76781893..ee751de7 100644 Binary files a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-1-dbm.png and b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-1-dbm.png differ diff --git a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-2-dbm.png b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-2-dbm.png index 56e24703..34863d9c 100644 Binary files a/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-2-dbm.png and b/mysql/oci-oraca-mysql/e-lab-four-app-monitoring/images/4-0-2-dbm.png differ diff --git a/mysql/oci-oraca-mysql/f-lab-five-cleanup/cleanup-ocw.md b/mysql/oci-oraca-mysql/f-lab-five-cleanup/cleanup-ocw.md new file mode 100644 index 00000000..b8a7f6d4 --- /dev/null +++ b/mysql/oci-oraca-mysql/f-lab-five-cleanup/cleanup-ocw.md @@ -0,0 +1,46 @@ +# Clean up the workshop environment + +## Introduction + +In this lab, you will clean up the workshop environment by running commands from the Cloud shell, also manually removing the Oracle cloud resources using the Oracle Cloud console. + +Estimated time: 10 minutes + +### Objectives + +* Remove the lab configurations and resources + +### Prerequisites + +* Completion of preceding labs in this workshop. + +## Task 1: Clean Up the application setup + +To delete the workshop setup from your tenancy, follow the steps below using. + +1. From the OCI menu, navigate to **Databases** -> **MySQL HeatWave** -> **DB Systems** + +2. Click the name of the DB System created in Lab 1. Then click `[More actions]` and choose `[Delete]`. + +3. When prompted, click the checkbox to "Delete DB System permanently." and click **`[Delete DB sysme]`** + + ![Oracle Cloud console - DB Systems](images/5-2-0-cleanup.png " ") + + >**Note:** If Termination Protection is active, you will not be able to delete the DB System. You will instead need to Edit the DB System, locate the advanced settings, uncheck the **Termination Protection** box, and save. It will take a few minutes to update before you can then delete the resource. + + ![Oracle Cloud console - DB Systems](images/5-2-1-cleanup.png " ") + +4. Use the OCI Menu to navigate to **Developer Services** -> **Containers & Artifacts** -> **Kubernetes Clusters (OKE)** -> **Kubernetes**. Locate the cluster created in lab 1. + + ![Oracle Cloud console - OKE](images/5-2-6-cleanup.png " ") + ![Oracle Cloud console - OKE](images/5-2-7-cleanup.png " ") + ![Oracle Cloud console - OKE](images/5-2-8-cleanup.png " ") + +## Acknowledgements + +* **Author** - Anand Prabhu, Principal Member of Technical Staff, Enterprise and Cloud Manageability +- **Contributors** - +Yutaka Takatsu, Senior Principal Product Manager, +Avi Huber, Vice President, Product Management +Eli Schilling, Developer Advocate +* **Last Updated By/Date** - Eli Schilling, February 2024 diff --git a/mysql/oci-oraca-mysql/workshops/ocw24/index.html b/mysql/oci-oraca-mysql/workshops/ocw24/index.html new file mode 100644 index 00000000..d2fedff3 --- /dev/null +++ b/mysql/oci-oraca-mysql/workshops/ocw24/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/mysql/oci-oraca-mysql/workshops/ocw24/manifest.json b/mysql/oci-oraca-mysql/workshops/ocw24/manifest.json new file mode 100644 index 00000000..cf8522f8 --- /dev/null +++ b/mysql/oci-oraca-mysql/workshops/ocw24/manifest.json @@ -0,0 +1,46 @@ +{ + "workshoptitle": "Intelligent App Dev with MySQL Heatwave Database and Advanced Observability", + "help": "livelabs-help-em_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction", + "filename": "../../a-introduction/introduction-ocw.md" + }, + { + "title": "Get Started", + "description": "This is the prerequisites for customers using Free Trial and Paid tenancies, and Always Free accounts (if applicable). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Provision the infrastructure", + "description": "Provision the infrastructure", + "filename": "../../b-lab-one-envsetup/environmentsetup-ocw.md" + }, + { + "title": "Lab 2: Deploy a microservices application", + "description": "Deploy a microservices application", + "filename": "../../c-lab-two-deploy-app/deploy-app.md" + }, + { + "title": "Lab 3: Enhance WineCellar application with a new microservice", + "description": "Enhance WineCellar application with a new microservice", + "filename": "../../d-lab-three-extend&deploy-app-oraca/oraca-codeassist-ocw.md" + }, + { + "title": "Lab 4: Monitor Application Using OCI O&M Services", + "description": "Monitor Application Using OCI O&M Services", + "filename": "../../e-lab-four-app-monitoring/enbale_om_services-ocw.md" + }, + { + "title": "Lab 5: Clean up the workshop environment", + "description": "Clean up the workshop environment", + "filename": "../../f-lab-five-cleanup/cleanup-ocw.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +}