我是hadoop的新手,我试图了解是否有可能连接到远程或本地jobtracker,我需要这个,因为我想确定Hadoop当前正在执行的任务,我正在尝试这个样本,我发现:< / p>
public class MyTracker {
MyTracker(){
try{
inetAddress = new InetSocketAddress(InetAddress.getByName("localhost"), 50030);
}
catch(Exception e){
e.printStackTrace();
}
}
InetSocketAddress inetAddress = null;
public static void main(String[] args) {
MyTracker myTracker = new MyTracker();
myTracker.createJobTracker();
}
public void createJobTracker(){
Configuration conf = new Configuration();
try {
JobClient jobClient = new JobClient(inetAddress, conf);
JobStatus[] activeJobs = jobClient.jobsToComplete();
for(int i = 0 ; i < activeJobs.length; i++){
System.out.println(activeJobs[i]);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
当我运行此代码时出现此错误:
java.io.IOException: Call to localhost/127.0.0.1:50030 failed on local exception: java.io.EOFException
at org.apache.hadoop.ipc.Client.wrapException(Client.java:775)
at org.apache.hadoop.ipc.Client.call(Client.java:743)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220)
at org.apache.hadoop.mapred.$Proxy0.getProtocolVersion(Unknown Source)
请帮助我理解我错过的内容。
答案 0 :(得分:0)
我能够运行它,它确实有一个版本missmatch加上
因为当我应该按照该线程中的描述连接到端口9001时,我试图连接到端口50030。
感谢