All Products
Search
Document Center

Enterprise Distributed Application Service:Create and deploy an application in an ECS cluster

更新時間:Mar 05, 2024

Enterprise Distributed Application Service (EDAS) allows you to create and deploy applications in Elastic Compute Service (ECS) clusters.

Prerequisites

Create and deploy an application in an ECS cluster

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications.

  3. In the top navigation bar of the Applications page, select the region in which you want to create and deploy an application. In the upper part of the page, select the microservices namespace that you want to use. Then, click Create Application in the upper-left corner of the page.

  4. In the Create Application wizard, configure basic information about the application that you want to create in the Basic Information step, and click Next to go to the Configurations step.

    Parameter

    Description

    Cluster Type

    Select ECS Clusters.

    Application Runtime Environment

    Create and deploy a Dubbo or Spring Cloud application:

    • Use a JAR package

      • Select Java.

      • From the Java Environment drop-down list, select a Java Development Kit (JDK) version. If you want to use a custom OpenJDK version, select Custom OpenJDK from the drop-down list and enter the installation command in the code editor. For more information, see Custom OpenJDK versions.

        Note

        OpenJDK 17 is compatible with Dubbo 2.7.14 and later or Dubbo 3.0.6 and later. For more information about the compatibility test results, see OpenJDK 17 compatibility.

    • Use a WAR package

      • Select Tomcat.

      • From the Java Environment drop-down list, select a JDK version.

      • From the Container Version drop-down list, select an Apache Tomcat version.

        Note

        By default, Apache Tomcat is installed in the /home/admin/ directory. You cannot change the directory in which Apache Tomcat is installed.

    Create and deploy a High-speed Service Framework (HSF) application

    • Select EDAS-Container (HSF).

    • From the Java Environment drop-down list, select a JDK version.

    • From the Pandora Version drop-down list, select a Pandora version.

    • From the Ali-Tomcat Version drop-down list, select an Ali-Tomcat version.

    Application Name

    The name of the application that you want to create. The name must start with a letter and can contain digits, letters, underscores (_), and hyphens (-). The name can be up to 36 characters in length.

    Application Description

    The description of the application. The description can be up to 128 characters in length.

    Table 1. OpenJDK 17 compatibility

    Dubbo version

    Spring Boot version

    Nacos client version

    API call

    ARMS monitoring

    Service list

    2.7.14

    2.7.9

    1.4.4

    OK

    OK

    OK

    2.7.14

    2.7.9

    2.1.2

    OK

    OK

    OK

    2.7.14

    2.7.9

    2.2.0

    OK

    OK

    OK

    2.7.22

    2.7.9

    1.4.4

    OK

    OK

    OK

    2.7.22

    2.7.9

    2.1.2

    OK

    OK

    OK

    2.7.22

    2.7.9

    2.2.0

    OK

    OK

    OK

    3.0.6

    2.7.9

    1.4.4

    OK

    OK

    OK

    3.0.6

    2.7.9

    2.1.2

    OK

    OK

    OK

    3.0.6

    2.7.9

    2.2.0

    OK

    OK

    OK

    3.1.7

    2.7.9

    1.4.4

    OK

    OK

    OK

    3.1.7

    2.7.9

    2.1.2

    OK

    OK

    OK

    3.1.7

    2.7.9

    2.2.0

    OK

    OK

    OK

  5. In the Configurations step, specify the deployment package source and instance source, and click Next.

    Parameter

    Description

    Source of Deployment Package

    Custom Program

    To deploy an existing application to EDAS, you must configure the File Uploading Method parameter.

    • Upload JAR Package, Upload WAR Package, or Upload Deploy Package: Select an on-premises application package and upload it.

    • JAR Package Address, WAR Package Address, or Deploy Package Address: Enter the public URL of your deployment package.

    Official Demo

    EDAS provides a pair of application demos in the Spring Cloud, Apache Dubbo, and HSF frameworks to help you create and deploy applications. For more information, see Get started with EDAS.

    Do Not Deploy

    The system creates an application and generates its basic information. However, the system does not deploy the application.

    Instance Source

    • Purchase Instance: EDAS purchases ECS instances for you.

    • Use Existing Instance: Use existing idle instances in your cluster.

    Environment

    • Default Environment

      Create a default cluster in the default microservices namespace. The cluster uses the default virtual private cloud (VPC) in the current region.

    • Custom Environment

      From the Microservices Namespace and Cluster drop-down lists, select the microservices namespace and cluster that you created. If no microservices namespaces or clusters are created, you can click Create Microservices Namespace or Create Cluster to create a microservices namespace or a cluster.

    Purchase Method

    • Purchase Based on Recommended Specifications

      Select instance specifications based on your business requirements, configure the Quantity and Logon Password parameters, and then select the check box to agree to Elastic Compute Service Terms of Service | Terms of Service for Images.

    • Purchase Based on Existing Instance Specifications

      Select an instance in the Select Template Instance section as the template, configure the Recycling Mode, Password, and Quantity parameters, and then select the check box to agree to Elastic Compute Service Terms of Service | Terms of Service for Images.

    • Purchase Based on Instance Launch Template

      Select an instance launch template, configure the Recycling Mode and Quantity parameters, and then select the check box to agree to Elastic Compute Service Terms of Service | Terms of Service for Images.

  6. In the Advanced Settings step, configure the Version and Application Health Check parameters, and click Create Application.

  7. In the Creation Completed step, confirm the information in the Basic Information, Configurations, and Advanced Settings sections, and then click Create Application.

    At the top of the Basic Information page, click View Details. You can view the change process on the Change Details page. Wait several minutes until the application is deployed. Then, check the instance status on the Instance Information tab of the Basic Information page. If the instance is in the Normal state, the application is deployed.

