Linux deployer

From:

1. Steps for deploying the applet on Linux:
1. Jar package: All jar packages used by the running program.
2. Some configuration files: such as xml and properties files used for running.
3. Record the logs of the program running. These specified log file names can be configured in log4j.properties.
4. Start the sh file that runs the script.

The first sh file format:
an example of a sh file is as follows:
#!/bin/sh
# ------------------------------ ----------------------------------------------
JAVA_HOME=/usr /java/jdk1.5.0_06
DataCompare_HOME=/usr/local/bbass_application/bbass-compare/
DataCompare_LIB=/usr/local/bbass_application/common-lib/
cd "$DataCompare_HOME"
DataCompare_PATH="$DataCompare_LIB"bbass-interface-4.25. jar:"$DataCompare_LIB"jxl.jar:"$DataCompare_LIB"commons-collections.jar:"$DataCompare_LIB"commons-bbass-dao-4.25.jar:"$Dat
aCompare_LIB"antlr-2.7.4.jar:"$DataCompare_LIB"asm-1.5.3.jar:"$DataCompare_LIB"quartz-1.4.5.jar:"$DataCompare_LIB"spring.jar:"$DataCompare_LIB"commons-logging.jar:"$DataCompare_L
IB"log4j-1.2.8.jar:"$DataCompare_LIB"aopalliance.jar:"$DataCompare_LIB"c3p0-0.8.4.5.jar:"$DataCompare_LIB"cglib-2.1.2.jar:"$DataCompare_LIB"commons-DataCompares.jar:"$DataCompare
_LIB"commons-dbcp-1.2.1.jar:"$DataCompare_LIB"commons-lang-2.0.jar:"$DataCompare_LIB"commons-pool-1.2.jar:"$DataCompare_LIB"dom4j-1.4.jar:"$DataCompare_LIB"edtftpj-1.5.2.jar:"$Da
taCompare_LIB"ehcache-1.1.jar:"$DataCompare_LIB"framework-binding-1.2.jar:"$DataCompare_LIB"ognl.jar:"$DataCompare_LIB"hibernate3.jar:"$DataCompare_LIB"jboss-j2ee.jar:"$DataCompa
re_LIB"ojdbc14.jar
CLASSPATH="DataCompareBasePortBySubRegion_Thread":"$DataCompare_HOME":"$DataCompare_PATH":"$CLASSPATH"
echo "$CLASSPATH"
"$JAVA_HOME"/bin/java -Xms512m -Xmx512m -classpath "$CLASSPATH" com.huaxia.bbass.datacompare .trigger.DataCompareTrigger /"$DataCompare_HOME"/applicationContext-datacompareBasePor
tBySubRegion.xml &
can be described in the sh file:
1. Specify the current path where the program runs
2. The path to load the jar package
3. The path to call jdk
4. Process name
5. You can specify the size of the allocated memory (this can solve the problem of memory overflow in some cases). In
the above file: DataCompareBasePortBySubRegion_Thread specified in the variable CLASSPATH is the process name,
and multiple parallel paths in the sh file are generally used ": "Separate. All paths are specified in CLASSPATH.
$JAVA_HOME"/bin/java -Xms512m -Xmx512m -classpath "$CLASSPATH" The CLASSPATH variable is referenced here, followed by the startup class that exists in the jar, and the class is sometimes followed by the parameters required by the main method. The "&" symbol specifies that the process can be executed in the background.

The second deployer sh file format:
#! /bin/sh
JAVA_HOME=/usr/java/jdk1.5.0_06
CLASSPATH=Speedup_MarkState:./
for jar in ../lib/*.jar
do
CLASSPATH=$CLASSPATH:$ jar
done
echo "$CLASSPATH"
nohup "$JAVA_HOME"/bin/java -Xms256m -Xmx512m -classpath $CLASSPATH com.huaxia.bbass.speedupMonitor.run.MarkSpeedUpStateRun &
The difference between this format is: use the sh script language to read cyclically Take the jar file in the lib package, and the deployment is simple.


Note: java.lang.OutOfMemoryError: Java heap space error is thrown when the file is read, or the program is running.
Can be set in the .sh file: -Xms768m -Xmx768m
such as: /usr/java/jdk1.5.0_06/bin/java -server -Xms768m -Xmx768m -classpath "$CLASSPATH" com.huaxia.bbass.speedupMonitor.run.SpeedUpMonitor &



The running program in the windows platform can write bat files.
2. Methods and steps for solving some web interface errors:
1. Errors reported on the existing network interface
2. You can log in to the web server on the live network, and cd to the tomcat file published by the web project.
3. tail -f catalina.out Click the page button to view the exception and find out the cause of the problem according to the exception information.
The corresponding bat file under the windows platform is
as follows:
@echo off    
REM SET UP CLASSPATH    
set CLASSPATH=./
set LIB=./lib
FOR %%F IN (./lib/*.jar) DO call :setclasspath % %F
echo %CLASSPATH%   
goto :startjava    
:setclasspath    
set CLASSPATH=%CLASSPATH%;%LIB%/%1
goto :eof    
:startjava    
java -classpath %CLASSPATH% RefreshPortForAdslplus

3. Deploy the web project to the company test environment
linux: install linux Under tomcat, convert the normal web function of the local test into a war package, upload it to /tomcat/webapps of the company's test server,
check the port number configured in the directory /tomcat/conf/server.xml, and start /tomcat/bin /startup.sh file, logs are in /tomcat/logs/catalina.out,
to access the page.
Note: 1. The <wb-module deploy-name="bbass"> name configured in the .component file in the /.settings directory under the project in Eclipse
is of the war package deployed to /tomcat/webapps. And there are many times in the project that the path of some images will be written as an absolute path starting with this configuration name.

2. The name of the url to access the web project (sometimes it is not the name of the web project), namely: bbass in hhtp://localhost:8080/bbass.
Configuration method: right-click on the project name---->Properties---->Web Project Settings to set the value of Context root
or configure <property name="context-root" value in the .component file in the /.settings directory The value of ="bbass"/>.
Both have the same effect and will be modified in conjunction.

3. The name of the project is configured in the .project file of the project, whether it is to modify the project name directly or configure it in the .project file, it is the same, linked modification.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327072632&siteId=291194637