본문 바로가기
WAS/WEBLOGIC

27. window 스크립트

by coldplayer83 2024. 5. 8.
728x90

startA.cmd

@ECHO OFF
set SERVER_NAME=AdminServer
set DOMAIN_HOME=D:\Work\weblogic\wls14410\user_projects\domains\base_domain
set LOG_DIR=%DOMAIN_HOME%\logs
TITLE Server Name :%SERVER_NAME% # 이 창을 끄면 서비스가 종료됩니다.
if not exist %LOG_DIR% (
mkdir %LOG_DIR%
)
@REM ren %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX% move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX%
@rem ######## BACKUP DATE PREFIX ########
set PREFIX=%DATE:~0,10%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set USER_MEM_ARGS=-Xms512m -Xmx512m -XX:MaxMetaspaceSize=256m -XX:+UseParNewGC -verbosegc -XX:+PrintGCDetails -Xloggc:./logs/gclog.log
set USER_MEM_ARGS=%USER_MEM_ARGS% -Dweblogic.system.BootIdentityFile=%DOMAIN_HOME%\boot.properties
move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX%
start %DOMAIN_HOME%\bin\startWebLogic.cmd > %LOG_DIR%\%SERVER_NAME%.%out 2>&1
tail -f %LOG_DIR%\%SERVER_NAME%.out

 

startA.cmd (jdk7 버전)

@ECHO OFF
set SERVER_NAME=AdminServer
set DOMAIN_HOME=D:\10.3.6\1036_wls\user_projects\domains\base_domain
set LOG_DIR=%DOMAIN_HOME%\logs
TITLE Server Name :%SERVER_NAME% # 이 창을 끄면 서비스가 종료됩니다.
if not exist %LOG_DIR% (
mkdir %LOG_DIR%
)
@REM ren %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX% move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX%
@rem ######## BACKUP DATE PREFIX ########
set PREFIX=%DATE:~0,10%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set set USER_MEM_ARGS=-Xms2G -Xmx2G -XX:PermSize=2G -XX:MaxPermSize=2G -verbose:class
set USER_MEM_ARGS=%USER_MEM_ARGS% -Dweblogic.system.BootIdentityFile=%DOMAIN_HOME%\boot.properties
move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX%
start %DOMAIN_HOME%\bin\startWebLogic.cmd > %LOG_DIR%\%SERVER_NAME%.%out 2>&1
tail -f %LOG_DIR%\%SERVER_NAME%.out

 

기동시 다음과 같은 에러가 발생하면 USER_MEM_ARGS_64BIT로 바꿔서 작성

ERROR
-----------------------
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'"

 

참고) https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=71907500537816&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2703087.1&_afrWindowMode=0&_adf.ctrl-state=xnwri8h4q_4

 

