在一台应用服务器上有多个weblogic版本,多个domain的情况下,启动关闭是一个很繁琐的 过程, 首先要进目录,之后要启用合适的命令,一旦出现错误,排查过程是很考验耐心的, 为了简化流程, 先将weblogic启动、关闭、监控的方式写下来,以便未来查漏补缺:
分为3个文件:
profile.txt ----weblogic的环境变量文件。
move_env.sh -----move.sh的环境变量
move.sh -----调取脚本
profile.txt
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs JAVA_HOME=/data/data1/Middle/jdk1.5.0_04 PATH=$PATH:$HOME/bin: export PATH export WL1=/data/data1/Middle/weblogic/bea/user_projects/domains alias startgx='cd $WL1/trainCompetition && nohup ./startWebLogic.sh >>trainCompetition_181019.log &' alias stopgx='cd $WL1/trainCompetition && sh ./bin/stopWebLogic.sh' alias stoptx='cd $WL1/train_tx && sh ./bin/stopWebLogic.sh' alias starttx='cd $WL1/train_tx && nohup ./startWebLogic.sh >>train_tx_181023.log &' export WL2='/data/data1/Middle1036/user_projects/domains/danzheng_train' alias startdz='cd $WL2 && nohup ./startWebLogic.sh >>danzheng_train_181023.log &' alias stopdz='cd $WL2 && ./bin/stopWebLogic.sh' alias tailgx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/trainCompetition/trainCompetition_181019.log' alias tailtx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/train_tx/train_tx_181023.log' alias taildz='tail -f $WL2/danzheng_train_181023.log' #alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" sh ~/move.sh
move_env.sh
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs JAVA_HOME=/data/data1/Middle/jdk1.5.0_04 PATH=$PATH:$HOME/bin: export PATH export WL1=/data/data1/Middle/weblogic/bea/user_projects/domains alias startgx='cd $WL1/trainCompetition && nohup ./startWebLogic.sh >>trainCompetition_181019.log &' alias stopgx='cd $WL1/trainCompetition && sh ./bin/stopWebLogic.sh' alias stoptx='cd $WL1/train_tx && sh ./bin/stopWebLogic.sh' alias starttx='cd $WL1/train_tx && nohup ./startWebLogic.sh >>train_tx_181023.log &' export WL2='/data/data1/Middle1036/user_projects/domains/danzheng_train' alias startdz='cd $WL2 && nohup ./startWebLogic.sh >>danzheng_train_181023.log &' alias stopdz='cd $WL2 && ./bin/stopWebLogic.sh' alias tailgx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/trainCompetition/trainCompetition_181019.log' alias tailtx='tail -f /data/data1/Middle/weblogic/bea/user_projects/domains/train_tx/train_tx_181023.log' alias taildz='tail -f $WL2/danzheng_train_181023.log' #alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" #alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec rm -rf {} \;" alias cleangx="find $WL1/trainCompetition -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleantx="find $WL1/train_tx -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;" alias cleandz="find $WL2 -name '*.DAT' -o -name '*.lok' -exec ls -ll {} \;"
move.sh
source ~/move_env.sh echo '############################################################################' echo 'You are loging in contorl platform for weblogic domains , Now make you move:' echo '############################################################################' echo ' 1: start' echo ' 2: stop' echo ' 3: check log ' read -p "Make you move[1/2/3/enter]:" op1 if [ "$op1" == "1" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op2 if [ "$op2" == "1" ]; then startgx elif [ "$op2" == "2" ]; then starttx elif [ "$op2" == "3" ]; then startdz else echo 'Error , wrong choice' fi elif [ "$op1" == "2" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op2 if [ "$op2" == "1" ]; then stopgx elif [ "$op2" == "2" ]; then stoptx elif [ "$op2" == "3" ]; then stopdz else echo 'Error , wrong choice' fi elif [ "$op1" == "3" ]; then echo ' 1: gx ' echo ' 2: tx ' echo ' 3: dz ' read -p "Make you second move[1/2/3]:" op3 if [ "$op3" == "1" ]; then tailgx elif [ "$op3" == "2" ]; then tailtx elif [ "$op3" == "3" ]; then taildz else echo 'Error , wrong choice' fi else echo 'no choice ,just login !' fi