当前位置 : 主页 > 网页制作 > html >

weblogic启动脚本

来源:互联网 收集:自由互联 发布时间:2021-06-12
DATE=` date +%Y%m%d%H%M% S` user =` whoami `logDir =/app/logs/ sguap_admin #启动日志存放路径sguap是例子系统简称#logDestdir =/app/logs/archivelog/ sguap_admin #启动日志归档路径# domainBase =/app/weblogic/Oracle/Middlew
DATE=`date +%Y%m%d%H%M%S`      
user=`whoami`
logDir=/app/logs/sguap_admin                         #启动日志存放路径sguap是例子系统简称#
logDestdir=/app/logs/archivelog/sguap_admin             #启动日志归档路径# 
domainBase=/app/weblogic/Oracle/Middleware/user_projects/domains  #domian所在路径#
domainName=sguap_domain                   #domain名称#
adminUrl=10.4.81.187                          #控制台IP地址#
adminPort=17001                             #控制台端口#
serverName=sguap_AdminServer                         #节点名称#

if [ "$user" = "root" ]; then
    echo "root 不能执行此操作"
else
        pid=`ps -ef|grep "Name=$serverName"|grep -v grep|awk {print $2}`
        if [ $pid ] ; then
                echo "service still active, killing..."
                kill -9 $pid    
        else            
                echo "sevice stopped."
        fi
cd $logDir
gzip -c $serverName.log > $logDestdir/${DATE}_$serverName.gz

cat /dev/null > $serverName.log
sleep 3

cd $domainBase/$domainName/bin
export USER_MEM_ARGS="-Xms2048m -Xmx2048m -XX:MaxPermSize=512m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./heapdump_${serverName}_`date +%Y%m%d%H%M%S`.hprof  -Xloggc:gc_${serverName}_`date +%Y%m%d%H%M%S`.log"

nohup ./startWebLogic.sh > $logDir/$serverName.log &
tail -f $logDir/$serverName.log
fi
网友评论