weblogic開機啟動指令碼

來源:互聯網
上載者:User

標籤:style   blog   http   tar   color   檔案   

1、在/home/bea/startBeaAll目錄內建立一個startBeaAll.sh檔案,加入如下內容(把相應目錄與命令修改即可,紅字部分為修改地方):

#!/bin/sh

echo "======weblogic start begin========"

echo "======managerServer start begin========"

managerid=`ps auxww|grep managerServer|grep -v grep|awk ‘{print $2}‘`

if [ -n "$managerid" ];

then 

       echo "======managerServer is start ,to kill the managerServer managerid $managerid========"

       kill -9 $managerid

       sleep 10

       echo "====== the weblogic managerServer start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startWebLogic.sh > /home/bea/logs/manager.log &

       #/home/bea/logs/manager.log &為日誌存放位置,下同

else

       echo "======managerServer is not start, the weblogic managerServer start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startWebLogic.sh > /home/bea/logs/manager.log &  

fi  

sleep 30

echo "======managerServer start end========"

 

echo "======appServer1 start begin========"

apponeid=`ps auxww|grep appServer1|grep -v grep|awk ‘{print $2}‘`

if [ -n "$apponeid" ]; then 

       echo "======appServer1 is start ,to kill the appServer1 apponeid $apponeid========"

       kill -9 $apponeid

       sleep 5

       echo "====== the weblogic appServer1 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer1 http://192.168.100.102:7001 > /home/bea/logs/app1.log &

else

       echo "======appServer1 is not start, the weblogic appServer1 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer1 http://192.168.100.102:7001 > /home/bea/logs/app1.log &  

fi  

 

sleep 120

echo "======appServer1 start end========"

 

echo "======appServer2 start begin========"

apptwoid=`ps auxww|grep appServer2|grep -v grep|awk ‘{print $2}‘`

if [ -n "$apptwoid" ]; then 

       echo "======appServer2 is start ,to kill the appServer2 apptwoid $apptwoid========"

       kill -9 $apptwoid

       sleep 5

       echo "====== the weblogic appServer2 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer2 http://192.168.100.102:7001 > /home/bea/logs/app2.log &

else

       echo "======appServer2 is not start, the weblogic appServer2 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer2 http://192.168.100.102:7001 > /home/bea/logs/app2.log &  

fi  

sleep 120

echo "======appServer2 start end========"

 

echo "======appServer3 start begin========"

appthrd=`ps auxww|grep appServer3|grep -v grep|awk ‘{print $2}‘`

if [ -n "$appthrid" ]; then 

       echo "======appServer3 is start ,to kill the appServer3 appthrid $appthrid========"

       kill -9 $appthrid

       sleep 5

       echo "====== the weblogic appServer3 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer3 http://192.168.100.102:7001 > /home/bea/logs/app3.log &

else

       echo "======appServer3 is not start, the weblogic appServer3 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer3 http://192.168.100.102:7001 > /home/bea/logs/app3.log &  

fi  

sleep 120

echo "======appServer3 start end========"

 

echo "======appServer4 start begin========"

appforid=`ps auxww|grep appServer4|grep -v grep|awk ‘{print $2}‘`

if [ -n "$appforid" ]; then 

       echo "======appServer4 is start ,to kill the appServer4 appforid $appforid========"

       kill -9 $appforid

       sleep 5

       echo "====== the weblogic appServer4 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer4 http://192.168.100.102:7001 > /home/bea/logs/app4.log &

else

       echo "======appServer4 is not start, the weblogic appServer4 start========"

       cd /home/bea/user_projects/domains/managerdomain/bin

       nohup ./startManagedWebLogic.sh appServer4 http://192.168.100.102:7001 > /home/bea/logs/app4.log &  

fi  

sleep 120

echo "======appServer4 start end========"

sleep 5

echo "======weblogic start end========"

2、修改/etc/rc.local設定檔
  在/etc/rc.local中加入如下內容: #vi /etc/rc.local

  su - root -c "/home/bea/startBeaAll/startBeaAll.sh start "

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.