https://login-ext.identity.oraclecloud.com/oauth2/v1/authorize?response_mode=form_post&response_type=id_token&scope=openid&IDCS_CG_ENC_VER=v2&state=jnEQcFw2djPXEVHgRRQx8MGCFyZULJpC-50AsGPU-pg&nonce=apy3r9mqFZr2vCr11IYFmHP5SwpJ7kqwyOeXfY7Ml3M&IDCS_IS_CLOUDGATE=true&X-HOST-IDENTIFIER-NAME=support.oracle.com&idcs_app_name=cb3a35b10af7484b9c706e5509a7961c&idcs_app_resource_url=https%3A%2F%2Fsupport.oracle.com%2Fepmos%2Ffaces%2FDocumentDisplay%3F_adf.ctrl-state%3Dxnwri8h4q_4%26_afrLoop%3D71907500537816%26_afrWindowMode%3D0%26id%3D2703087.1%26parent%3DEXTERNAL_SEARCH%26sourceId%3DPROBLEM&client_id=b2ea4a3d18dc476aa20c8c0eee2de79d&IDCS_CG_ENC=true&enc=__gYyprP8JOHAgAATQIAABAgTQIAADMCAAAQAAtftLfY4jPS2ZmwgCaHwi6ZOyzWln3aCvUGDJtl4sLwq41-Uigh5LBRIs6iw931QtzRI4KU5V_TH9ZHLc9oTQk5-1cN1kcXhyXxDkF2jPVkFWBxlJeTjynyj5bs-UD7eoP8CiXP9DWoz6UexO_4CFf_lMY3dH92l9q36iWBC2iEy-bkO6Xju94biYHhuA3CZRrjxSZphuRZUSWTOCioOHdbN6gKT6-4RcIm2xthCxAwjqUMkkQmPvsEhXiovpEqX2gK6k4qGkGQvaDhy8M7GeGFDxD5I3R40ZRp-p9eMMhKrMCncr3ZUSJton57l8e1eYJK1U-PB_anGQ7giTT5-WfGDMICHF0hJRV1V5M9DtE4D9AI-kw9Z7jVflY2HCbgUytCqjxNto3JEDLlx-ZA5Vt5b5laSFlmzZBYQZpWRSX4MlEGsPBmpzXRjfZ794zS_bHkHT_-nG4rL10QO_BZB7Ea5Wuh7VLGw8FIZy3Ito74CkV6FgX4TG4aQnfC2q1mtCRjXEUE4PgF_swRwUwmVqSvkZiYGXDSYlsL_2kTp3NFUGPmAT55oP2RkcH_sWge_mEzVVaYCg7x5q8basoVHj0_w_nvHR-vEXwwp8deg5_TnH08OgvyNkGnMzei_S2eUCjEtTduOWmTnPXUo-P_-oTUF02HD6DmId99Bql_96Ofu9JJsQ_zKjkPy6oCYImZcPILMvjoRzhOF9c5Mr7P7v72yPH68N4HPZzGm6XLvuKXuu4bBfbhKPCx52c3OPG3KhriB5aNHbiUm6HN4zDMPSAQ1T8Usz9EbWRhPf2-BldLHG4MyLB7GK7r0CWNk1hKmyfunw

 

login-ext.identity.oraclecloud.com

 

startM1.cmd

@ECHO OFF
set ADMIN_URL="t3://192.168.56.1:7001"
set SERVER_NAME=m1
set DOMAIN_HOME=D:\Work\weblogic\wls14410\user_projects\domains\base_domain
set LOG_DIR=%DOMAIN_HOME%\logs
TITLE Server Name :%SERVER_NAME% # 이 창을 끄면 서비스가 종료됩니다.
if not exist %LOG_DIR% ( mkdir %LOG_DIR% )
@REM ren %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX% move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.out.%PREFIX%
@rem ######## BACKUP DATE PREFIX ########
set PREFIX=%DATE:~0,10%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set USER_MEM_ARGS=-Xms512m -Xmx512m -XX:MaxMetaspaceSize=256m -XX:+UseParNewGC -verbosegc -XX:+PrintGCDetails -Xloggc:./logs/gclog.log
set USER_MEM_ARGS=%USER_MEM_ARGS% -Dweblogic.system.BootIdentityFile=%DOMAIN_HOME%\boot.properties
move %LOG_DIR%\%SERVER_NAME%.out %LOG_DIR%\%SERVER_NAME%.%PREFIX%
ECHO %SERVER_NAME% start
start %DOMAIN_HOME%\bin\startManagedWebLogic.cmd m1 %ADMIN_URL% > %LOG_DIR%\%SERVER_NAME%.%out 2>&1
tail -f %LOG_DIR%\%SERVER_NAME%.out

 

 

정지 스크립트는 별도로 만들 필요는 없지만 요청시 생성

 

stop.py

connect(url=sys.argv[1])
shutdown(force='true')
exit()

 

stopM1.cmd

call bin\setDomainEnv.cmd
java weblogic.WLST stop.py t3://10.0.2.15:7010

 

 

위의 방식이 잘 동작하지 않는 경우 아래와 같이 개별 인스턴스 정지를 위한 py 스크립트를 생성

(stop.py를 공통으로 사용하지 않는 방식)

 

stopM1.py

UserID = java.lang.System.getenv('weblogic') ##콘솔 접속을 위한 콘솔 ID
wlsPassword = java.lang.System.getenv('weblogic1') ## 콘솔 PASSWORD
connect(url='t3://10.0.2.15:7001',adminServerName='AdminServer') ## AdminServer 정보
shutdown('M1','Server',ignoreSessions='true',force='true') ## 정지 시킬 인스턴스
exit()

 

stopM1.cmd

call bin\setDomainEnv.cmd
java weblogic.WLST stopM1.py

 


 

startM1.cmd 실행시 아래와 같은 에러가 발생하면 다음과 같이 조치

