[Linux Jee] Linux部署多个实例的分布式程序时的目录结构

目录结构统一如下:
/lc_iims/tomcat/IIMS/apache-tomcat-6.0.32
/lc_iims/tomcat/CA/apache-tomcat-6.0.32
/lc_iims/tomcat/Crawl端口1/apache-tomcat-6.0.32
/lc_iims/tomcat/Crawl端口n/apache-tomcat-6.0.32
/lc_iims/tomcat/IFA端口1/apache-tomcat-6.0.32
/lc_iims/tomcat/IFA端口n/apache-tomcat-6.0.32

/lc_iims/webApps/IIMS
/lc_iims/webApps/CA
/lc_iims/webApps/Crawl
/lc_iims/webApps/IFA

/lc_iims/properties/Crawl端口1/*.properties、log4j等配置文件
/lc_iims/properties/Crawl端口n/*.properties、log4j等配置文件
/lc_iims/properties/IFA端口1/*.properties、log4j等配置文件
/lc_iims/properties/IFA端口n/*.properties、log4j等配置文件


/lc_iims/logs/IIMS/iims.log
/lc_iims/logs/CA/CA.log
/lc_iims/logs/Crawl端口1/Crawl.log
/lc_iims/logs/Crawl端口n/Crawl.log
/lc_iims/logs/IFA端口1/IFA.log
/lc_iims/logs/IFA端口n/IFA.log

启动和关闭Tomcat 的脚本:  放在/lc_iims 目录下
启动脚本:
#! /bin/sh
appBase=`pwd`
echo ${appBase}


for filename in `ls ${appBase}/tomcat`
        do
                appBinPath="${appBase}/tomcat/${filename}/apache-tomcat-6.0.32/bin/"
                if [ -d ${appBinPath} ]
                then
                        echo "Run ${appBinPath}startup.sh"
                        sh ${appBinPath}startup.sh
                fi
        done


关闭脚本:
#! /bin/sh
appBase=`pwd`
echo "your appBase path is ${appBase}"
if [ -d "${appBase}/tomcat" ]
then
        #Crawl
        if [ `ps -ef | grep "${appBase}/tomcat/" | grep -v "grep" | wc -l` -gt 0 ]
        then
                ps -ef | grep ${appBase}/tomcat/ | grep -v "grep" | awk '{print $2}'| xargs kill -9
        else
                echo "grep ${appBase}/tomcat is null."
                echo "your process no start."
        fi
else
        echo "Sorry, please put this file into right appBase path"
        echo "eg: /lc_iims/"
fi

if [ `ps -ef | grep "${appBase}/tomcat/" | grep -v "grep" | wc -l` -eq 0 ]; then
        echo "Stop Success...!"
else
        echo "Stop Failed!!!"
fi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值