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.
NoteFor more information about how to configure Java Virtual Machine (JVM) parameters, see Set JVM parameters.
For more information about the parameters, see Set JVM -D startup parameters.
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" />