Configure an Internet-facing SLB instance

The application is created and deployed in a VPC. Therefore, the application does not have a public IP address by default. If you want to access your application over the Internet, we recommend that you configure an Internet-facing Server Load Balancer (SLB) instance for the application.

Note

Then, EDAS enables the session persistence feature for HTTP listeners. The feature cannot be disabled.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications.

  3. In the top navigation bar of the Applications page, select the region in which your application resides. In the upper part of the page, select the microservices namespace of your application and select ECS Clusters from the Cluster Type drop-down list. Then, click the name of the application for which you want to configure an Internet-facing SLB instance.

  4. In the Application Settings section of the Basic Information tab, click Add next to SLB (Internet).

  5. In the Add Load Balancing (Public) dialog box, configure the SLB parameters as prompted. For more information, see Configure a dedicated SLB instance for an application.

    Copy the public IP address and port of the configured Internet-facing SLB instance, such as 39.XX.XX.65:81, and paste it into the browser address bar. Then, press the Enter key to go to the web page of the application.

Limits on system configurations of an ECS instance

After the application is created, you may log on to an ECS instance of the application to configure the instance. Take note of the following limits during the configuration:

  • You cannot delete the admin user.

  • You cannot delete the /home/admin configuration.

  • You cannot stop the following processes on the ECS instance:

    • /home/staragent/bin/staragentd

    • com.alibaba.edas.agent.AgentDaemon

  • You cannot delete the following crontab files on the ECS instance:

    • bash /home/admin/edas-agent/bin/monitor.sh crontab file of the root user

    • bash /home/admin/edas-agent/bin/rotator.sh crontab file of the admin user

  • You must reserve enough free space in the root disk partition.

  • If you use the CentOS operating system, make sure that you correctly configure yum repositories.

  • If the ECS instance has multiple network interface controllers (NICs) and the application that you use is a High-Speed Service Framework (HSF) application, you must specify the -Dhsf.server.ip parameter for the application to ensure that the registered IP address works. For example, the ECS instance has multiple NICs if Docker is installed. For more information, see Set JVM -D startup parameters.

  • The time clock of the ECS instance must be accurate. The maximum error cannot exceed 15 seconds. Otherwise, the access from the application to the EDAS registry will be affected.

Custom OpenJDK versions

EDAS allows you to install a custom OpenJDK version to deploy an application to an ECS instance. When the ECS instance is being created, the installation command that you enter is run.

OpenJDK

The custom OpenJDK version that can be installed varies based on the operating system that you use. The following section uses the aliyun_3_x64_20G_alibase_20210910.vhd system image as an example to describe how to install an OpenJDK version.

Note

For applications that are deployed on ECS instances, you must install Java Development Kit (JDK) and pass environment variables into Java or Jar commands. You can view the command output only after you enter java or jar commands in the CLI.

  • Query the minor versions of built-in OpenJDK 8.

    Run one of the following commands on your ECS instance to query the minor versions of OpenJDK 8 provided by the operating system image:

    # Search for jre.
    yum search --showduplicates java-1.8.0-openjdk
    # Search for jdk.
    yum search --showduplicates java-1.8.0-openjdk | grep devel

    Sample query results:

    java-1.8.0-openjdk-1:1.8.0.292.b10-0.1.al8.x86_64 : OpenJDK 8 Runtime Environment
    java-1.8.0-openjdk-1:1.8.0.292.b10-0.1.al8.x86_64 : OpenJDK 8 Runtime Environment
    java-1.8.0-openjdk-1:1.8.0.302.b08-0.1.al8.x86_64 : OpenJDK 8 Runtime Environment
    java-1.8.0-openjdk-1:1.8.0.312.b07-2.al8.x86_64 : OpenJDK 8 Runtime Environment
    java-1.8.0-openjdk-1:1.8.0.322.b06-2.al8.x86_64 : OpenJDK 8 Runtime Environment
    java-1.8.0-openjdk-1:1.8.0.272.b10-1.1.al8.x86_64 : OpenJDK Runtime Environment 8

    This system image allows you to install OpenJDK 8 of the preceding minor versions by using Yellowdog Updater, Modified (YUM).

  • Install an OpenJDK 8 minor version.

    Run the following command on your ECS instance to install a custom minor version of OpenJDK. Then, run the java -version command to view the installation result. If a version of OpenJDK is returned, the custom minor version of OpenJDK is installed.

    yum install -y java-1.8.0-openjdk-1:1.8.0.302.b08-0.1.al8.x86_64 java-1.8.0-openjdk-devel-1:1.8.0.302.b08-0.1.al8.x86_64