Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

MySQL/Oracle/PostgreSQL Monitoring

Updated on 2024-11-20 GMT+08:00

Introduction

A MySQL/Oracle/PostgreSQL monitor detects your database status, and automatically triggers traffic switching when the database is abnormal.

This section describes these three monitors because they share the same operations.

Table 1 Monitoring status description

Monitoring Status

Description

Green

The monitoring is normal.

NOTE:

MAS cannot perform availability detection on the subhealth statuses of MySQL monitors, such as full connection and full disk usage.

If the MySQL instance is active, the connection is normal, and the query command can be executed properly, the MySQL database and the monitor are normal.

Red

The monitoring is abnormal. Traffic switchover is automatically triggered (if enabled) when the status changes from normal to failed.

Yellow

The monitor initialization failed. The MAS process cannot detect the service database. In this case, confirm the configurations or contact O&M personnel.

Light gray

Monitor creation or configuration failed.

Dark gray

Invocation failed. The ETCD connection status is abnormal.

Creating a Monitor

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance whose namespace type is Intra-city multi-active.
  2. Click the Monitor List tab and click Create Monitor.
  3. Configure the basic information, then click Next: Data Centers.

    Figure 1 Basic information configurations
    Table 2 Basic information parameters

    Parameter

    Description

    Monitor

    Select a monitor type.

    • MySQL
    • Oracle
    • PostgreSQL Monitor
      NOTE:

      Ensure that you have enabled the corresponding features in functions module settings, and have selected these features when creating the namespace for your instance. Otherwise, you will not see these options.

    Application

    Select the application.

    Monitor Name

    Customize the monitor name.

    Exception Notification

    By default, this option is disabled.

    If it is enabled,

    • Monitor and database exceptions will be sent to you in a timely manner with the Huawei Cloud SMN service. Configure a secret key first.
    • Cloud Eye is enabled by default. Ensure that the alarm rules for MAS have been created on the Cloud Eye console. For details, see Creating an Alarm Rule to Monitor an Event.

    Subject

    If Exception Notification is enabled, select a subject from the drop-down list or click Add to create a new one.

    Monitoring

    The default value is Yes. If No, database exceptions will not be monitored.

    Automatic Switchover

    The default value is Yes. If No, automatic switchover of the databases will not be triggered.

    Username

    Enter the username for logging in to the database.

    Password

    Enter the password for logging in to the database.

    Confirm Password

    Enter the password again.

    Associate with DRS

    By default, this option is disabled.

    If it is enabled, the Data Replication Service (DRS) real-time DR tasks will be associated. Configure a secret key before enabling this option.

    Multi-Active Area

    Select the multi-active area where the instance's namespace belongs to.

    NOTE:

    This option is displayed only when Associate with DRS is enabled.

    DRS Task

    If Associate with DRS is enabled, select a real-time DR task from the drop-down list or click Add to create a new one.

  4. Configure the data centers, then click Next: Databases.

    Figure 2 Data center configurations
    Table 3 Data center parameters

    Parameter

    Description

    Cloud

    The environment where the monitored database is deployed

    Region

    The region where the monitored database is located

    IPv4 Address

    The IP address and port number for accessing the database

    Add Read Database

    Click to add the read database address.

  5. Configure the databases, then click Next: Advanced.

    Figure 3 Database configurations
    Table 4 Database parameters

    Parameter

    Description

    Monitored Database

    Enter the monitored database name.

    Connected Database

    Enter the connected database name.

  6. Configure the advanced settings, then click Next: Confirm.

    Figure 4 Advanced configurations
    Table 5 Advanced settings

    Parameter

    Description

    Retry Interval (ms)

    The interval of reconnection attempts, in milliseconds. Default value (recommended): 3000

    Value range: 1 to 300,000

    Monitoring Timeout (ms)

    The timeout duration before a monitor becomes abnormal, in milliseconds.

    Default value (recommended): 40,000; Value range: 1 to 600,000

    NOTE:

    Ensure that the time you specify here is longer than the time required for data center 1 to synchronize data to data center 2. Otherwise, the data in data center 2 may be incomplete.

    Database Access Timeout (ms)

    The database access timeout duration, over which the database access is considered failed, in milliseconds. Default value (recommended): 3000

    Value range: 3000 to 100,000

  7. Confirm settings and click Create.

    NOTE:

    If the created monitor is not normal, that is, its indicator is not green, its configurations or databases may be abnormal. In this case, rectify the fault.

Configuring the Connection Pool

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance to go to its console.
  2. Click the Monitor List tab and choose More > Configure Connection Pool in the row that contains the target monitor.
  3. Set the configurations and click OK.

    Table 6 Connection pool parameters

    Parameter

    Description

    Database Name

    Enter the name of the connected database.

    Routing Algorithm

    Options: Single read/write and Single write, local read

    Data Source

    Customize a name for the data source.

    Database Address

    Connection address of the database

    Schema

    Name of the schema to be connected

    Load Balancing Algorithm

    Options: Random and Polling

    Add Data Source

    Configure the secondary/standby data source.

Configuring the Database Read/Write

To disable the database to write, interconnect the application with the DB-SDK of the Java 1.2.6-RELEASE or later version.

  1. Log in to the MAS console. On the Multi-Active Instances page, click an instance to go to its console.
  2. Go to the Monitor List tab page.
  3. Click in the row of a data center.

    Figure 5 Configuring the database read/write

  4. Select a new status and click OK.

    Table 7 Database read/write parameters

    Parameter

    Description

    Readable

    Whether the database is readable.

    • Readable: The database status is normal and can be read.
    • Unreadable: The database status is abnormal and cannot be read. In this case, you need to change the database status.

    Writable

    Whether the database is writable.

    • Writable: You can write data to the database.
    • Unwritable: You cannot write data to the database.
    NOTE:

    If DC 1 (active) is abnormal, MAS automatically sets DC 2 to active and sets DC 1 to Unreadable. If you need to set DC 1 to active after it recovers, you will need to click Switch Back and set DC 1 to Readable.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback