hive错误:Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Permission denied

用不同用户去登录hive 

可能会报如下错误:

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Permission denied

        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:330)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
        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:212)
Caused by: java.io.IOException: Permission denied
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.checkAndCreate(File.java:1704)
        at java.io.File.createTempFile(File.java:1792)
        at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:432)
        at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:328)

        ... 7 more



解决办法 

把hive参数hive.exec.scratchdir  设置的目录 

一般为 /tmp/hive


权限调整为777即可


即:  chmod -R 777 /hive/tmp

你可能感兴趣的:(hive)