使用apache hadoop1.2.1配置Apache Hive1.0时遇到问题

时间:2015-02-23 15:28:25

标签: hadoop hive

在.bashrc文件中配置后,在终端中运行配置单元时遇到下面提到的权限问题。

hadoop@hadoop:~$ hive

Logging initialized using configuration in jar:file:/home/hadoop/Downloads/apache-hive-1.0.0/lib/hive-common-1.0.0.jar!/hive-log4j.properties
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:626)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

Caused by: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx--x--x
at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:529)
at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:478)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:430)
... 7 more

1 个答案:

答案 0 :(得分:0)

这是一个权限问题,与bashrc文件无关。给HDFS中的/ tmp目录赋予适当的权限,你应该没问题。

您可以使用

hadoop fs -chmod [-R] <permissions> <directory>