Chinaunix首页 | 论坛 | 博客
  • 博客访问: 301774
  • 博文数量: 22
  • 博客积分: 674
  • 博客等级: 上士
  • 技术积分: 792
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-19 00:48
文章存档

2013年(2)

2012年(20)

我的朋友

分类: IT业界

2012-07-10 08:51:45

  这一个月来,都是做有关关联规则挖掘的项目,前期的预处理和算法算法都已经搞定,为了适应业务需求,需要使用Kettle进行作业的调度,以前没接触过,昨天开始就开始了工作,写了个很简单的shell脚本去启动整个项目的执行,而这个shell单独执行的时候,可以很完美地完成。但是用kettle进行调度的时候,却出现了以下的问题:

点击(此处)折叠或打开

  1. 2012/07/10 08:49:20 - Spoon - 正在开始任务...
  2. 2012/07/10 08:49:20 - DataProcessing - 开始执行任务
  3. 2012/07/10 08:49:20 - DataProcessing - 开始项[shell]
  4. 2012/07/10 08:49:20 - shell - Running on platform : Linux
  5. 2012/07/10 08:49:20 - shell - Executing command : /home/***/file/script
  6. 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, 权限不够
  7. 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, 权限不够
  8. 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)
  9. 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)
  10. 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)
  11. 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)
  12. 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)
  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 org.pentaho.di.job.Job.execute(Job.java:393)
  14. 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)
  15. 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, 权限不够
  16. 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)
  17. 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)
  18. 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)
  19. 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)
  20. 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用户,但终究还是无果!
  下午自己利用一个很简单的脚本做了个测试,竟然通过了。然后是欣喜不已,然后对比发现,我开始的脚本是这样的:

点击(此处)折叠或打开

  1. #! /bin/sh
  2. export JAVA_HOME=/usr/local/jdk1.7.0_04
  3. export JRE_HOME=$JAVA_HOME/jre
  4. export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
  5. export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
  6. PROJECT_HOME=/home/***/jee_workspace/showrule
  7. MAINCLASS=com.zjhc.main.JobDriver
  8. PROJECT_PATH=${PROJECT_HOME}/build/classes:$(echo ${PROJECT_HOME}/lib/*.jar|sed 's/ /:/g')
  9. java -classpath ${PROJECT_PATH} ${MAINCLASS} &
  也就是多了最上面一行(申明执行该脚本的程序是sh),然后就把这行删去后,重新执行spoon作业,这次还真的是通过了!结果如下所示:

 点击(此处)折叠或打开

  1. 2012/07/10 14:48:10 - startup.sh - Executing command : /home/***/file/script/startup.sh
  2. 2012/07/10 14:48:10 - DataProcessing - 开始项[Success]
  3. 2012/07/10 14:48:10 - DataProcessing - 完成作业项[Success] (结果=[true])
  4. 2012/07/10 14:48:10 - DataProcessing - 完成作业项[startup.sh] (结果=[true])
  5. 2012/07/10 14:48:10 - DataProcessing - 任务执行完毕
  6. 2012/07/10 14:48:10 - Spoon - 任务已经结束.
阅读(18319) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~