All Products
Search
Document Center

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

Last Updated:Nov 15, 2023

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

Prerequisites

Create and deploy an application on 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, enter basic information about the application that you want to create in the Basic Information step, and click Next to go to the Configurations step.

    Configuration item

    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.

    • 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.

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

    Configuration item

    Description

    Source of Deployment Package

    Custom Program

    To deploy an existing application to EDAS, you must set the File Uploading Method parameter:

    • Upload JAR Package, Upload WAR Package, or Upload Deploy Package: Select a local 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 needs, set 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, set 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, set 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, set the Version and Application Health Check parameters, and click Create Application.

  7. In the Creation Completed step, check 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 allow access to 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. On the Applications page, select the region in which your application resides in the top navigation bar. In the upper part of the page, select the 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. Set parameters in the AddLoad Balancing(Public) dialog box. 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 must not delete the admin user.

  • You must not delete the /home/admin configuration.

  • You must not stop the following processes on the ECS instance:

    • /home/staragent/bin/staragentd

    • com.alibaba.edas.agent.AgentDaemon

  • You must not 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.

Custom OpenJDK versions

EDAS allows you to install a custom OpenJDK version to deploy an application on 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 you use. The following example shows you how to install a custom OpenJDK version. In this example, the aliyun_3_x64_20G_alibase_20210910.vhd operating system image is used.

Note

To deploy an application on an ECS instance, you must install OpenJDK and configure environment variables for the java and jar commands. You can run the java or jar command to view the installation results.

  • 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:

    # Query the minor versions of Java runtime environment (JRE).
    yum search --showduplicates java-1.8.0-openjdk
    # Query the minor versions of OpenJDK.
    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 operating 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 results. 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