• 3月30


    #! /bin/sh
    
    base_dir=$(cd "$(dirname $0)"; pwd)
    
    export JAVA_HOME=/usr/java/jdk1.8.0_51
    export PATH=/root/anaconda3/bin:/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    
    
    ##############jar文件名称
    cd  $base_dir
    #version=1.2.0
    version=$(echo $packagename | awk -F[Vv] '{print $2}' | cut -d "." -f 1-3)
    app=$(find -maxdepth 1 -type f -name "SSBK-Streaming-$version*.jar")
    app_name=${app##*/}
    echo  $app_name
    
    
    
    ###########kill进程
    echo "${app_name}准备升级中..."
    
    
    pid_all=$(ps -ef|grep ${app_name}|grep -v "grep"|awk '{print $2}')  
    
    app_id=$(yarn application -list  | grep  "application_" | egrep "DataObject|Intelligent" | awk '{print $1}')
    echo "$app_id" > app_id.txt
    pid_all=$( cat  app_id.txt) 
    
    if [ -n "${pid_all}" ];then
      for pid in ${pid_all[@]}; do
          echo "The pid is running,start kill pid:${pid} for ${app_name}..."
      
          yarn  application -kill  ${pid}
       done
    fi
    
    
    
    echo "${app_name}正在升级中..."
    
    #####启动程序
    
    nohup spark2-submit --master yarn --deploy-mode cluster --class com.chinaoly.ssbkStreaming.runner.OutputResultJobRunner --name OutputResultJobRunner  --driver-memory 1G --executor-memory 2G --num-executors 2 /home/chinaoly/${app_name} > logs/OutputResultJobRunner.log 2>&1 &
    sleep 10
    
    nohup spark2-submit --master yarn --deploy-mode cluster --class com.chinaoly.ssbkStreaming.runner.RyztJobRunner --name RyztJobRunner  --driver-memory 2G --executor-memory 2G --num-executors 2 /home/chinaoly/${app_name} > logs/RyztJobRunner.log 2>&1 &
    sleep 10
    
    nohup spark2-submit --master yarn --deploy-mode cluster --class com.chinaoly.ssbkStreaming.runner.TagJobRunner --name TagJobRunner  --driver-memory 1G --executor-memory 2G --num-executors 2 /home/chinaoly/${app_name} > logs/TagJobRunner.log 2>&1 &
    sleep 10
    
    nohup spark2-submit --master yarn --deploy-mode cluster --class com.chinaoly.ssbkStreaming.runner.TargetJobRunner --name TargetJobRunner  --driver-memory 1G --executor-memory 2G --num-executors 2 /home/chinaoly/${app_name} > logs/TargetJobRunner.log 2>&1 &
    sleep 10
    
    
    pid=$(ps -ef|grep ${app_name}|grep -v "grep"|awk '{print $2}')  
      if [ -n "${pid}"  ]; then  
          echo "==========${app_name}启动成功!进程ID:$pid================="
      else
          echo "==========${app_name}启动出错!================"
          exit 1
      fi
      
    ########## 今天的苦逼是为了不这样一直苦逼下去!##########
  • 相关阅读:
    架设WCF项目出现的问题
    百思不得其解的"Failed to allocate a managed memory buffer of 268435456 bytes."错误解决
    Ajax 分页
    关于Asp.net调用外部程序的拒绝访问错误
    转贴:[翻译]Visual Studio 2008 Code Metrics
    荀子,劝学篇(部分)
    .net设计模式(转载)
    人月神话读书笔记
    Memory food
    2010年4月12日,今天做计划
  • 原文地址:https://www.cnblogs.com/ruii/p/14595883.html
Copyright © 2020-2023  润新知