In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
#! / bin/bashPATH=/application/jdk/bin:/application/jdk/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/binREMOTE=/home/qroot/shangxianLOCAL_HOST=/home/qroot/shangxianLOG_CDATE='date "+% Y-%m-%d" 'LOG_CTIME='date "+% H:%M:%S"' CDATE=$ (date "+% Y-%m-%d") CTIME=$ (date "+% H- % MMI% S ") SHELL_NAME=" deployment_bigdata.sh "SHELL_DIR=" / home/qroot "SHELL_LOG=" ${SHELL_DIR} / ${SHELL_NAME} .log "LOCK_FILE=" / tmp/deploy_bigdata.lock "# mkdir-p / home/qroot/shangxian/bigdata/ {new_word Old_word,tmp,formal,config/ {nginx Replace} usage () {echo "USAGE:$0 AGE {bigdata [bigdata.tar.gz] | 10.28.53. {192223}]} shell_lock () {touch $LOCK_FILE} shell_unlock () {rm-f $LOCK_FILE} writelog () {LOGINFO=$1 echo" $LOG_CDATE} ${LOG_CTIME}: ${SHELL_NAME}: ${LOGINFO} "> ${SHELL_LOG}} tq_tomcat_docker () {sudo sh- X / application/tomcat/bin/shutdown.shPD_1=$ (sudo ps-ef | grep' / application/tomcat/bin' | grep-v 'grep' | wc-l) sleep 30if [${PD_1}-gt 0] thenPID_1=$ (sudo ps-ef | grep' / application/tomcat/bin' | grep-v 'grep' | awk' NR==1 {print $2}') sudo kill-9 ${PID_1} fisleep 5 sudo mkdir-p / application/tomcat/old_logs/logs_$ {CDATE} sudo mv / application/tomcat/logs / * / application/tomcat/old_logs/logs_$ {CDATE} / cd / application/tomcat/work/Catalina/ & & sudo rm-fr * sudo su-tomcat-c "sh / application/tomcat/bin/startup.sh"} docker_bigdata_scp () {writelog "docker_bigdata_scp" [!-d ${LOCAL_HOST} / bigdata/new_word] & & echo "${LOCAL_HOST} / bigdata/new_word-- bucunzai" & & exit 16 if [- f "${LOCAL_HOST} / bigdata/new_word/$ {1}"] then echo "$(ls ${LOCAL_HOST} / bigdata/new_word/$ {1})" mv ${LOCAL_HOST} / bigdata/new_word/$ {1} ${LOCAL_HOST} / bigdata/new_word/bigdata_ "$CDATE"-${CTIME} .war | | exit 16 if [- f "${ LOCAL_HOST} / bigdata/new_word/bigdata_ "$CDATE"-${CTIME} .war "] then echo" $(ls ${LOCAL_HOST} / bigdata/new_word/bigdata_ "$CDATE"-${CTIME} .war) "else echo" bigdata_ "$CDATE"-${CTIME} .war-- File does not exist "& exit 11 fi else echo" ${1 }-- File does not exist "& & exit 10 fi} docker_bigdata_tar () {writelog" docker_bigdata_tar "PD_1=$ (ls ${REMOTE} / bigdata/new_word/bigdata_" $CDATE "- ${CTIME} .war 2 > / dev/null | wc-l) if [${PD_1}-ne 0] then cd / application/tomcat/web_tmp/ & & sudo rm-fr * sudo Unzip ${LOCAL_HOST} / bigdata/new_word/bigdata_ "$CDATE"-${CTIME} .war-d / application/tomcat/web_tmp/bigdata_ "$CDATE"-${CTIME} mv ${REMOTE} / bigdata/new_word/bigdata_ "$CDATE"-${CTIME} .war ${REMOTE} / bigdata/old_word/ cd ${REMOTE} / bigdata/new_word/ & & sudo rm-fr * cd / application/tomcat/ Webapps/ & & sudo rm-fr * sudo ln-s / application/tomcat/web_tmp/bigdata_ "$CDATE"-${CTIME} / application/tomcat/webapps/bigdata_new sudo chmod-R + x / application/tomcat/webapps/bigdata_new/* sudo chown-R tomcat.tomcat / application/tomcat sudo chown-R tomcat.tomcat / application/tomcat/* sudo chmod-R + x / application/tomcat/webapps/bigdata/WEB-INF/classes/com/* else echo ${1}-bigdata_ "$CDATE"-${CTIME} .war-- File does not exist & & exit 12 fi} replace_config () {writelog "config" PD_2=$ (ls ${REMOTE} / bigdata/config/replace/bigdata/* 2 > / dev/null | wc-l) if [${PD_2}-gt 0] then Sudo\ cp ${REMOTE} / bigdata/config/replace/bigdata/* / application/tomcat/webapps/bigdata_new/WEB-INF/classes/config/db/ else echo "replace===$ (ls ${REMOTE} / bigdata/config/replace/* 2 > / dev/null | wc-l)" fi} huizong () {if [- f $LOCK_FILE] Then echo "Deploy is running" & & exit; fiTAR_NAME=$ {2} CASE=$ {1} case "${CASE} in bigdata) shell_lock docker_bigdata_scp ${TAR_NAME} sleep 10 docker_bigdata_tar sleep 10 replace_config sleep 10 tq_tomcat_docker shell_unlock;;*) usage exit 3esac} mian () {CMD_1=$1CMD_2=$2huizong $CMD_1 $CMD_2} mian ${1} ${2}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.