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
Situation Awareness
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
Help Center/ CodeArts Deploy/ Getting Started/ Creating a Tomcat Application Using CodeArts Deploy and Deploying It on an ECS

Creating a Tomcat Application Using CodeArts Deploy and Deploying It on an ECS

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

CodeArts Deploy provides users with visualized, automatic, and rich deployment actions, helping them establish a standard deployment process, reducing deployment costs, and enhancing release efficiency.

This section uses Deploy a Tomcat Application as an example to describe how to deploy a Tomcat application on a host. The following describes how to quickly deploy an application.

Prerequisites

  • A project is available. If there is no project, create one.
  • You have permissions to create applications. For details, see Editing Permissions.
  • The related software package has been compiled.
    NOTICE:

    You can set Source to Artifact or Build task. In this example, Artifact is selected. Therefore, you need to prepare the compiled software package in advance. If you select Build task, you do not need to prepare the software package.

Creating a Host Cluster and Adding Hosts to It

  1. Go to the CodeArts homepage and click the target project name to access the project.
  2. Go to the Basic Resources page.

    Choose Settings > General > Basic Resources. The Host Clusters page is displayed by default.

    NOTE:

    Choose CICD > Deploy. Click Basic Resources. The Host Clusters page is displayed by default.

  3. Create a host cluster and add hosts to it.

    1. Choose Settings > General > Basic Resources. The Host Clusters page is displayed by default.
    2. Click Create Host Cluster, enter the following information, and click Save.

      Parameter

      Mandatory

      Description

      Cluster Name

      Yes

      Enter a custom name.

      Enter 3 to 128 characters. Use digits, letters, hyphens (-), underscores (_), and periods (.).

      OS

      Yes

      Select Linux or Windows based on the OS of the host to be added.

      In this example, select Linux.

      Host Connection Mode

      Yes

      If the target host cannot connect to the public network, you need to select a host bound with an EIP as the proxy host to connect CodeArts Deploy to the target host.

      Direct connection: Select a host bound with an EIP as the target host to connect to CodeArts.

      Proxy: Select a host bound with an EIP as the proxy host to connect to CodeArts.

      Execution Resource Pool

      Yes

      A resource pool is a collection of physical environments where commands are executed during software package deployment. In this scenario, select official.

      Description

      No

      Enter a description.

      Max. 500 characters.

    3. (The following uses a Linux-based target host as an example.) Click Add Host, select Adding IP for Add hosts by, enter the following information, and click OK. The target host is created.
      Table 1 Parameters of the target host (Linux)

      Parameter

      Mandatory

      Description

      Host Name

      Yes

      Enter a custom name.

      Enter 3 to 128 characters. Use digits, letters, hyphens (-), underscores (_), and periods (.).

      IP

      Yes

      Enter the private or public IP address of the target host.

      OS

      Yes

      Keep the default value because it is the OS of your host cluster.

      Authorization

      Yes

      Select a Password or Key for authentication as required.

      • Password: The Username and Password are displayed on the page. Take ECS as an example. You need to enter the ECS username and password.
      • Key: The Username and Key are displayed on the page. For details about how to generate and obtain a key, see Obtaining the Linux Key.

      SSH Port

      Yes

      Port 22 is recommended. Custom ports are supported.

      Correct port format: 1-65535.

    4. Click in the Operation column of a host to start the host for connectivity verification.

Creating an Application

  1. Choose CICD > Deploy.
  1. Create an application.

    1. Click Create Application. On the Basic Information page that is displayed, modify the basic information such as Name, Description, and Execution Resource Pool as required.
    2. After editing the basic application information, click Next. The deployment template selection page is displayed.

      Select Deploying a Tomcat Application and click OK.

    NOTE:

    The following describes the initialization procedure and parameters of the Tomcat application deployment template. For details, see Deployment Actions.

Creating an Environment and Importing Hosts

  1. Create a deployment environment and import hosts from the host cluster.

    1. Switch to the Environment Management tab page and click Create Environment.
    2. Enter basic information, such as the Environment, OS, and Description, and click Save.
    3. Switch to the Resource tab page and click Import Host.
    4. The system automatically filters all clusters that meet the requirements of the current environment. In the dialog box that is displayed, select the target host cluster and click in the Operation column of a host to import the host to the environment.

