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
On this page

Show all

Managing an E-Commerce Application

Updated on 2024-09-13 GMT+08:00

This section describes how to connect an e-commerce application to Application Performance Management (APM) for management. Information about the application:

  • This is a Java application that is not deployed using JBoss. It can be deployed on the SUSE 12 SP2 VM in JRE 1.8 or later.
  • The application contains five microservices, each of which contains an instance:
    • apigw: API gateway, which is responsible for service authentication, request throttling, and filtering.
    • product: Product management, including product query and purchase.
    • user: User management, including user login and identity authentication during product purchase.
    • dao: Data persistence layer, which is responsible for database request operations.
    • MySQL database: Database.

The following describes how to connect the e-commerce application to APM for management.

Process

  1. Deploy the application on a Huawei Elastic Cloud Server (ECS). Note that APM supports Huawei ECSs only.
  2. Install the ICAgent. The ICAgent is a collection agent for collecting topology and tracing data in real time. You need to install the ICAgent on the ECS where the application is deployed.
  3. Modify application startup parameters to ensure that APM can monitor the application.
  4. Manage the application on APM, for example, view the application status on the topology page and view user experience on the transaction page.

Procedure

  1. Deploy the application on a Huawei ECS.

    1. Register a cloud account, top up the account, and purchase a Linux ECS. For details, see Logging In to an ECS.

      To ensure application performance, select an ECS with at least 2 vCPU cores and 4 GB memory. Select the image for the SUSE 12 SP2 Operating System (OS), which is the only OS supported by the application.

    2. Log in to the ECS, create an application directory, and go to the directory, for example, mall.
    3. Set up the MySQL database and record the address, port number, username, and password for accessing the database. The demo supports automatic database creation.
    4. Download the application package to the mall directory and install it.
      curl -l http://demos.obs.myhuaweicloud.com/demo_install.sh > demo_install.sh && bash demo_install.sh
      NOTE:

      During the installation, replace the database information according to the following procedure:

      1. Download and open the .sh file shown in the command.
      2. Download and open the demo_03.tar file in the .sh file.
      3. Open the .yaml file in the demo_03.tar file and modify the parameters under MySQL:
        • host: address for setting up the database
        • port: port
        • user: username for accessing the database
        • pass: password for accessing the database
      4. Save the settings and go to the next step.

  2. Install the ICAgent. For details, see Initial Installation.
  3. Modify application startup parameters to ensure that the application can be monitored by APM.

    Specifically, add the following parameters to the application startup script:

    Parameter

    Description

    Example

    -javaagent

    JAR package that the collection probe depends on. The value is always /opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar.

    /opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar

    -Dapm_application

    Application name, which can be customized.

    vmall

    -Dapm_tier

    Application microservice name.

    In this example, microservice names include apigw, product, user, and dao.

    Application startup scripts:

    Before the modification:

    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-persistence-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_dao.yml > dao.log &
    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-api-gateway-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_api.yml > api.log &
    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-user-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_userservice.yml > user.log &
    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-product-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_prod.yml > prod.log &
    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/cloud-simple-ui-1.0.0.jar --spring.config.location=file:/root/testdemo/ui.properties > ui.log &

    After the modification (the modified information is shown in bold):

    nohup java -javaagent:/opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar -Dapm_application=vmall -Dapm_tier=vmall-dao-service -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-persistence-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_dao.yml > dao.log &
    nohup java -javaagent:/opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar -Dapm_application=vmall -Dapm_tier=vmall-apigw-service -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-api-gateway-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_api.yml > api.log &
    nohup java -javaagent:/opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar -Dapm_application=vmall -Dapm_tier=vmall-user-service -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-user-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_userservice.yml > user.log &
    nohup java -javaagent:/opt/oss/servicemgr/ICAgent/pinpoint/pinpoint-bootstrap.jar -Dapm_application=vmall -Dapm_tier=vmall-product-service -Xms512m -Xmx2048m -jar /root/testdemo/ecommerce-product-service-0.0.1-SNAPSHOT.jar --spring.config.location=file:/root/testdemo/application_prod.yml > prod.log &
    nohup java -Xms512m -Xmx2048m -jar /root/testdemo/cloud-simple-ui-1.0.0.jar --spring.config.location=file:/root/testdemo/ui.properties > ui.log &

  4. Restart the application. After about three minutes, application data is displayed on the APM console.

    You can monitor applications and locate application exceptions on the Dashboard and Topology pages of the APM console. For details, see APM User Guide.

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