All Products
Search
Document Center

Enterprise Distributed Application Service:Deploy a microservices application in the default ECS cluster

Last Updated:Dec 22, 2023

Enterprise Distributed Application Service (EDAS) provides microservices application demos that use the following frameworks: Spring Cloud, Dubbo, and High-speed Service Framework (HSF). These demos show you how to deploy microservices applications in EDAS. In addition, EDAS provides a default Elastic Compute Service (ECS) cluster in which you can deploy applications. This topic describes how to deploy a microservices application in the default ECS cluster.

Prerequisites

  • EDAS is activated. For more information, see Activate EDAS.

  • Auto Scaling is activated and granted permissions on related Alibaba Cloud resources.

Background information

Default ECS cluster: A default microservices namespace is created in each region. EDAS automatically creates a default ECS cluster in the default microservices namespace. The default ECS cluster is deployed in the default virtual private cloud (VPC) of the region.

Application demos: You can use the microservices application demos in the EDAS console to deploy and call simple services. The microservices application demos use the Spring Cloud, Dubbo, and HSF frameworks. Each demo contains two applications. The procedure for deploying an application demo is the same for different frameworks. In this example, an application demo that uses the Spring Cloud framework is deployed. For more information about the microservices application demos, see alibabacloud-microservice-demo.

For more information about how to implement the features of a microservices application, see Overview of application development.

Process

默认环境创建ECS应用

Procedure

Create a provider application

Each microservices application demo contains a server-side application (service provider) and a client-side application (service consumer). The following example shows how to deploy the server-side application. After you deploy the server-side application, repeat the steps in this section to deploy the client-side application.

Note

Due to the way how services are called, you must deploy the server-side application before you deploy the client-side application. If you deploy the client-side application first, the service cannot be called, and an error is returned.

  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 deploy the application. On the page that appears, select the microservices namespace that you want to manage, and click Create Application.
  4. In the Basic Information step of the Create Application wizard, configure the basic information of the application and click Next.

    创建应用_基本信息_公共云

    1. In the Cluster Type section, click ECS Cluster.

    2. In the Application Runtime Environment section, click Java. In the Java Environment drop-down list, select Open JDK 8.

      The Spring Cloud application demo to be deployed in the ECS cluster is a Java Archive (JAR) package. Therefore, Java is selected as the application runtime environment in this example. If you want to deploy Spring Cloud, Dubbo, or HSF applications in the ECS cluster by using WAR packages, follow the instructions on this page to select an appropriate application runtime environment and version.

    3. Enter an application name in the Application Name field.

    4. (Optional) Enter a description for the application in the Application Description field.

  5. In the Configurations step, configure the deployment package and environment for the application, and click Next.

    应用配置页签

    Parameter

    Description

    Source of Deployment Package

    The source of the deployment package. In this example, Official Demo is used.

    Demo Type

    The demon type. In this example, Spring Cloud Server Application is selected.

    Instance Source

    The source of the instance. In this example, Purchase Instance is selected.

    Environment

    The environment of the application. In this example, Default Environment is selected.

    Purchase Method

    The method to purchase ECS instances. In this example, Purchase Based on Recommended Specifications is selected.

    Select Specifications

    The specifications of the ECS instances that you want to purchase. In this example, Ultra-low-spec Instance is selected.

    Quantity

    The number of ECS instances that you want to purchase. In this example, 1 is used.

    Logon Password

    The logon password of the ECS instance that you want to purchase.

    Terms of Service

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

    By default, the current timestamp is specified as the version number. The format of the version number is yyyymmdd:hhmmss.

  7. In the Creation Completed step, confirm Basic Information, Configurations, and Advanced Settings. Then, click Create Application.

    After EDAS starts to deploy the application, the message Application change in progress... is displayed in the upper part of the Basic Information tab. The deployment takes about 2 minutes.

    You can also click View Details next to the message to go to the Change Details page of the application. On this page, you can check the deployment progress and log data.

Create a consumer application

Repeat the steps in the "Create a provider application" section to create a consumer application. For more information, see Create a provider application.

Configure an Internet-facing Server Load Balancer (SLB) instance for the consumer application

An application is usually created and deployed in a VPC. Therefore, the application does not have a public IP address unless otherwise specified. If you want to allow access to your application over the Internet, we recommend that you configure an Internet-facing SLB instance for the application.

Note

In this case, 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 a region in the top navigation bar, select a microservices namespace from the Microservices Namespace drop-down list, and then select ECS Clusters from the Cluster Type drop-down list. Then, click the name of the consumer application that you created.

  4. On the Basic Information page, click the Basic Information tab. In the Application Settings section, click Add on the right side of 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.

Verify the result

The client-side application contains web services. After both the server-side and client-side applications are deployed, check whether you can log on to the web interface of the client-side application.