본문 바로가기

WAS - WebLogic/설치

[weblogic] 설치 가이드 | 12c/14c | Linux/Unix

업데이트 날짜 : 2024/10/31

 


 

JDK 설치

Oracle JDK 1.8 이상

IBM JDK 1.8 이상

 


 

엔진 설치 (Silent 방식 - oraInst.loc, wls.rsp 필요)

WebLogic 설치할 디렉토리 생성

  • mkdir -p /app/weblogic/weblogic_12214

 

설치에 필요한 파일 생성

#01. wls.rsp

[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0

[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/app/weblogic/weblogic_12214

#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server

#MyOracleSupport Account
MOS_USERNAME=
MOS_PASSWORD=<SECURE_VALUE>

#Set this to true if you wish to skip software updates
DECLINE_AUTO_UPDATES=true

#Set this to true if you wish to decline the security updates.
DECLINE_SECURITY_UPDATES=true

#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

 

#02. oraInst.loc

inventory_loc=/app/weblogic/inventory_12214
inst_group=ehc

 

설치 실행 명령어

java -jar 설치파일 -slient -responseFile 파일위치 -invPtrLoc 파일위치

--------------------------------------------------------------------

/usr/jdk/jdk1.8/jdk1.8.0_261/bin/java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /app/weblogic/install_files/wls.rsp -invPtrLoc /app/weblogic/install_files/oraInst.loc​

 


 

도메인 구성

silent 로 진행하기 위해 필요한 파일 생성

domain.py

readTemplate('/app/weblogic/weblogic_12214/wlserver/common/templates/wls/wls.jar');
setOption('JavaHome', '/usr/jdk/jdk1.8/jdk1.8.0_261');
setOption('ServerStartMode', 'prod')

cd('Security/base_domain/User/weblogic');
set('Name', 'weblogic');
cmo.setPassword('weblogic1');

cd('Servers/AdminServer');
set('Name','AdminServer');
set('ListenAddress','192.168.0.2');
set('ListenPort',9000);

cd('/');
writeDomain('/app/weblogic/weblogic_12214/domains/ehc_domain');
closeTemplate();
exit();

 

실행 명령어

디렉토리 이동
{WEBLOGIC_HOME}/oracle_common/common/bin

도메인 설정 실행
./wlst.sh ../domain.py

 


 

서버 기동 스크립트 - Oracle JAVA 기준 (1.8 버전)

startA.sh

##### server info #####

DOMAIN_NAME=test
DOMAIN_HOME=/app/weblogic12214/domains/${DOMAIN_NAME}_domain
SERVER_NAME=AdminServer
BOOT_PROPERTIES=${DOMAIN_HOME}/boot.properties

#--------------------------------------------------------------------------------------

##### user & process check #####

#user check
USER=`whoami`

if [ "$USER" != "midadm" ]
then
	echo =============================================
	echo You are not weblogic user, Please change user
	echo =============================================
	exit
fi

#process running check
WLS_PROCESS=`ps -ef|grep java|grep D${DOMAIN_NAME}_${SERVER_NAME}|awk '{print $1}'`

if [ "$WLS_PROCESS" != "" ]
then
    echo ==============================================
    echo [${DOMAIN_NAME}_${SERVER_NAME}] Process Is Already Running !!!
    echo ==============================================
    exit
fi

#--------------------------------------------------------------------------------------

##### server settings #####

#instance info
JAVA_OPTIONS="${JAVA_OPTIONS} -D${DOMAIN_NAME}_${SERVER_NAME}"

#boot_properties
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${BOOT_PROPERTIES}"

#urandom
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:///dev/./urandom"

#ipv4 options
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.net.preferIPv4Stack=true"

#heap memory options
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms1024m -Xmx1024m"

#disable derby server
export DERBY_FLAG=false

#--------------------------------------------------------------------------------------

##### log directory #####

#log_directory
LOG_DIR=/logs/weblogic/${DOMAIN_NAME}/${SERVER_NAME}

#make log directory
if [ ! -d $LOG_DIR ]; then
    mkdir -p $LOG_DIR/stdout
    mkdir -p $LOG_DIR/serverlog
    mkdir -p $LOG_DIR/access
fi

#log_time
LOG_TIME=$(date +"%Y%m%d_%H_%M")

#--------------------------------------------------------------------------------------

##### server start #####

#export args
export USER_MEM_ARGS JAVA_OPTIONS 

#stdout log_backup
mv ${LOG_DIR}/stdout/${SERVER_NAME}.out ${LOG_DIR}/stdout/${SERVER_NAME}.out_${LOG_TIME}

#server_start
nohup ${DOMAIN_HOME}/bin/startWebLogic.sh >> ${LOG_DIR}/stdout/${SERVER_NAME}.out 2>&1 &
#tail -f $LOG_DIR/$SERVER_NAME.out

 

startM.sh

##### server info #####

DOMAIN_NAME=test
DOMAIN_HOME=/app/weblogic12214/domains/${DOMAIN_NAME}_domain
SERVER_NAME=MServer1
ADM_URL="t3://127.0.0.1:1000"
BOOT_PROPERTIES=${DOMAIN_HOME}/boot.properties

#--------------------------------------------------------------------------------------

##### user & process check #####

#user check
USER=`whoami`

if [ "$USER" != "midadm" ]
then
	echo =============================================
	echo You are not weblogic user, Please change user
	echo =============================================
	exit
fi

#process running check
WLS_PROCESS=`ps -ef|grep java|grep D${DOMAIN_NAME}_${SERVER_NAME}|awk '{print $1}'`

if [ "$WLS_PROCESS" != "" ]
then
    echo ==============================================
    echo [${DOMAIN_NAME}_${SERVER_NAME}] Process Is Already Running !!!
    echo ==============================================
    exit
fi

#--------------------------------------------------------------------------------------

##### server settings #####

#instance info
JAVA_OPTIONS="${JAVA_OPTIONS} -D${DOMAIN_NAME}_${SERVER_NAME}"

#boot_properties
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${BOOT_PROPERTIES}"

#urandom
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:///dev/./urandom"

#ipv4 options
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.net.preferIPv4Stack=true"

#2023_08_03 - disable jdbc.fan
JAVA_OPTIONS="${JAVA_OPTIONS} -Doracle.jdbc.fanEnabled=false"

#heap memory options
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms2048m -Xmx2048m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m"

#thread pool options
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.threadpool.MinPoolSize=100  -Dweblogic.threadpool.MaxPoolSize=200"

#disable derby server
export DERBY_FLAG=false

#classpath
CLASSPATH="${CLASSPATH}"

#--------------------------------------------------------------------------------------

##### log directory #####

#log_directory
LOG_DIR=/logs/weblogic/${DOMAIN_NAME}/${SERVER_NAME}

#make log directory
if [ ! -d $LOG_DIR ]; then
    mkdir -p $LOG_DIR/stdout
    mkdir -p $LOG_DIR/serverlog
    mkdir -p $LOG_DIR/access
    mkdir -p $LOG_DIR/gc
    mkdir -p $LOG_DIR/dump_files
fi

#log_time
LOG_TIME=$(date +"%Y%m%d_%H_%M")

#--------------------------------------------------------------------------------------

##### GC & dump files #####

#GC
JAVA_OPTIONS="${JAVA_OPTIONS} -verbose:gc -Xloggc:${LOG_DIR}/gc/gc_${SERVER_NAME}.log"
JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+DisableExplicitGC"
JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+UseG1GC"

#heapdump options
JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${LOG_DIR}/dump_files/heapdump_${SERVER_NAME}.hprof"

#--------------------------------------------------------------------------------------

##### Jennifer5 #####

#jennifer5
#JAVA_OPTIONS="${JAVA_OPTIONS} -Djennifer.config=/app/jennifer5/5.4.3.2/agent.java/conf/${DOMAIN_NAME}_${SERVER_NAME}.conf"
#JAVA_OPTIONS="${JAVA_OPTIONS} -javaagent:/app/jennifer5/5.4.3.2/agent.java/jennifer.jar"

#--------------------------------------------------------------------------------------

##### ETC  #####

#export LANG=ko_KR.UTF-8

#--------------------------------------------------------------------------------------

##### server start #####

#export args
export JAVA_OPTIONS USER_MEM_ARGS EXT_PRE_CLASSPATH LD_LIBRARY_PATH

#stdout log_backup
mv ${LOG_DIR}/stdout/${SERVER_NAME}.out ${LOG_DIR}/stdout/${SERVER_NAME}.out_${LOG_TIME}

#gc log backup
mv ${LOG_DIR}/gc/gc_${SERVER_NAME}.log ${LOG_DIR}/gc/gc_${SERVER_NAME}.log_${LOG_TIME}

#server_start
nohup ${DOMAIN_HOME}/bin/startManagedWebLogic.sh ${SERVER_NAME} ${ADM_URL} >> ${LOG_DIR}/stdout/${SERVER_NAME}.out 2>&1 &
#tail -f ${LOG_DIR}/${SERVER_NAME}.out

 


 

서버 기동 스크립트 - IBM JAVA 기준 (1.8 버전)

startA.sh

##### server info #####

DOMAIN_NAME=k8s_domain
DOMAIN_HOME=/app/sw/weblogic/wls14/domains/$DOMAIN_NAME
SERVER_NAME=AdminServer
BOOT_PROPERTIES=${DOMAIN_HOME}/boot.properties

#--------------------------------------------------------------------------------------

##### server settings #####

#instance info
JAVA_OPTIONS="${JAVA_OPTIONS} -D${DOMAIN_NAME}_${SERVER_NAME}"

#boot_properties
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${BOOT_PROPERTIES}"

#urandom
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:///dev/./urandom"

#ipv4 options
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.net.preferIPv4Stack=true"

#heap memory options
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms1g -Xmx1g -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m"

#disable derby server
export DERBY_FLAG=false

#--------------------------------------------------------------------------------------

##### log & dump settings #####

#log directory
LOG_DIR=/app/log/weblogic/${DOMAIN_NAME}${SERVER_NAME}

#make log directory
if [ ! -d $LOG_DIR ]; then
    mkdir -p $LOG_DIR/stdout
    mkdir -p $LOG_DIR/serverlog
    mkdir -p $LOG_DIR/access
fi

#log_time
LOG_TIME=$(date +"%Y%m%d_%H_%M")

#--------------------------------------------------------------------------------------

##### server start #####

#export args
export JAVA_OPTIONS 

#stdout log_backup
mv ${LOG_DIR}/stdout/${SERVER_NAME}.out ${LOG_DIR}/stdout/${SERVER_NAME}.out_${LOG_TIME}

#server_start
nohup ${DOMAIN_HOME}/bin/startWebLogic.sh >> ${LOG_DIR}/stdout/${SERVER_NAME}.out 2>&1 &

#tail -f ${LOG_DIR}/${SERVER_NAME}.out

 

startM.sh

##### server info #####

DOMAIN_NAME=k8s_domain
DOMAIN_HOME=/app/sw/weblogic/wls14/domains/$DOMAIN_NAME
SERVER_NAME=m1
BOOT_PROPERTIES=${DOMAIN_HOME}/boot.properties
ADM_URL="t3://0.0.0.0:9000"

#--------------------------------------------------------------------------------------

##### server settings #####

#instance info
JAVA_OPTIONS="${JAVA_OPTIONS} -D${DOMAIN_NAME}_${SERVER_NAME}"

#boot_properties
JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.system.BootIdentityFile=${BOOT_PROPERTIES}"

#urandom
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:///dev/./urandom"

#ipv4 options
JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.net.preferIPv4Stack=true"

#heap memory options
JAVA_OPTIONS="${JAVA_OPTIONS} -Xms2g -Xmx2g -XX:MetaspaceSize=1g -XX:MaxMetaspaceSize=1g"

#disable derby server
export DERBY_FLAG=false

#--------------------------------------------------------------------------------------

##### log & dump settings #####

#log directory
LOG_DIR=/app/log/weblogic/${DOMAIN_NAME}${SERVER_NAME}

#make log directory
if [ ! -d $LOG_DIR ]; then
    mkdir -p $LOG_DIR/stdout
    mkdir -p $LOG_DIR/serverlog
    mkdir -p $LOG_DIR/access
    mkdir -p $LOG_DIR/gc
    mkdir -p $LOG_DIR/dump_files
fi

#log_time
LOG_TIME=$(date +"%Y%m%d_%H_%M")

#GC
JAVA_OPTIONS="${JAVA_OPTIONS} -verbose:gc -Xloggc:${LOG_DIR}/gc/gc_${SERVER_NAME}.log"
JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+DisableExplicitGC"
JAVA_OPTIONS="${JAVA_OPTIONS} -XX:+UseG1GC"

#dump files
export IBM_HEAPDUMPDIR=${LOG_DIR}/dump_files
export IBM_JAVACOREDIR=${LOG_DIR}/dump_files
export IBM_COREDIR=${LOG_DIR}/dump_files

#--------------------------------------------------------------------------------------

##### server start #####

#export args
export JAVA_OPTIONS 

#stdout log_backup
mv ${LOG_DIR}/stdout/${SERVER_NAME}.out ${LOG_DIR}/stdout/${SERVER_NAME}.out_${LOG_TIME}

#gc log backup
mv ${LOG_DIR}/gc/gc_${SERVER_NAME}.log ${LOG_DIR}/gc/gc_${SERVER_NAME}.log_${LOG_TIME}

#server_start
nohup ${DOMAIN_HOME}/bin/startManagedWebLogic.sh ${SERVER_NAME} ${ADM_URL} >> ${LOG_DIR}/stdout/${SERVER_NAME}.out 2>&1 &

#tail -f ${LOG_DIR}/${SERVER_NAME}.out

 


 

stdout 로그 tail 프로세스

logA.sh / logM.sh

#server name
DOMAIN_NAME=test
SERVER_NAME=AdminServer

#log directory
LOG_DIR=/logs/weblogic/${DOMAIN_NAME}/${SERVER_NAME}/stdout

#execute tail
tail -100f $LOG_DIR/$SERVER_NAME.out

 


 

서버 중지 스크립트

stop.py

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

 

stop.sh

##### user check #####

#user check
USER=`whoami`

if [ "$USER" != "midadm" ]
then
        echo =============================================
        echo You are not weblogic user, Please change user
        echo =============================================
        exit
fi

#-------------------------------------------------------------

#stop server
. ./bin/setDomainEnv.sh
java weblogic.WLST -skipWLSModuleScanning stop.py t3://127.0.0.1:1000