2023-02-26 418
Logging initialized using configuration in jar:file:/opt/hive/1.2.1/lib/hive-common-1.2.1.jar!/hive-log4j.properties
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
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:212)
Caused by: java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:515)
... 7 more
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1006)
at java.io.File.createTempFile(File.java:1989)
at org.apache.hadoop.hive.ql.session.SessionState.createTempFile(SessionState.java:818)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:513)
... 7 more
myuser@namenode:/opt/hive/current/bin$
myuser@namenode:~$ sudo hive
sudo: hive: command not found
#必须到执行文件路径,sudo之后还必须指定下环境变量
myuser@namenode:/opt/hive/current/bin$ sudo source /etc/profile ; ./hive
参考
跟在crontab中执行代码情况类似hive: command not found错误解决
把hive参数hive.exec.scratchdir 设置的目录,一般为 /tmp/hive权限调整为777即可.即: chmod -R 777 /hive/tmp
<property>
<name>hive.exec.scratchdir</name>
<value>/hivetest/hive</value>
<description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/<username> is created, with ${hive.scratch.dir.pe
rmission}.</description>
</property>
发现已经是了
myuser@namenode:/opt/hive/current/bin$ hdfs dfs -ls /hivetest/
17/04/26 15:17:09 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
drwxrwxrwx - 777 hive 0 2017-01-10 15:44 /hivetest/hive
hive错误:Exception in thread “main” java.lang.RuntimeException: java.io.IOException: Permission denied
修改用户组
usermod -a -G hive myuser
#检查修改
myuser@namenode:/opt/hive/current/bin$ groups
myuser adm cdrom sudo dip plugdev lpadmin sambashare
myuser@namenode:/opt/hive/current/bin$ groups myuser
myuser : myuser adm cdrom sudo dip plugdev lpadmin sambashare hive
还是不行,报原来的错误。
切换用户
myuser@namenode:/opt/hive/current/bin$ su hive
#密码:123456
Password:
hive@namenode:/opt/hive/current/bin$
解决
原文链接:https://www.77isp.com/post/34577.html
=========================================
https://www.77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
小游客游戏攻略网游戏攻略网 2024年07月26日
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
扫码二维码
获取最新动态