hive常见问题,
在做kettle与hive对接的时候,启动hiveserver报错
hive --service hiveserver
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000.
要确保没有客户端在连接hive,检查方式:
netstat -nl | grep 10000
ps -ef | grep hive
kill 进程号
---------------------------------------------------------------------------------------------------
[b]hive JDBC连接[/b]
在使用 JDBC 开发 Hive 程序时, 必须首先开启 Hive 的远程服务接口。使用下面命令进行开启:
nohup bin/hive --service hiveserver &
hive的jdbc连接需要的jar:
[color=green][b]hadoop-2.2.0/share/hadoop/common/hadoop-common-2.2.0.jar
$HIVE_HOME/lib/hive-exec-0.11.0.jar
$HIVE_HOME/lib/hive-jdbc-0.11.0.jar
$HIVE_HOME/lib/hive-metastore-0.11.0.jar
$HIVE_HOME/lib/hive-service-0.11.0.jar
$HIVE_HOME/lib/libfb303-0.9.0.jar
$HIVE_HOME/lib/commons-logging-1.0.4.jar
$HIVE_HOME/lib/slf4j-api-1.6.1.jar[/b][/color]
****************************************************************************************************
[b]Metastore连接不上[/b]
启动metastore服务 nohup bin/hive --service metastore &
然后直接命令行hive进入hive shell环境,然后执行show databases
---------------------------------------------------------------
[b]hive中DEBUG命令:[/b]hive -hiveconf hive.root.logger=DEBUG,console
---------------------------------------------------------------
[b]使用客户端连接和测试[/b]
参考之前的hive测试步骤一一执行。
[b]如果出现[/b]
FAILED: Error in metadata: javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.
NestedThrowables:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
[b]或者是[/b]
FAILED: Error in metadata: MetaException(message:Got exception: org.apache.thrift.transport.TTransportException null)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
以上错误,主要是在select操作、drop操作时,就会出错。
这样的错误,可以修改hivedb数据库编码:
mysql> alter database hivedb character set latin1;
然后重启hive metastore和hive server就可以了
mysql数据库的编码目前最好设置为latin1,否则使用hive会出现莫名其妙的问题
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。