Fork me on GitHub

pyhive 连接 Hive 时错误

一、User: xx is not allowed to impersonate xxx'

解决办法:修改 core-site.xml 文件,加入下面的内容后重启 hadoop

<property>
    <name>hadoop.proxyuser.xx.hosts</name>
    <value>*</value>
</property>

<property>
    <name>hadoop.proxyuser.xx.groups</name>
    <value>*</value>
</property>

Tips:注意是 xx 不是 xxx

二、ACCEPTED: waiting for AM container to be allocated, launched and register with RM.

现象为:

  1. 查看 node 的健康状态:http://master:8088/cluster/cluster ,无活跃 node
  2. pyhive 执行 insert 命令卡住,一直处于 accept 状态。
  3. YarnApplicationState 为:ACCEPTED: waiting for AM container to be allocated, launched and register with RM.
  4. slave yarn 日志为:Retrying connect to server: 0.0.0.0/0.0.0.0:8031. Already tried 0 time(s); retry policy is...

解决办法:

切记启动 hdfs 后,要配置启动 yarn。配置如下:

 <configuration>
    <property>  
        <name>yarn.resourcemanager.address</name>  
        <value>master:8032</value>  
    </property>  
    <property>  
        <name>yarn.resourcemanager.scheduler.address</name>  
        <value>master:8030</value>  
    </property>  
    <property>  
        <name>yarn.resourcemanager.resource-tracker.address</name>  
        <value>master:8031</value>  
    </property>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>
posted @ 2018-06-23 10:05  削微寒  阅读(2041)  评论(0编辑  收藏  举报