azkaban调度任务的时候报错:hive: command not found,具体错误如下:
27-12-2021 15:06:26 CST hdfs_to_ods_log INFO - ================== 日志日期为 2021-12-25 ================== 27-12-2021 15:06:26 CST hdfs_to_ods_log INFO - /home/test/bin/hdfs_to_ods_log.sh: line 18: hive: command not found 27-12-2021 15:06:26 CST hdfs_to_ods_log INFO - Process with id 27540 completed unsuccessfully in 0 seconds. 27-12-2021 15:06:26 CST hdfs_to_ods_log ERROR - Job run failed! java.lang.RuntimeException: azkaban.jobExecutor.utils.process.ProcessFailureException: Process exited with code 127 at azkaban.jobExecutor.ProcessJob.run(ProcessJob.java:312) at azkaban.execapp.JobRunner.runJob(JobRunner.java:823) at azkaban.execapp.JobRunner.doRun(JobRunner.java:602) at azkaban.execapp.JobRunner.run(JobRunner.java:563) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: azkaban.jobExecutor.utils.process.ProcessFailureException: Process exited with code 127 at azkaban.jobExecutor.utils.process.AzkabanProcess.run(AzkabanProcess.java:125) at azkaban.jobExecutor.ProcessJob.run(ProcessJob.java:304) ... 8 more
原因是:
即便hive的环境变量已经设置成功,但是crontab中执行代码时,并不会解析到环境变量,需要在hive的安装目录下执行脚本,或者在shell脚本代码中配置定向到hive的安装路径下执行,在上边代码前面加上“source /etc/profile”和“locate /bin/hive”
修改后如下:
在执行的azkaban的xxx.sh文件前加
source /etc/profile locate /opt/intall/hive
问题解决!!!!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)