hive學習中遇到的問題

suifeng2316發表於2012-05-23
在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. --&gt
    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. --&gt
    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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章