Configuring Deployment Actions and Deploying the Application

  1. Configure deployment actions.

    Switch to the Deployment Actions tab page and click Edit to set parameters.
    1. Install JDK
      Table 2 Parameters for installing the JDK

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Environment

      Yes

      Select a host cluster as the deployment object.

      JDK Version

      Yes

      Select the JDK version to be installed.

      Installation Path

      Yes

      Installation path of JDK.

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.
      • Whether to execute this action with the sudo permission.
    2. Install Tomcat
      Table 3 Parameters for installing Tomcat

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Environment

      Yes

      Select a host cluster as the deployment object.

      Tomcat Version

      Yes

      Version of Tomcat to be installed.

      Installation Path

      Yes

      Installation path of Tomcat.

      HTTP Port

      Yes

      Default port: 8080

      AJP Port

      Yes

      Default port: 8009

      Service Shutdown Port

      Yes

      Default port: 8005

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.
      • Whether to execute this action with the sudo permission.
    3. Stop Tomcat
      Table 4 Parameters for stopping Tomcat

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Environment

      Yes

      Select a host cluster as the deployment object.

      Operation

      Yes

      Start and Stop are available.

      Absolute Path

      Yes

      Absolute path of the Tomcat service.

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.
      • Whether to execute this action with the sudo permission.
    4. Select Deployment Source
      Table 5 Parameters for selecting a deployment source

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Source

      Yes

      Two types are available: Artifact and Build task.

      Environment

      Yes

      Select a host cluster as the deployment object.

      Software Package

      Yes

      You can select an existing software package in CodeArts Artifact or from a local host.

      package_url indicates the path of the software package in CodeArts Artifact.

      NOTE:

      Local software packages or files uploaded to CodeArts Artifact can be reused.

      Download Path

      Yes

      Where the downloaded software package is stored.

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.
      • Whether to execute this action with the sudo permission.
      NOTICE:

      In this example, Artifact is selected as the deployment source. If you select Build task, see Selecting a Deployment Source.

    5. Start Tomcat
      Table 6 Parameters for starting Tomcat

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Environment

      Yes

      Select a host cluster as the deployment object.

      Operation

      Yes

      Start and Stop are available.

      Absolute Path

      Yes

      Absolute path of the Tomcat service.

      HTTP Port

      Yes

      HTTP port of the Tomcat service.

      AJP Port

      Yes

      AJP port of the Tomcat service.

      Service Shutdown Port

      Yes

      Shutdown port monitored by the Tomcat service.

      Waiting Time

      Yes

      After the specified duration, the system checks the service status. You can adjust the time based on the actual time required for starting the service. If the time is improper, the detection fails.

      Enter a time (Max. 300s)

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.
      • Whether to execute this action with the sudo permission.
    6. Health Test Through URLs
      Table 7 Parameters for health test through URLs

      Parameter

      Mandatory

      Description

      Action Name

      Yes

      Name of an added deployment action.

      Max 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./().

      Environment

      Yes

      Select a host cluster as the deployment object.

      Retries

      Yes

      The number of times you want the system to retry the health test before the test is considered failed.

      Interval (s)

      Yes

      Interval between two retries,

      in seconds (0–60).

      Test Path

      Yes

      Path of the service to be tested. You can add multiple paths.

      Action Control

      No

      Whether to enable this action.

      • Whether to keep running on failure.

      After the Health Test Through URLs parameter is set, all parameters are completed. For details about application configuration, see Configuring Parameters of an Application.

  2. Deploy an application.

    After setting the preceding parameters, click Save & Deploy to deploy an application.
    • Application deployed.

    • If an application fails to be deployed, perform the following steps to locate the fault:
      1. View the automatic matching solution.

        If the deployment fails, click View Solution under deployment actions to go to the corresponding help center page.

      2. Search for a solution manually.

        If the issue persists, paste the error information (content in the red box) to the search box of the help center and manually search for the solution.

(Optional) Verifying the Deployment Result

The Deploying a Tomcat Application template supports deployment result verification. This section describes how to verify the deployment result. After the application is successfully deployed, enter the following information in the address box of the browser:

<Public IP address of the target host>:8080/tomcat-demo

Press Enter. If the following information is displayed, the application is successfully deployed.

For more information, see 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