【问题标题】:Set Hive priory for individual query/ connection为单个查询/连接设置 Hive 优先级
【发布时间】:2021-06-18 09:21:55
【问题描述】:

我们的团队使用 python 来执行 hive 查询。但是,繁重的查询总是会阻塞其他轻量级的查询,并且必须等待一个多小时。

是否可以为单个连接设置优先级或 vcpu 资源?

在配置中设置“yarn.nodemanager.resource.cpu-vcores”或“mapred.job.priority”是解决方案吗?

configuration = {
    "mapred.job.priority": 'LOW',
    "yarn.nodemanager.resource.cpu-vcores": 2
}
# configuration={}

con = hive.connect(ip, port=10000, auth=auth, kerberos_service_name='hive', database=db_name, configuration=configuration)

如果是,我该如何修复It is not in list of params that are allowed to be modified at runtime 错误?

谢谢

【问题讨论】:

  • 能否请您添加 - mem_limit=300000000 ?这将限制每个连接。
  • @Koushik Roy ,它抛出It is not in list of params that are allowed to be modified at runtime

标签: python hive


【解决方案1】:

由于您直接连接到 Hive,因此您的设置中 hive.security.authorization.sqlstd.confwhitelist.append 的值似乎不正确或严格,并且不允许在运行时设置您的变量。

这里描述了解决方案here。带有正则表达式值的示例 hiveserver2.xml 值:

<property>
    <name>hive.security.authorization.sqlstd.confwhitelist.append</name>
    <value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>
<property>
    <name>hive.security.authorization.sqlstd.confwhitelist</name>
    <value>mapred.*|hive.*|mapreduce.*|spark.*</value>
</property>

【讨论】:

  • 感谢您的回复。对于已发布的标题,您更愿意设置mapred.job.priorityyarn.nodemanager.resource.cpu-vcores 还是mem_limit
  • 我认为作业优先级只对开始前排队的作业有影响。所以我会查看总的 cpu 和内存资源,并将长期运行的作业设置为其中的一部分。例如 50%。所以其他部分资源可以被较小的作业使用。
猜你喜欢
  • 2020-07-24
  • 1970-01-01
  • 1970-01-01
  • 2017-07-10
  • 1970-01-01
  • 2011-04-04
  • 1970-01-01
  • 1970-01-01
  • 2012-01-17
相关资源
最近更新 更多