To help you experience how to deploy microservice-oriented applications in Enterprise Distributed Application Service (EDAS), EDAS provides microservice-oriented application demos of Spring Cloud, Dubbo, and High-speed Service Framework (HSF). You can deploy application demos to a custom ECS environment (specified ECS cluster). This topic uses an example to describe how to deploy microservice-oriented applications in a custom ECS environment.

Prerequisites

  • EDAS is activated. For more information, see Activate EDAS.
  • Auto Scaling is activated and authorized to access resources of other cloud services.
  • Microservice namespaces, virtual private clouds (VPCs), ECS clusters, and ECS instances are created to deploy a custom environment. You can create microservice namespaces and ECS clusters when you deploy applications. VPCs and ECS instances must be created before you deploy applications. For more information, see Create an IPv4 VPC and Create and manage an ECS instance by using the ECS console (express version)Quick start.
    Note When you create a VPC, select the region in which you want to deploy the application. When you create an ECS instance, select the created VPC. For the experience purpose, we recommend that you create only two pay-as-you-go ECS instances each of which has a single CPU core and 2 GB of memory. Release the created instances in time after the experience.

Background information

  • A custom ECS environment refers to an ECS cluster that resides in a specified microservice namespace and in a specified VPC in a region.
  • Application demos: You can use the microservice-oriented application demos in the EDAS console to deploy and call simple services. The microservice-oriented application demos use the Spring Cloud, Dubbo, and HSF frameworks. Each demo contains two applications. The procedures to deploy application demos that use different frameworks are similar. In this example, an application demo that uses the Spring Cloud framework is deployed.

    For more information about the microservice-oriented application demos, see alibabacloud-microservice-demo.

  • For more information about how to implement the features of an application with microservices, see Overview.

Deploy an application demo

Each microservice-oriented 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 same steps in this section to deploy the client-side application.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click 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 microservice namespace that you want to manage and click Create Application.
  4. In the Application Information step of the Create Application wizard, enter basic application information and click Next.
    Create an application

    1. In the Cluster Type section, click ECS Clusters.
    2. In the Application Runtime Environment section, click Java and select Open JDK 8 from the Java Environment drop-down list.
      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, and HSF applications in the ECS cluster by using WAR packages, follow the instructions on this page to select a proper application runtime and Java environment.
    3. Enter the name of the application in the Application Name field.
    4. Optional:Enter the description of the application in the Application Description field.
  5. In the Configurations step, configure the application package and environment settings, and then click Next.
    Deploy an application in a custom environment
    1. Select Official Demo as Source of Deployment Package.
    2. Select Spring Cloud Server Application from the Demo Type drop-down list.
    3. Select Custom Environment for the Environment parameter.
    4. Select the microservice namespace in which the created cluster resides from the drop-down list below the Microservice Namespaces parameter.
      If you create a cluster in the default microservice namespace, select the default microservice namespace.
    5. Select the cluster that you create from the drop-down list below the Cluster parameter.
    6. Select ECS instances that are added to the cluster from the instances below the Select Instance parameter.
  6. In the Advanced Application Settings step, specify the Version, Application Health Check, Batch, and Wait Time Before Next Batch parameters. Then, click Create Application.
    • Version: By default, the current timestamp is specified as the version number. The format of the version number is yyyymmdd:hhmmss.
    • In this example, the application demo is deployed to only one ECS instance. Therefore, set the Batch parameter to 1 Batches and the Wait Time Before Next Batch parameter to Automatic.
  7. In the Application has been created. step, confirm the settings of Application Information, Application Configuration, and Advanced Application Settings, and 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 page. 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.

  8. Repeat the preceding steps to deploy the client-side 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.