HIVE2 :beeline连接设置用户名和密码注意问题
2016-12-19 17:26
357 查看
beeline connect有几种方式,见hive-site.xml,缺省为NONE。
<property>
<name>hive.server2.authentication</name>
<value>NONE</value>
<description>
Expects one of [nosasl, none, ldap, kerberos, pam, custom].
Client authentication types.
NONE: no authentication check
LDAP: LDAP/AD based authentication
KERBEROS: Kerberos/GSSAPI authentication
CUSTOM: Custom authentication provider
(Use with property hive.server2.custom.authentication.class)
PAM: Pluggable authentication module
NOSASL: Raw transport
</description>
</property>
设置相应用户名和密码
<property>
<name>hive.server2.thrift.client.user</name>
<value>root</value>
<description>Username to use against thrift client</description>
</property>
<property>
<name>hive.server2.thrift.client.password</name>
<value>123456</value>
<description>Password to use against thrift client</description>
</property>
注意这里设置的用户要求对inode="/tmp/hive" 有执行权限,否则会出现下列问题:
Connecting to jdbc:hive2://localhost:10000/default
Enter username for jdbc:hive2://localhost:10000/default: hive
Enter password for jdbc:hive2://localhost:10000/default: **
Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.security.AccessControlException: Permission denied: user=hive, access=EXECUTE, inode="/tmp/hive":root:supergroup:drwxrwx---
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:319)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkTraverse(FSPermissionChecker.java:259)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:205)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:190)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1698)
at org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.getFileInfo(FSDirStatAndListingOp.java:108)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getFileInfo(FSNamesystem.java:3817)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getFileInfo(NameNodeRpcServer.java:1005)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getFileInfo(ClientNamenodeProtocolServerSideTranslatorPB.java:843)
<property>
<name>hive.server2.authentication</name>
<value>NONE</value>
<description>
Expects one of [nosasl, none, ldap, kerberos, pam, custom].
Client authentication types.
NONE: no authentication check
LDAP: LDAP/AD based authentication
KERBEROS: Kerberos/GSSAPI authentication
CUSTOM: Custom authentication provider
(Use with property hive.server2.custom.authentication.class)
PAM: Pluggable authentication module
NOSASL: Raw transport
</description>
</property>
设置相应用户名和密码
<property>
<name>hive.server2.thrift.client.user</name>
<value>root</value>
<description>Username to use against thrift client</description>
</property>
<property>
<name>hive.server2.thrift.client.password</name>
<value>123456</value>
<description>Password to use against thrift client</description>
</property>
注意这里设置的用户要求对inode="/tmp/hive" 有执行权限,否则会出现下列问题:
Connecting to jdbc:hive2://localhost:10000/default
Enter username for jdbc:hive2://localhost:10000/default: hive
Enter password for jdbc:hive2://localhost:10000/default: **
Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.security.AccessControlException: Permission denied: user=hive, access=EXECUTE, inode="/tmp/hive":root:supergroup:drwxrwx---
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:319)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkTraverse(FSPermissionChecker.java:259)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:205)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:190)
at org.apache.hadoop.hdfs.server.namenode.FSDirectory.checkPermission(FSDirectory.java:1698)
at org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.getFileInfo(FSDirStatAndListingOp.java:108)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getFileInfo(FSNamesystem.java:3817)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getFileInfo(NameNodeRpcServer.java:1005)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getFileInfo(ClientNamenodeProtocolServerSideTranslatorPB.java:843)
相关文章推荐
- Hive设置连接用户名和密码
- NO.19 HttpConnection、HttpClient使用注意点(附http连接工具:采用HttpClient支持代理Proxy、支持用户名密码、支持域Domain模式)
- QC安装过程中数据库连接问题与用系统用户时总是提示用户名密码不正确
- windows连接代理服务器,总是弹出输入用户名和密码的框的问题
- PPPoE-在配置PPPoE的用户名和密码的时候一定要准确严格,不要在后面加空格,千万记住,特别是复制张贴的时候,同时还有注意大小写的问题!!!
- Tomcat 7.0用户名与密码的设置问题
- Tomcat 7.0用户名与密码的设置问题
- 首次连接oracle数据库的用户名和密码问题
- svn checkout时连接不到服务器,重装也没有弹出用户名和密码输入框的问题
- window设置TortoiseGit连接git不用每次输入用户名和密码
- 在实现一个WIFI无线连接设置中需要注意的问题
- win8怎么设置宽带连接及自动连接(无法记住用户名和密码)
- SVN无法连接到服务器不仅仅是保存了以前的用户名和密码还可能是电脑问题
- IIS哪里设置,访问站点不需要输入用户名和密码? 的问题的解决办法
- 解决TortoiseGit连接Bonobo Git Server时老是需要“输入用户名与密码”的问题
- tomcat中用户名及密码设置的一些问题详解
- mysql-密码丢失和设置远程连接问题
- python-Django中连接MySQL数据库及设置用户名密码
- python3 连接SQLserver2014(包括用户名和密码设置)
- 免安装版Tomcat 6.0.35碰到的问题 :打开tomcat管理界面时,用户名和密码错误的设置方法