➜ /Users/liuzhiwei/app/hive-2.3.6/bin> ./beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/liuzhiwei/app/hive-2.3.6/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/liuzhiwei/app/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 2.3.6 by Apache Hive
beeline> show databases;
No current connection
beeline> !connect jdbc:hive2://localhost:10000/default
Connecting to jdbc:hive2://localhost:10000/default
Enter username for jdbc:hive2://localhost:10000/default: liuzhiwei
Enter password for jdbc:hive2://localhost:10000/default: ****
20/03/17 16:29:48 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/default: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: liuzhiwei is not allowed to impersonate liuzhiwei (state=08S01,code=0)
在hadoop 集群中配置core-site.xml
<property>
<name>hadoop.proxyuser.liuzhiwei.hosts</name>
<value>*</value>
</property>
<property>