如何在win7下的eclipse中调试Hadoop2.2.0的程序

 我来答
育知同创教育
2016-04-11 · 百度知道合伙人官方认证企业
育知同创教育
1【专注:Python+人工智能|Java大数据|HTML5培训】 2【免费提供名师直播课堂、公开课及视频教程】 3【地址:北京市昌平区三旗百汇物美大卖场2层,微信公众号:yuzhitc】
向TA提问
展开全部
 如何eclipse中调试hadoop2.2.0,如果你使用的还是hadoop1.x的版本,那么,也没事,散仙在以前的博客里,也写过eclipse调试1.x的hadoop程序,两者最大的不同之处在于使用的eclipse插件不同,hadoop2.x与hadoop1.x的API,不太一致,所以插件也不一样,我们只需要使用分别对应的插件即可.
  方法如下:

  进入wordpress后台,Jetpack,点分享的配置,选择 Add a new service,
  server name 一定要写英文不能写中文,不然就崩溃了,如douban,
  private static String checkHadoopHome() {

  // first check the Dflag hadoop.home.dir with JVM scope
  //System.setProperty("hadoop.home.dir", "...");
  String home = System.getProperty("hadoop.home.dir");

  // fall back to the system/user-global env variable
  if (home == null) {
  home = System.getenv("HADOOP_HOME");
  }

  try {
  // couldn't find either setting for hadoop's home directory
  if (home == null) {
  throw new IOException("HADOOP_HOME or hadoop.home.dir are not set.");
  }

  if (home.startsWith("\"") && home.endsWith("\"")) {
  home = home.substring(1, home.length()-1);
  }

  // check that the home setting is actually a directory that exists
  File homedir = new File(home);
  if (!homedir.isAbsolute() || !homedir.exists() || !homedir.isDirectory()) {
  throw new IOException("Hadoop home directory " + homedir
  + " does not exist, is not a directory, or is not an absolute path.");
  }

  home = homedir.getCanonicalPath();

  } catch (IOException ioe) {
  if (LOG.isDebugEnabled()) {
  LOG.debug("Failed to detect a valid hadoop home directory", ioe);
  }
  home = null;
  }
  //固定本机的hadoop地址
  home="D:\\hadoop-2.2.0";
  return home;
  }
甘波涛0HX
2016-04-11 · TA获得超过4032个赞
知道小有建树答主
回答量:443
采纳率:0%
帮助的人:391万
展开全部
private static String checkHadoopHome() {

// first check the Dflag hadoop.home.dir with JVM scope
//System.setProperty("hadoop.home.dir", "...");
String home = System.getProperty("hadoop.home.dir");

// fall back to the system/user-global env variable
if (home == null) {
home = System.getenv("HADOOP_HOME");
}

try {
// couldn't find either setting for hadoop's home directory
if (home == null) {
throw new IOException("HADOOP_HOME or hadoop.home.dir are not set.");
}

if (home.startsWith("\"") && home.endsWith("\"")) {
home = home.substring(1, home.length()-1);
}

// check that the home setting is actually a directory that exists
File homedir = new File(home);
if (!homedir.isAbsolute() || !homedir.exists() || !homedir.isDirectory()) {
throw new IOException("Hadoop home directory " + homedir
+ " does not exist, is not a directory, or is not an absolute path.");
}

home = homedir.getCanonicalPath();

} catch (IOException ioe) {
if (LOG.isDebugEnabled()) {
LOG.debug("Failed to detect a valid hadoop home directory", ioe);
}
home = null;
}
//固定本机的hadoop地址
home="D:\\hadoop-2.2.0";
return home;
}。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式