This topic explains how to resolve multiple High-speed Service Framework (HSF) application startup issues with Ali-Tomcat.
Symptom
When starting multiple HSF applications simultaneously on the same instance using Ali-Tomcat, you may encounter errors related to temporary directory deletion or class loading errors.
Possible cause
When two HSF processes start simultaneously, they attempt to extract files to the same temporary directory, causing interference.
Solutions
Solution 1: Configure startup parameters. Add the following JVM parameters to avoid conflicts:
-Dcom.taobao.pandora.tmp_path= : Specifies different temporary extraction directories to avoid conflicts when different Tomcat processes use the same temporary directory.
-Dhsf.server.port= : Assigns different service listener ports for HSF to prevent port conflicts. The default value is 12200. To start multiple HSF providers in an on-premises environment, change the parameter value accordingly.
-Dpandora.qos.port= : Sets different Quality of Service (QoS) ports for Pandora to prevent port conflicts. The default value is 12201. To start multiple HSF providers in an on-premises environment, change the parameter value as needed.
-Dproject.name= : Defines the application name for HSF, which is automatically initiated upon application deployment.
For more information, see and Configure a startup command. For more details about the parameters, see JVM -D startup configuration parameters.
Solution 2: Locate the conf/server.xml configuration file in the Tomcat configuration directory and modify the listener ports.
An example is provided below:
<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" />