I am writing a java client program which can interact with remote hadoop cluster and prints all the jobs which are running.
my local machine is able to ping the remote machine where hadoop is running. i tried below code, and stuck up with parameters. where can i get these configuration parameter values
Configuration conf = new Configuration();
// this should be like defined in your mapred-site.xml
conf.set("mapred.job.tracker", "Hadoopmaster:54311");
// like defined in hdfs-site.xml
conf.set("fs.default.name", "hdfs://namenode.com:9000");
System.out.println("got configuration : "+conf);
InetSocketAddress jobtracker = new InetSocketAddress("jobtracker.mapredhost.myhost", 8021);
JobClient jobClient = new JobClient(jobtracker, conf);
JobStatus[] jobs = jobClient.jobsToComplete();
for (int i = 0; i < jobs.length; i++) {
JobStatus js = jobs[i];
if (js.getRunState() == JobStatus.RUNNING) {
JobID jobId = js.getJobID();
System.out.println(jobId);
}
}
}
map-red.xml
<property>
<name>mapred.job.tracker</name>
<value>Hadoopmaster:54311</value>
<description>test </description>
</property>
core-site.xml
<property>
<name>fs.default.name</name>
<value>hdfs://Hadoopmaster:54310</value>
<description>test.</description>
</property>