• 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
      
    ########## 今天的苦逼是为了不这样一直苦逼下去!##########
  • 相关阅读:
    利用JSGrid创建甘特图
    Using the SharePoint 2010 Client Object Model_part_2
    Using the SharePoint 2010 Client Object Model_part_1
    如何利用Featue对特定的文档库或列表添加listviewtoolbar上的button
    SharePoint 2010 工作流解决方案:创建带有关联窗体和启动窗体的工作流
    Wireshark过滤器
    first blog
    DataAdapter.update如果处理自动增长列的数据
    ms sql 中关于spid=2的问题
    利用ADO.NET RowUpdating更新DataRow信息
  • 原文地址:https://www.cnblogs.com/ruii/p/14595883.html
Copyright © 2020-2023  润新知