配置hive server2鑑權和beeline無密碼鏈接hive數據倉庫

啓動hive server2服務之後使用beeline鏈接報一下錯誤
beeline> !connect jdbc:hive2://localhost:10000
Connecting to jdbc:hive2://localhost:10000
Enter username for jdbc:hive2://localhost:10000: hadoop
Enter password for jdbc:hive2://localhost:10000: **
19/03/01 22:01:59 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: hadoop is not allowed to impersonate hadoop (state=08S01,code=0)

問題定位:
原因:hiveserver2增加了權限控制,需要在hadoop的配置文件中配置
解決方法:
在hadoop的core-site.xml配置文件中添加一下配置內容
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value></value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>
</value>
</property>
配置hive server2鑑權和beeline無密碼鏈接hive數據倉庫

之後重啓hadoop即可
官網說明鏈接:
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Superusers.html
來自官方的截圖
配置hive server2鑑權和beeline無密碼鏈接hive數據倉庫

登錄測試:
配置hive server2鑑權和beeline無密碼鏈接hive數據倉庫
可見登錄成功
測試已存在的庫
配置hive server2鑑權和beeline無密碼鏈接hive數據倉庫

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章