java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable.

Exception in thread “main” java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx------

启动 Hive 时报错

[root@node01 hive-1.1.0-cdh5.14.0]# bin/hive
which: no hbase in (/usr/lib64/qt-3.3/bin::/export/servers/hadoop-2.6.0-cdh5.14.0/bin:/export/servers/hadoop-2.6.0-cdh5.14.0/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/export/servers/hive-1.1.0-cdh5.14.0/bin:/export/servers/jdk1.8.0_65/bin:/export/servers/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/bin:/export/servers/zookeeper-3.4.5-cdh5.14.0/bin:/root/bin)

Logging initialized using configuration in file:/export/servers/hive-1.1.0-cdh5.14.0/conf/hive-log4j.properties
Exception in thread "main" java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx------
        at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:674)
        at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:606)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:547)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:695)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:634)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

错误原因

The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rwx------可以看出。系统要求在 hdfs 上用户应该具备写权限,而从报错可以看出只有所有者具有写权限,所有组和其他用户不具备。

解决方法

使用 hdfs dfs -chmod -R 777 /tmp/hive修改目录权限,如下:

[root@node01 hive-1.1.0-cdh5.14.0]# hdfs dfs -chmod -R 777 /tmp/hive
[root@node01 hive-1.1.0-cdh5.14.0]# hive
which: no hbase in (/usr/lib64/qt-3.3/bin::/export/servers/hadoop-2.6.0-cdh5.14.0/bin:/export/servers/hadoop-2.6.0-cdh5.14.0/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/export/servers/hive-1.1.0-cdh5.14.0/bin:/export/servers/jdk1.8.0_65/bin:/export/servers/sqoop-1.4.6.bin__hadoop-2.0.4-alpha/bin:/export/servers/zookeeper-3.4.5-cdh5.14.0/bin:/root/bin)

Logging initialized using configuration in file:/export/servers/hive-1.1.0-cdh5.14.0/conf/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive (default)>

使其他用户也具备本目录的写权限

你可能感兴趣的:(报错,hadoop,linux,大数据,hive)