java.lang.RuntimeException(Error while making MR scratch directory异常的解决

  • 时间:
  • 浏览:1

        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)

<name>fs.default.name</name>

        at org.apache.hadoop.hive.ql.Context.getMRTmpFileURI(Context.java:267)

        at org.apache.hadoop.hive.ql.Context.getMRScratchDir(Context.java:216)

        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:430)

        at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:255)

        at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)

        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:671)

172.16.27.115 namenode115

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

<value>hdfs://172.16.27.115:9000</value>

hive> select * from dummy;

        at java.lang.reflect.Method.invoke(Method.java:597)

<property>

        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:889)

        at org.apache.hadoop.hive.ql.Context.getMRScratchDir(Context.java:210)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

</property>

</property>

进入 $hadoop_home vi conf/core-site.xml

<property>

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

<value>hdfs:// namenode115 :9000</value>

<name>fs.default.name</name>

        at org.apache.hadoop.hdfs.DistributedFileSystem.checkPath(DistributedFileSystem.java:106)

        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:212)

        at org.apache.hadoop.hive.ql.Context.getScratchDir(Context.java:164)

        at org.apache.hadoop.fs.FileSystem.makeQualified(FileSystem.java:322)

重启hadoop,在进入hive查询即可

        ... 17 more

        at org.apache.hadoop.hdfs.DistributedFileSystem.makeQualified(DistributedFileSystem.java:123)

查看vim /etc/hosts

修改core-site.xml中ip为hostname

        at org.apache.hadoop.util.RunJar.main(RunJar.java:197)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:410)

之前 配置是:

FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory - check filesystem config (null))

        at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:243)

        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1063)

        at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:7275)

java.lang.RuntimeException: Error while making MR scratch directory - check filesystem config (null)

        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)