1、引用同志的链接:http://godlovesdog.iteye.com/blog/1897602
问题1:Specified key was too long; max key length is 767 bytes
在进入Hive后可以show databases; 但create table, show tables;等命令都报错,如下:
[ihadoop@Master ~]$ cd /home/ihadoop/hadoop/hive-0.11.0 [ihadoop@Master hive-0.11.0]$ bin/hive Logging initialized using configuration in file:/home/ihadoop/hadoop/hive-0.11.0/conf/hive-log4j.properties Hive history file=/tmp/ihadoop/hive_job_log_ihadoop_5723@Master.Hadoop_201306251428_1159551556.txt hive> show tables; FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.hive.metastore.api.MetaException javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) :Specified key was too long; max key length is 767 bytes com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386)......................................通过网上查找,发现是数据库字符集问题。只要修改MySQL中Hive元数据库MetaStore的字符集便可。
alter database dbname character set latin1;
问题2:java.io.EOFException: Premature EOF from inputStream
参考此链接地址的文章后发现:
MapReduce使用lzo压缩注意
将
hive>set mapred.output.compression.codec=com.hadoop.compression.lzo.LzopCodec改为:
hive>set mapred.output.compression.codec=com.hadoop.compression.lzo.LzoCodec;虽然只有一个字符之差,但报错却是实实在在的。
问题3:java.lang.NoSuchMethodError: org.apache.thrift.EncodingUtils.setBit(BIZ)B
解决方法:检查所有引用的libthrift-x.x.x.jar,把旧版本的JAR包去掉即解决。