ava.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: wulei is not allowed to impersonate hadoop), serverProtocolVersion:null) (state=08S01,code=0)
使用HiveServer2 and Beeline模式運行時,啓動好HiveServer後運行
beeline -u jdbc:hive2://localhost:10000 -n root 鏈接server時
出現
java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException):
User root is not allowed to impersonate anonymous 錯誤。
- 修改hadoop 配置文件 etc/hadoop/core-site.xml,加入以下配置項
<property> <name>hadoop.proxyuser.root.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.root.groups</name> <value>*</value> </property>
hadoop.proxyuser.root.hosts配置項名稱中root部分爲報錯User:* 中的用戶名部分,如wulei!!!!!!!html
例如User: zhaoshb is not allowed to impersonate anonymous則須要將xml變動爲以下格式java
<property> <name>hadoop.proxyuser.zhaoshb.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.zhaoshb.groups</name> <value>*</value> </property>
- 重啓hadoop
- 測試:./beeline -u 'jdbc:hive2://localhost:10000/userdb' -n username(替換爲上述的用戶名部分)