2020-08-21

1. 抛出异常,准确的捕获异常,并输出。运行时间 : 7mins, 47sec,输出数据 64.87M

try{

}catch{

 case remoteException: RemoteException => println("ERROR++++++org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.protocol.RecoveryInProgressException): Failed to APPEND_FILE /tmp/data/cxb/ecar_null_photo_unmatch/ds=2020xxxx/unmatchxx.log for DFSClient_NONMAPREDUCE_385164413_56 on 172.16.1.53 because another recovery is in progress by DFSClient_NONMAPREDUCE_-2142824852_51 on 172.16.1.53")
 case exception: Exception => exception.printStackTrace()

}

2. 抛出异常,没有准确的捕获异常,没有输出。运行时间 : 5mins, 59sec,输出数据:51.75M

try{

}catch{

  case _ => "ERROR++++++org.apache.hadoop.ipc.RemoteException"

}

 

3.抛出异常,准确的捕获异常,没有输出。运行时间 : 5mins, 50sec,输出数据:49.55M

try{
}catch{
   case remoteException: RemoteException => "ERROR++++++org.apache.hadoop.ipc.RemoteException"
          case  exception: Exception => exception.printStackTrace() 
}

以上的资源情况:

--driver-memory 1G --executor-memory 6G --executor-cores 2  --num-executors 10

1.修改资源,用上面的异常3运行, 运行时间 : 6mins, 14sec,输出数据:47M

--driver-memory 1G --executor-memory 6G --executor-cores 2 

2020-08-21_第1张图片

2.再次修改资源  ,只设置了8G内存,其他的都没设置

 --executor-memory 8G  

2020-08-21_第2张图片

发现只有两个executor在运行

2020-08-21_第3张图片

3.再次改资源 ,7mins, 24sec,60.44M

--driver-memory 1G --executor-memory 8G --executor-cores 2 --num-executors 5 

4.再次改资源 ,  6mins, 45sec,57.75M

 


--executor-memory 1G   --num-executors 10 

 

5.再改  5mins, 33sec  输出47M

--executor-memory 4G  --num-executors 10 

2020-08-21_第4张图片

 2020-08-21_第5张图片

6.改  3mins, 29sec ,输出27M (第二次 3mins, 17sec ,25M)


--executor-memory 4G --executor-cores 2  --num-executors 10 

2020-08-21_第6张图片 

2020-08-21_第7张图片 

你可能感兴趣的:(2020-08-21)