我刚刚安装了Hive和MySQL,并将mysqlconnector拷贝到hive_home/lib文件夹中。但是当我尝试在hive>提示符下运行show databases和create table命令时,出现以下错误:
create database saty;
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
我的hive_site.xml文件如下:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hadoop?CreateDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
我在文件系统中没有名为/user/hive/warehouse的目录。
我使用mkdir命令创建了这些路径,重启后尝试仍然出现错误。
祝好, Satya