weblogic: startKCA.sh

File startKCA.sh, 2.4 KB (added by insomnia, 6 years ago)
Line 
1#!/usr/bin/ksh
2USER_NAME=was
3DOMAIN_NAME=kca
4SERVER_NAME=kcarnd
5ADMIN_URL=t3://192.168.1.43:7001
6DOMAIN_HOME=/sdata/WAS_ROOT/kca
7LOG_DIR=/sdata/WAS_LOG
8LOG_NAME=$SERVER_NAME
9
10
11# Check User Name
12IAM=`id | awk '{print substr($1, 1, index($1,")")-1 )}' | awk '{print substr($1, index($1,"(")+1 )}'`
13
14# Check startup user validation
15if [ $USER_NAME != $IAM ]
16then
17echo "Startup Error :[SALT-WLS001] User validation is failed. This instance has been started as \"$IAM\", actual script owner is
18 \"$USER_NAME\""
19 exit
20 fi
21
22 # Check process status
23 PID=`ps -ef|grep java|grep :${DOMAIN_NAME}_${SERVER_NAME} |awk '{print $2}'`
24 if [ "$PID" != "" ]
25 then
26 echo "Startup Error :[SALT-WLS002] \"${DOMAIN_NAME}_${SERVER_NAME}\" server is already running !!!"
27
28 exit
29 fi
30
31mkdir -p $LOG_DIR
32mkdir -p $LOG_DIR/backup
33mv $LOG_DIR/stdout/$LOG_NAME.log $LOG_DIR/backup/$LOG_NAME.log.`date '+20%y%m%d_%H%M%S'`
34
35########## Custom Args ##########
36#Common start Args
37        USER_MEM_ARGS="-D:${DOMAIN_NAME}_${SERVER_NAME}  -Xms1024m -Xmx1024m -XX:MaxPermSize=512m"
38        #export JAVA_OPTIONS=  -Dfile.encoding=UTF8 -Dfile.client.encoding=UTF8
39#64bit JDK
40        ## only HP
41        #USER_MEM_ARGS="${USER_MEM_ARGS} -d64"
42
43#GC (not setted)
44
45#GC Log
46        ## General
47        #USER_MEM_ARGS="${USER_MEM_ARGS} -verbose:gc -Xloggc:=${LOG_DIR}/gc/${SERVER_NAME}_GC_`date '+%y%m%d_%H%M%S'`.gc"
48
49        ##HP only
50        #USER_MEM_ARGS="${USER_MEM_ARGS} -Xverbosegc:file=${LOG_DIR}/gc/${SERVER_NAME}_GC_`date '+%y%m%d_%H%M%S'`.gc"
51
52        ##only IBM
53        USER_MEM_ARGS="${USER_MEM_ARGS} -Xverbosegclog:${LOG_DIR}/gc/${SERVER_NAME}_GC_`date '+%y%m%d_%H%M%S'`.gc" 
54 
55#HeapDump
56        ## hp : over 1.4.2.10 or over 1.5.0.03
57        ## sun :  over 1.4.2_12 or over 1.5.0_07
58        #USER_MEM_ARGS="${USER_MEM_ARGS} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${LOG_DIR}/heapdump"
59
60        ##IBM only ( kill -3 <pid> makes heap dump setting)
61        export IBM_HEAPDUMP=true
62        export IBM_HEAP_DUMP=true
63        export IBM_HEAPDUMP_OUTOFMEMORY=true
64        export IBM_JAVADUMP_OUTOFMEMORY=true
65        export IBM_HEAPDUMPDIR=${LOG_DIR}/heapdump
66        export IBM_JAVACOREDIR=${LOG_DIR}/heapdump
67
68
69#Jconsole using
70        #USER_MEM_ARGS="${USER_MEM_ARGS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
71
72#Common end Args
73        export USER_MEM_ARGS
74########## Custom Args ##########
75
76nohup ${DOMAIN_HOME}/bin/startManagedWebLogic.sh kcarnd t3://localhost:7001 >> ${LOG_DIR}/stdout/${LOG_NAME}.log &
77
78sleep 2
79tail -f $LOG_DIR/stdout/$LOG_NAME.log
80