Hive Exception: Too many counters: 2001 max=2000 的解决方法

在 hive 任务的执行过程中,可能出现 Too many counters 的异常。
如果执行引擎时 tez,则说明当前作业的 counters 数量超过 tez 默认的 counters 限制。

Exception: Too many counters: 2001 max=2000
 at org.apache.tez.common.counters.Limits.checkCounters(Limits.java:88)
 at org.apache.tez.common.counters.Limits.incrCounters(Limits.java:95)
at org.apache.tez.common.counters.AbstractCounterGroup.addCounter(AbstractCounterGroup.java:76)

TEZ 默认 counters 设置

<property>
  <name>tez.counters.maxname>
  <defaultValue>1200defaultValue>
  <description>Int value. Configuration to limit the counters per dag (AppMaster and Task). This can be used
to
limit the amount of memory being used in the app master to store the
counters. Expert level setting.description>
  <type>integertype>
  <unstable>trueunstable>
property>

<property>
  <name>tez.counters.max.groupsname>
  <defaultValue>500defaultValue>
  <description>Int value. Configuration to limit the number of counter groups for a DAG. This can be used to
limit the amount of memory being used in the app master to store the
counters. Expert level setting.description>
  <type>integertype>
  <unstable>trueunstable>
property>

解决办法

使用的系统有可能已经调大了 counters 的限制,但是个别作业还是会超过。使用集群管理工具修改 tez-site.xml 中的以下的值都增大 10 倍再试。当使用 hiveserver时,需要修改 hiveserver上的 tez-site.xml,当使用 hive 命令行时,需要修改执行 hive 命令行所在的服务器。

tez.counters.max;
tez.counters.max.groups;

你可能感兴趣的:(hive,hive,hadoop,big,data)