[ 
https://issues.apache.org/jira/browse/OOZIE-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743692#comment-13743692
 ] 

Yu Li commented on OOZIE-23:
----------------------------

Hi All,

I've observed more convincing reason to make the runtime dir configurable while 
resolving customer issue, so I propose a second look at this JIRA:

In the current code base, we can see below code flow to create Oozie runtime 
dir:
{noformat}
org.apache.oozie.service.ActionService#register
-> JavaActionExecutor#initActionType
-> IOUtils.createJar(new File(getOozieRuntimeDir()), getLauncherJarName(), 
launcherClasses);
   -> ActionExecutor#getOozieRuntimeDir
      -> Services#getRuntimeDir
org.apache.oozie.service.Services#constructor
-> createRuntimeDir
   -> File.createTempFile(getSystemId(), ".dir")
{noformat}

Checking java.io.File Java Doc, we could see createTempFile will create an 
empty file in the default temporary-file directory, and the default 
temporary-file directory is specified by the system property java.io.tmpdir. On 
UNIX systems the default value of this property is typically "/tmp" or 
"/var/tmp". So in Linux if the system is up more than the value set in 
/etc/cron.daily/tmpwatch which decides how long system will clear the /tmp dir 
(30 days by default), the jars oozie needed will be wiped-out and cause oozie 
unable to work any more w/o restarting the service. 

Notice that in product env, it's possible that oozie will be up running more 
than 30 days w/o issue, so we need to make it able to set oozie runtime to 
somewhere other than /tmp
                
> Add configuration to set Oozie runtime directory
> ------------------------------------------------
>
>                 Key: OOZIE-23
>                 URL: https://issues.apache.org/jira/browse/OOZIE-23
>             Project: Oozie
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.2.0, 3.3.0, 3.3.2
>            Reporter: Yu Li
>              Labels: configuration,, runtime
>
> I'm trying to make oozie work with NFS rather than HDFS, but find it hard to 
> set the Oozie temporary runtime directory into the NFS mount point. I'm using 
> the java api and lauching a simple oozie job through OozieClient, the code is 
> like below:
> OozieClient wc = new OozieClient("http://dev001:8080/oozie";);
> Properties conf = wc.createConfiguration();
> conf.setProperty(OozieClient.APP_PATH, "/mnt/nfs/my-wf-app");
> conf.setProperty("jobTracker", "dev001:9001");
> conf.setProperty("inputDir", "/mnt/nfs/usr/tester/inputdir");
> conf.setProperty("outputDir", "/mnt/nfs/usr/tester/outputdir");
> String jobId = wc.run(conf);
> System.out.println("Workflow job submitted");
> In my environment the JT is on dev001 and TT is on dev002, and with the above 
> codes, the Oozie temporary runtime directory is generated under 
> "/home/tester/oozie-test" on dev001, so the job failed because there's no 
> such directory on dev002.
> If only I could set the temporary dicectory into some dir under "/mnt/nfs" 
> the problem could be resolved, but I've looked through the OozieClient 
> javadoc, and there seemed to be no property to set the temporary runtime 
> directory. I also looked through the oozie-default.xml, failed to find such 
> setting, either. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to