본문 바로가기
TOMCAT/multi instance 사용

실행 스크립트 작성

by 정윤재 2016. 7. 1.

rem # smps_start_script
rem ===================================
rem Server명
set SERVER_NAME=spms
rem JAVA_HOME
set JAVA_HOME=C:\Java\jdk1.7.0_80
rem tomcat 엔진 경로
set CATALINA_HOME=D:\app\tomcat7.0.70
rem 도메인 위치
set CATALINA_BASE=D:\app\tomcat7.0.70\domains\spms
rem gc option
set GC_LOG_HOME=%CATALINA_BASE%\logs\gc
for /f "tokens=1-4 delims=/ " %%i in ('date /t') do set date=%%i%%j%%k%%l
for /f "tokens=1-3 delims=: " %%i in ('time /t') do set time=%%j-%%k
set datetime=%date%.%time%
set GC_LOG=gc_%SERVER_NAME%_%datetime%.log
set GC_OPTION=-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:%GC_LOG_HOME%\%GC_LOG%
rem out of memory option
set OOM_OPTION=-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=-Xloggc:%CATALINA_BASE%\logs
rem # set mem_args
set USER_MEM_ARGS=-Xms512m -Xmx512m -XX:NewSize=192m -XX:MaxNewSize=384m -XX:PermSize=128m -XX:MaxPermSize=256m

rem tomcat option
set CATALINA_OPTS=-Denv=product -Denv.servername=%SERVER_NAME% %GC_OPTION% %OOM_OPTION% %USER_MEM_ARGS%
rem ===================================


rem start_tomcat
call %CATALINA_HOME%\bin\startup.bat




댓글