启动hive报错异常:
Relative path in absolute URI: ${system:java.io.tmpdir}/${hive.session.id}_resources
原因:环境变量设置问题
默认的hive-site.xml有很多变量作为路径,而读取不到这些变量
<property> <name>Hive.exec.local.scratchdir</name> <value>${system:Java.io.tmpdir}/${system:user.name}</value> <description>Local scratch space for hive jobs</description> </property> <property> <name>hive.downloaded.resources.dir</name> <value>${system:java.io.tmpdir}/${hive.session.id}_resources</value> <description>Temporary local directory for added resources in the remote file system.</description> </property> <property>
解决方案如下:
1.查看hive-site.xml配置,会看到配置值含有"${system:java.io.tmpdir}"的配置项
2.将含有"${system:java.io.tmpdir}"的配置项的值修改为绝对路径/tmp/iotmp,类似这种变量引用的路径全部都改掉
3.重新启动hive,成功!