All Products
Search
Document Center

Enterprise Distributed Application Service:What do I do if I fail to start multiple HSF applications by using Ali-Tomcat?

Last Updated:May 23, 2023

Problem description

When Ali-Tomcat is used to start multiple High-speed Service Framework (HSF) applications on a machine at the same time, the temporary directory may fail to be deleted or class loading errors may occur.

Causes

When two HSF processes are started at the same time, they are decompressed to the same temporary directory and interfere with each other.

Solutions

  • Solution 1: Configure the following parameters in startup parameters.

    • -Dcom.taobao.pandora.tmp_path=: Use this parameter to specify different temporary decompression directories. This prevents the conflicts caused when different Ali-Tomcat processes occupy the same temporary directory.

    • -Dhsf.server.port=: Use this parameter to specify different service listening ports for different HSF applications. Default port: 12200. If you want to start multiple HSF providers in an on-premises environment, you can change the parameter value to prevent port conflicts.

    • -Dpandora.qos.port=: Use this parameter to specify different Quality of Service (QoS) ports for Pandora. Default port: 12201. If you want to start multiple HSF providers in an on-premises environment, you can change the parameter value to prevent port conflicts.

    • -Dproject.name=: Use this parameter to specify the name of the HSF application. By default, this parameter is enabled when the application is started.

      Note
  • Solution 2: Find the conf/server.xml configuration file in the Tomcat configuration file directory and change the listening port.

    Sample code:

    <Server port="8006" shutdown="TAOBAO-TOMCAT-SHUTDOWN">
    <Connector port="8080" protocol="HTTP/1.1"
        connectionTimeout="15000" redirectPort="8443" maxParameterCount="1000"
        maxThreads="250" maxPostSize="2097152" acceptCount="200" useBodyEncodingForURI="true" />