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

Step 6: Deploying an Application (ECS)

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

This section uses phoenix-sample-standalone as an example to describe how to deploy the release package to a host. For details about CCE-based deployment, see Step 6: Deploying an Application (CCE).

Purchasing and Configuring an ECS

This section uses Elastic Cloud Server (ECS). You can also use your own Linux host that runs Ubuntu 16.04 OS.

  1. Buy an ECS.

    The following table lists mandatory configurations. You can also select other configurations as necessary.

    Table 1 Configuring an ECS purchase

    Category

    Configuration Item

    Suggestion

    Configure Basic Settings

    Billing Mode

    Select Pay-per-use.

    Instance

    CPU Architecture

    Select x86.

    Specifications

    Select 2 vCPUs and 8 GiB memory or higher.

    OS

    Image

    Choose Public image > Ubuntu > Ubuntu 16.04 server 64bit.

    Public Network Access

    EIP

    Select Auto assign.

    Billed By

    Select Bandwidth.

    Instance Management

    Login Mode

    Select Password.

    Password

    Enter a custom password.

  2. Configure security group rules.

    Use ports 5000 and 5001 to verify the sample project. Therefore, add an inbound rule that allows access over ports 5000 and 5001.

    The procedure is as follows:

    1. Log in to the ECS list page, locate the ECS purchased in step 1, and click the ECS name.
    2. Click the Security Groups tab, and add an inbound rule with Protocol set to TCP and Port Range set to 5000-5001 by referring to Configuring Security Group Rules.

Adding a Target Host to the Project

Before deploying applications to ECSs, add the target hosts to the basic resources of the project.

  1. Go to the Phoenix Mall project and choose Settings > General > Basic Resources from the navigation pane.
  2. Click Create Host Cluster, configure the following information, and click Save.

    Table 2 Creating a host cluster

    Parameter

    Suggestion

    Cluster Name

    Enter host-group.

    OS

    Select Linux.

    Host Connection Mode

    Select Direct Connection.

    Execution Resource Pool

    Select Official.

  3. Click Add Host, configure the following information, and click OK.

    Table 3 Adding a host

    Configuration Item

    Suggestion

    Add Hosts by

    Select Adding IP.

    Host Name

    Keep this name same as the name of the purchased ECS.

    IP

    Enter the EIP generated when buying the ECS.

    Authorization

    Select Password.

    Username

    Enter root.

    Password

    Enter the password set when buying the ECS.

    SSH Port

    Enter 22.

  4. A host record is displayed on the page. If Succeed is displayed in the Verification Result column, the host is added successfully.

    If the host fails to be added, check the host configuration based on the failure details.

Installing Dependency Tools on ECS

The sample program depends on Docker and Docker-Compose, which must be installed on the target ECS.

  1. Go to the Phoenix Mall project, choose CICD > Deploy, and find the phoenix-sample-predeploy application in the list.
  2. Click and choose Edit from the drop-down list.
  3. Click the Environment Management tab and configure the host environment.

    1. Click Create Environment, configure the following information, and click Save.
      Table 4 Creating an environment

      Parameter

      Value

      Environment

      Enter phoenix-env.

      Resource Type

      Select Host.

      OS

      Select Linux.

      NOTE:

      If you do not have permission to create environments, contact the administrator to grant you permissions on the permission management page of the application.

    2. Click Import Host. In the displayed dialog box, select the configured host cluster and host and click Import.
    3. When a message indicating that the import is successful is displayed, close the window.

  4. On the Deployment Actions tab page, edit the actions of the application.

    In action Install Docker, select phoenix-env from the Environment drop-down list. If a dialog box is displayed, asking you to confirm whether you want to change the environment to phoenix-env for the subsequent actions, click OK.

  5. Click Save & Deploy to start the deployment task.

    If a message is displayed indicating successful deployment, the task is successfully executed.

  6. Log in to the ECS and check whether the dependency tools are successfully installed:

    • Run the docker -v command to check the Docker image version.
    • Run the docker-compose -v command to check the Docker-Compose version.

    If the command output similar to Figure 1 is displayed, the installation is successful.

    Figure 1 Checking the Docker and Docker-Compose versions

Configuring and Executing an Application

During deployment, configure the ECS in the environment list of the application and set the build task phoenix-sample-ci as the deployment source.

  1. Go to the Phoenix Mall project, choose CICD > Deploy, and find the phoenix-sample-standalone application in the list.
  2. Click and choose Edit from the drop-down list.
  3. Click the Environment Management tab and configure the host environment.

    1. Click Create Environment, configure the following information, and click Save.
      Table 5 Creating an environment

      Parameter

      Value

      Environment

      Enter phoenix-env.

      Resource Type

      Select Host.

      OS

      Select Linux.

    2. Click Import Host. In the displayed dialog box, select the configured host cluster and host and click Import.
    3. When a message indicating that the import is successful is displayed, close the window.

  4. On the Deployment Actions tab page, edit the actions of the application.

    1. Click Select a Deployment Source. Set the deployment source by referring to Table 6.
      Table 6 Configuring the deployment source

      Configuration Item

      Suggestion

      Source

      Select Build task.

      Build Task

      Select phoenix-sample-ci.

      Environment

      Select phoenix-env.

      If a dialog box is displayed, asking you to confirm whether you want to change the environment to phoenix-env for the subsequent actions, click OK.

    2. Retain the default settings in actions Decompress Files and Run Shell Commands.

  5. Click the Parameters tab and set parameters based on the SWR login command.

    You can obtain the login command from the console. For details, see Configuring SWR.

  6. Click Save & Deploy to start deployment.

    If a message is displayed indicating that the deployment is successful, continue with the next step. If the deployment fails, rectify the fault based on the failed action and the error information in logs.

  7. Verify the deployment result.

    1. Open a browser, enter http://IP:5000 in the address box, and press Enter. IP indicates the elastic IP address of the ECS. The Phoenix Mall homepage is displayed.
    2. Enter http://IP:5001 and press Enter. IP indicates the elastic IP address of the ECS. The Phoenix Mall dashboard is displayed.

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