这一个月来,都是做有关关联规则挖掘的项目,前期的预处理和算法算法都已经搞定,为了适应业务需求,需要使用Kettle进行作业的调度,以前没接触过,昨天开始就开始了工作,写了个很简单的shell脚本去启动整个项目的执行,而这个shell单独执行的时候,可以很完美地完成。但是用kettle进行调度的时候,却出现了以下的问题:
- 2012/07/10 08:49:20 - Spoon - 正在开始任务...
- 2012/07/10 08:49:20 - DataProcessing - 开始执行任务
- 2012/07/10 08:49:20 - DataProcessing - 开始项[shell]
- 2012/07/10 08:49:20 - shell - Running on platform : Linux
- 2012/07/10 08:49:20 - shell - Executing command : /home/***/file/script
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : Error running shell [/home/***/file/script] : java.io.IOException: Cannot run program "/home/***/file/script": error=13, 权限不够
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : java.io.IOException: Cannot run program "/home/***/file/script": error=13, 权限不够
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.entries.shell.JobEntryShell.executeShell(JobEntryShell.java:642)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.entries.shell.JobEntryShell.execute(JobEntryShell.java:458)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.Job.execute(Job.java:528)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.Job.execute(Job.java:667)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.Job.execute(Job.java:393)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.job.Job.run(Job.java:313)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : Caused by: java.io.IOException: error=13, 权限不够
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.UNIXProcess.forkAndExec(Native Method)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.UNIXProcess.(UNIXProcess.java:135)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.ProcessImpl.start(ProcessImpl.java:130)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
- 2012/07/10 08:49:20 - shell - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : ... 6 more
从昨天晚上开始一直在找有关这个问题的相关解决方法,而且已经将文件权限开到了最大,但是折腾到凌晨3点都没搞定,自己都纳闷到底问题出在哪?早上过来也一直尝试各种可能的原因,以为是kettle工具用户权限的问题,所以还特意通过资源库添加了root用户,但终究还是无果!
下午自己利用一个很简单的脚本做了个测试,竟然通过了。然后是欣喜不已,然后对比发现,我开始的脚本是这样的:
- #! /bin/sh
- export JAVA_HOME=/usr/local/jdk1.7.0_04
- export JRE_HOME=$JAVA_HOME/jre
- export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
- export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
- PROJECT_HOME=/home/***/jee_workspace/showrule
- MAINCLASS=com.zjhc.main.JobDriver
- PROJECT_PATH=${PROJECT_HOME}/build/classes:$(echo ${PROJECT_HOME}/lib/*.jar|sed 's/ /:/g')
- java -classpath ${PROJECT_PATH} ${MAINCLASS} &
也就是多了最上面一行(申明执行该脚本的程序是sh),然后就把这行删去后,重新执行spoon作业,这次还真的是通过了!结果如下所示:
- 2012/07/10 14:48:10 - startup.sh - Executing command : /home/***/file/script/startup.sh
- 2012/07/10 14:48:10 - DataProcessing - 开始项[Success]
- 2012/07/10 14:48:10 - DataProcessing - 完成作业项[Success] (结果=[true])
- 2012/07/10 14:48:10 - DataProcessing - 完成作业项[startup.sh] (结果=[true])
- 2012/07/10 14:48:10 - DataProcessing - 任务执行完毕
- 2012/07/10 14:48:10 - Spoon - 任务已经结束.
阅读(18363) | 评论(0) | 转发(0) |