beeline远程模式无法连接到HiveServer2?

执行下面的命令:

beeline> 
beeline> !connect jdbc:hive2://host6:10000
Connecting to jdbc:hive2://host6:10000
Enter username for jdbc:hive2://host6:10000: hive
Enter password for jdbc:hive2://host6:10000: ****
17/06/23 17:28:51 [main]: WARN jdbc.HiveConnection: Failed to connect to host6:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://host6:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: hduser is not allowed to impersonate hive (state=08S01,code=0)
beeline> 

日志开头部分:

2017-06-23T17:26:17,861  INFO [HiveServer2-Handler-Pool: Thread-34] thrift.ThriftCLIService: Client protocol version: HIVE_CLI_SERVICE_PROTOCOL_V9
2017-06-23T17:26:17,891  INFO [HiveServer2-Handler-Pool: Thread-34] hive.metastore: Trying to connect to metastore with URI thrift://host6:9083
2017-06-23T17:26:17,892  INFO [HiveServer2-Handler-Pool: Thread-34] hive.metastore: Opened a connection to metastore, current connections: 2
2017-06-23T17:26:17,900  WARN [HiveServer2-Handler-Pool: Thread-34] security.ShellBasedUnixGroupsMapping: unable to return groups for user hive
PartialGroupNameException The user name 'hive' is not found. id: hive: No such user
id: hive: No such user

但是我的core-site.xml文件也加了下面的配置,并且重启了hadoop

<property>
     <name>hadoop.proxyuser.hduser.hosts</name>
     <value>hduser</value>
</property>
<property>
     <name>hadoop.proxyuser.hduser.groups</name>
     <value>host6</value>
</property>

hive-site.xml的配置:

  <property>
    <name>beeline.hs2.connection.user</name>
    <value>hive</value>
  </property>
  <property>
    <name>beeline.hs2.connection.password</name>
    <value>hive</value>
  </property>
  <property>
    <name>beeline.hs2.connection.hosts</name>
    <value>localhost:10000</value>
  </property>

此外,使用嵌入模式可以连接成功。

阅读 10.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题