配置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配置文件中添加一下配置内容
之后重启hadoop即可
官网说明链接:
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Superusers.html
来自官方的截图
登录测试:
可见登录成功
测试已存在的库