ITPub博客

首页 > Linux操作系统 > Linux操作系统 > hive学习中遇到的问题

hive学习中遇到的问题

原创 Linux操作系统 作者:suifeng2316 时间:2012-05-23 15:55:49 0 删除 编辑
在hive中,执行查询时,报错如下
hive> select * from person;
FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory - check filesystem config (null))
java.lang.RuntimeException: Error while making MR scratch directory - check filesystem config (null)
        at org.apache.hadoop.hive.ql.Context.getMRScratchDir(Context.java:196)
        at org.apache.hadoop.hive.ql.Context.getMRTmpFileURI(Context.java:247)
        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:905)
        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:6599)
        at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:238)
        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:340)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:736)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:209)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:516)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:197)
Caused by: java.lang.IllegalArgumentException: Wrong FS: hdfs://219.239.88.86:9000/tmp/hive-hadoop/hive_2012-05-23_15-45-22_363_5400249889198953930, expected: hdfs://counterdb.yesky.com:9000
        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:410)
        at org.apache.hadoop.hdfs.DistributedFileSystem.checkPath(DistributedFileSystem.java:106)
        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:322)
        at org.apache.hadoop.hdfs.DistributedFileSystem.makeQualified(DistributedFileSystem.java:123)
        at org.apache.hadoop.hive.ql.Context.getScratchDir(Context.java:146)
        at org.apache.hadoop.hive.ql.Context.getMRScratchDir(Context.java:190)
        ... 14 more
        
            
[hadoop@Yy86 ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               Yy86 localhost.localdomain localhost
219.239.88.86 hadoop.master
219.239.88.228 hadoop.slave
进入hadoop的安装目录conf下
[hadoop@Yy86 conf]$ vi core-site.xml 
<!-- Put site-specific property overrides in this file. -->
    fs.default.name
    hdfs://219.239.88.86:9000
   hadoop.tmp.dir
   /home/hadoop/tmp1
 hdfs://219.239.88.86:9000==》改成以下内容
[hadoop@Yy86 conf]$ vi core-site.xml 
<!-- Put site-specific property overrides in this file. -->
    fs.default.name
    hdfs://hadoop.master:9000
   hadoop.tmp.dir
   /home/hadoop/tmp1
重启hadoop,一切正常。
2)
NestedThrowablesStackTrace:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
        at sun.reflect.GeneratedConstructorAccessor31.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
        at com.mysql.jdbc.Util.getInstance(Util.java:360)
用mysql做元数据,修改数据字符集
alter database hive character set latin1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23073818/viewspace-730691/,如需转载,请注明出处,否则将追究法律责任。

上一篇: hadoop的安装
请登录后发表评论 登录
全部评论

注册时间:2011-09-14

  • 博文量
    48
  • 访问量
    175604