When you create or deploy an application in a Container Service Kubernetes cluster or a serverless Kubernetes cluster by using a WAR or JAR package, you can configure parameters including the application port, the access path, and the maximum number of threads.

Configure Tomcat when you create an application

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace in the upper part and click Create Application in the upper-left corner.
  3. In the Basic Information step, set Cluster Type and Application Runtime Environment, and click Next.
    Parameter Description
    Cluster Type Select Kubernetes Clusters.
    Application Runtime Environment Select the Java application type and deploy the application by using a JAR package or a WAR package.
    • Custom: Select this option if you want to use the Tomcat configuration of the application. If you select this option, you can use an image to deploy the application. If you select a custom runtime environment, Tomcat Configuration does not appear on the Advanced Application Settings tab.
    • Java: Select this option if you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application. You can specify the Java Environment parameter after you select this option.
    • Tomcat: Select this option if you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application. You can specify the Java Environment and Container Version parameters after you select this option.
    • EDAS-Container (HSF): Select this option if you want to use a WAR or FatJar package to deploy the application as a High-Speed Service Framework (HSF) application. You can specify the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.
  4. In the Configurations step, configure the environment information, basic information, deployment method, and resource parameters for the application, and click Next.
  5. In the Advanced Settings step, click Tomcat Configuration, select Custom Configuration, and click Edit next to Custom Configuration. In the Application Settings dialog box, set the parameters in the following table, and click OK.
    Parameter Description
    Application Port The port range is 1024 to 65535. The admin permission is configured for the container, but the root permission is required to perform operations on ports with numbers less than 1024. Therefore, enter a value greater than 1024 within the range. If you do not specify this parameter, the default number 8080 is used.
    Tomcat Context Select an application access path:
    • Package Name: The application access path is the name of the JAR package or the WAR package. You do not need to enter a custom path.
    • Root Directory: The application access path is /. You do not need to enter a custom path.
    • Custom: If you select this option, you must set Custom Path to a custom path.
    Maximum Threads Specify the maximum number of connections in the connection pool. This parameter corresponds to the maxThreads parameter. The default value is 400.
    Warning This parameter has great impacts on the application performance. We recommend that you set this parameter under professional guidance.
    Tomcat Encoding Select an encoding format for Tomcat. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not specify this parameter, the default value ISO-8859-1 is used.
    Use Advanced Settings When the preceding parameter type and specific parameters cannot meet your requirements, select Use Advanced Settings to directly edit the Server.xml file of Tomcat.
    Notice This parameter is available only if a WAR package is used for deployment.
  6. Click Create Application.
  7. In the Creation Completed step, confirm the settings in Basic Information, Configurations, and Advanced Settings, and click Create Application.
    In the upper part of the Application Overview page, click View Details. On the Change List page, you can view the change process. Wait a few minutes until the application is deployed. After the change process is complete, view the running status of the instances in the Basic Information section of the Application Overview page. If the pod that runs the application is in the running state, the application is deployed.

Configure Tomcat when you update an application

You can configure Tomcat when you create an application, or configure or update Tomcat when you deploy an application.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace in the upper part, and select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, find the application that you want to deploy, and click the application name.
  3. On the Application Overview or Basic Information page, choose Deploy > Deploy in the upper-right corner.
  4. On the Select Deployment Mode page, select a deployment mode and click Start Deployment in the upper-right corner of the specified deployment mode section.
  5. Set the application environment and deployment package information. In the Advanced Application Settings step, click Tomcat Configuration, select Custom Configuration, and click Edit next to Custom Configuration. In the Edit Tomcat Configuration dialog box, set the parameters in the following table, and click OK.
    Parameter Description
    Application Port The port range is 1024 to 65535. The admin permission is configured for the container, but the root permission is required to perform operations on ports with numbers less than 1024. Therefore, enter a value greater than 1024 within the range. If you do not specify this parameter, the default number 8080 is used.
    Tomcat Context Select an application access path:
    • Package Name: The application access path is the name of the JAR package or the WAR package. You do not need to enter a custom path.
    • Root Directory: The application access path is /. You do not need to enter a custom path.
    • Custom: If you select this option, you must set Custom Path to a custom path.
    Maximum Threads Specify the maximum number of connections in the connection pool. This parameter corresponds to the maxThreads parameter. The default value is 400.
    Warning This parameter has great impacts on the application performance. We recommend that you set this parameter under professional guidance.
    Tomcat Encoding Select an encoding format for Tomcat. Valid values: UTF-8, ISO-8859-1, GBK, and GB2312. If you do not specify this parameter, the default value ISO-8859-1 is used.
    Use Advanced Settings When the preceding parameter type and specific parameters cannot meet your requirements, select Use Advanced Settings to directly edit the Server.xml file of Tomcat.
    Notice This parameter is available only if a WAR package is used for deployment.
    Notice The application is restarted after you click OK. We recommend that you perform this operation during off-peak hours.

Verify the result

  • Method 1

    In the left-side navigation pane of the application details page, click Change List to view the application change details. If the value in the Change Status column is Succeeded, the application is deployed and the configuration takes effect.

  • Method 2

    On the Application Overview page, click Running Pods (Click View) next to Running Status. In the Pod section of the panel that appears, check the Status column of the pods. If a green dot appears, the application is in the running state. This means that the application is deployed as expected and the configuration takes effect.