No stack trace available.
Problem invoking WLST - Traceback (innermost last):Problem invoking WLST - Traceback (innermost last):
  File "C:\sw\12c\domains\base_domain\stopManaged1.py", line 1, in ?  File "C:\sw\12c\domains\base_domain\stopManaged1.py", line 1, in ?
  File "<iostream>", line 19, in connect  File "<iostream>", line 19, in connect
  File "<iostream>", line 553, in raiseWLSTException  File "<iostream>", line 553, in raiseWLSTException
WLSTException: Error occurred while performing connect : "No valid username/password or userConfigFile/userKeyFile provided"WLSTException: Error occurred while performing connect : "No valid username/password or userConfigFile/userKeyFile provided"

 

참고) https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=268278944224363&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2633650.1&_afrWindowMode=0&_adf.ctrl-state=7tngd24na_53

 

https://login-ext.identity.oraclecloud.com/oauth2/v1/authorize?response_mode=form_post&response_type=id_token&scope=openid&IDCS_CG_ENC_VER=v2&state=bnkDns1nTvTxJ42yBpv80CnejcDz6yN3yAMzejlj1lw&nonce=AmuLKSaDED2xfR3M-il6AJuzccTDvu7fCKUabRehImk&IDCS_IS_CLOUDGATE=true&X-HOST-IDENTIFIER-NAME=support.oracle.com&idcs_app_name=cb3a35b10af7484b9c706e5509a7961c&idcs_app_resource_url=https%3A%2F%2Fsupport.oracle.com%2Fepmos%2Ffaces%2FDocumentDisplay%3F_adf.ctrl-state%3D7tngd24na_53%26_afrLoop%3D268278944224363%26_afrWindowMode%3D0%26id%3D2633650.1%26parent%3DEXTERNAL_SEARCH%26sourceId%3DPROBLEM&client_id=b2ea4a3d18dc476aa20c8c0eee2de79d&IDCS_CG_ENC=true&enc=e7lQ2ed0eOOJAgAATwIAABAgTwIAADUCAAAQALE2XQuRHOW_ejxLML_QvBNkwToRxCv6FB4Mu83CW7t5Pl55IpBnGO16TsgX04cwG13qCl6wYdWocJtTBsQ4dKpOiPBZlkEUdQy7dg0gUVs3vFOhjyktgfIhvHuq3VdSIDqldMrarLUK3Nv5JLe3DDaCiTdi982u5wwSU1lNusDf13pRWHWquVT912BcFbPf0y9RYSyGXlSFXI5tCKzJGJ7kHQzxRKgU2A3_ZGbLCvH6eOEzj-lKzuTbY-0R3SjQJiJQnNHAeBJsweL6eJRtR2IqT1PTAr6xqW0YNEJBQSe5VWHgnBbMH5OSGN61fPf1WyGkd6r1x7Cxs9jS5QgutBXnWLox-eQKrb8ttV9Ogy3i8HVpyyqtSNYiFTygg6SXbt0eoRyLWs8WarerYYal3ap2FtjAobKlOqtLIQjC_q5vUTHFWw-9zm3disJjgztoIcwwLYxW8uUo2e-vBkpQBMlO5T7U-qqLVoQKkgbM0AaGrl9ENICoei_o86Y1vgPK-zh2SqjRKTaEUbmbme7dwIbJuskwESl3gYhAH2iSjIlEiymTS-IXw6s3LATqzZGR1ht9xPOTnnyivcteEpAxSXD6_IFiv9JcIgDLayyrLD7oy4ILngfbKTXFymhmHDamYsCM_wsdjcrKjkerDitJUllP3K_iCSfxAA3RLLBTNcXAHihLc4IvviHnCCui4foeU_C7WwHxYM4c0r-TTZ9cg-Am49gzSfSvLrvUkZcCAbqOQiH2ZylF8Jo_MEzAjXf11lmA-DISiRFmg5RiovbQYcABJJHspL2YCSbzTJ4xZv0DDOypBwiVo1XuTxhBerYXmk4yt-jG

 

login-ext.identity.oraclecloud.com

 

1) ${DOMAIN_HOME}/server/Adminserver 하위에 security 디렉토리 생성

 

2) security 디렉토리에 boot.properties 파일 생성

 

3) 서버 재기동