hive的问题

来源:互联网 发布:淘宝店铺联盟开通条件 编辑:程序博客网 时间:2024/06/14 07:07


1.hive> create table t_sz01(id int,name string);
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:For direct MetaStore DB connections, we don't support retries at the client level.)

解决方法:mysql> alter database hive character set latin1;
Query OK, 1 row affected (0.01 sec)



2.

[hadoop@itcast hive]$ bin/hive


Logging initialized using configuration in jar:file:/home/hadoop/app/hive/lib/hive-common-1.2.1.jar!/hive-log4j.properties
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient


Caused by: java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://localhost:3307/hive?createDatabaseIfNotExist=true, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------

NestedThrowables:
java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://localhost:3307/hive?createDatabaseIfNotExist=true, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------


描述:这个错误是我在登录hive的时候报的错,弄了好久,是配置文件的问题,是hive-site.xml

解决方案:

[hadoop@itcast conf]$ vi hive-site.xml


<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://itcast:3307/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>



原创粉丝点击