hive> select * from dummy;
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:216)
at org.apache.hadoop.hive.ql.Context.getMRTmpFileURI(Context.java:267)
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1063)
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:7275)
at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:243)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:430)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:889)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:255)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:212)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
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://172.16.27.115:9000/opt/hadoop-0.20.2-cdh3u3/hadoop-root/hive_2012-04-25_16-38-44_851_5689096273896907591, expected: hdfs://namenode115: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:164)
at org.apache.hadoop.hive.ql.Context.getMRScratchDir(Context.java:210)
... 17 more
进入 $hadoop_home vi conf/core-site.xml
之前配置是:
<property>
<name>fs.default.name</name>
<value>hdfs://172.16.27.115:9000</value>
</property>
查看vim /etc/hosts
172.16.27.115 namenode115
修改core-site.xml中ip为hostname
<property>
<name>fs.default.name</name>
<value>hdfs:// namenode115 :9000</value>
</property>
重启hadoop,在进入hive查询即可