我已经在Windows中安装了hadoop和hive,并将derby用作metastore数据库。我正在尝试使用beeline连接到蜂巢。我将此配置放在core-site.xml文件中:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.proxyuser.my_username.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.my_username.hosts</name>
<value>*</value>
</property>
</configuration>
我像这样配置hive-site.xml:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby://localhost:1527/metastore_db;create=true</value>
<description>
JDBC connect string for a JDBC metastore.
</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.apache.derby.jdbc.ClientDriver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>hive.server2.enable.impersonation</name>
<value>true</value>
<description></description>
</property>
<property>
<name>hive.server2.authentification</name>
<value>NONE</value>
<description></description>
</property>
<property>
<name> hive.metastore.schema.verification</name>
<value>false</value>
<description></description>
</property>
<property>
<name>datanucleus.autoCreateTables</name>
<value>True</value>
<description></description>
</property>
</configuration>
我启动了hiveserver2:
hive --service hiveserver2 --hiveconf hive.server2.thrift.port=10000
当我尝试使用beeline连接到蜂巢时,出现此错误:
Error: Could not establish connection to
jdbc:hive2://localhost:10000/default: Required field
'serverProtocolVersion' is unset! Struct:TOpenSessionResp(status:T
Status(statusCode:ERROR_STATUS, infoMessages:
[*org.apache.hive.service.cli.HiveSQLException:Failed to open new
session: java.lang.RuntimeException:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.
authorize.AuthorizationException): User: my_username is not allowed to
impersonate anonymous:14:13
任何帮助!谢谢。