Hello,

I have created a simple java app that writes data to hdfs. When I run my
jar file from the command line on an access node (yarn jar HdsfWriter.jar)
the program runs as expected.

However when I attempt to run my jar file via the Oozie java action it
fails with the following error:

Mkdirs failed to create /user/xxx/scratch (exists=false,
cwd=file:/data/7/hadoop/yarn/local/usercache/xxx/appcache/
application_1483543169522_0056/container_e10_1483543169522_0056_01_000002)



Thank you,
V.


------------------------------------------------------------
---------------------------------------------------------------------
Details

HDP: 2.4
HDFS: 2.7.1
OOZIE: 4.2.0


Java Code Snip:

public class HdfsWrite {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {


        try{

            String line = "This is a test!";

            Path pt = new Path("/user/xxx/scratch/hdfs-test");
            FileSystem fs = FileSystem.get(new Configuration());

            BufferedWriter br = new BufferedWriter(new
OutputStreamWriter(fs.create(pt,true)));

            br.write(line);

            br.close();

        } catch (Exception e) {
            System.err.println( e.getMessage());
        }
    }

Java Action:

<action name="HDFS_Write">
<java>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/${target}"/>
</prepare>
<configuration>
<property>
<name>mapred.job.queuename</name>
<value>${queueName}</value>
                </property>
           </configuration>
            <main-class>com.nowhere.vp.hdfswrite.HdfsWrite</main-class>
</java>
       <ok to="End" />
<error to="Report" />
</action>

Reply via email to