type
status
date
summary
slug
tags
category
password
icon

报错详情

CDH集群上将Hive的默认引擎为由Mapreduce改为SparkCDH刚搭好的时候,未优化,以MR作为引擎)进行测试
notion image
beeline启动Hive,发现Hql都 跑不了,抛错:
Hive引擎改回Mapreduce,不报错。

查看日志

/tmp/username目录下的hive.log日志中排错,才发现(图片为网图)
notion image

原因

这个隐藏在Info日志中的exception才是真正报错的原因, 这就是前文提到的Yarn container的参数决定了Spark Execuotor的上下限,这里的问题是yarn.scheduler.maximum-allocation-mb使用的默认值8 GB, 小于spark.executor.memory的 10 GB,导致了Spark无法运行。
notion image

检查以下参数

yarn.app.mapreduce.am.resource.mb

ApplicationMaster 的物理内存要求 (MiB)。
notion image

yarn.nodemanager.resource.cpu-vcores / memory-mb

单个节点上可分配的物理核数/内存总量
定义了每台NodeManager可用的CPU
定义了每台NodeManager可用Memory
  • 大致的算法是保留15%-20%给系统和其他服务,保留>= 4CORE+12GRAM 左右的资源留给系统和其他服务,剩余给YARN
notion image
notion image
目前集群的2台NodeManager配置为 4 Core / 14 GB:

yarn.scheduler.minimum-allocation-mb

这块稍微麻烦一点,CDH的文档没有专门的建议值,网上流行的是HDP的一个关于yarn.scheduler.minimum-allocation-mb的配置,我觉得挺有道理的
Total RAM per Node
Recommended Minimum Container Size
Less than 4 GB
256 MB
Between 4 GB and 8 GB
512 MB
Between 8 GB and 24 GB
1024 MB
Above 24 GB
2048 MB
notion image

yarn.scheduler.maximum-allocation-vcores

yarn node可使用cpu最大值
notion image

yarn.scheduler.maximum-allocation-mb

单个任务可申请的最多物理内存量
DataX报错解决办法 - 单个channel的bps值报错Hadoop Yarn - 高可用服务主备状态查询
Loading...