首页 \ 问答 \ Namenodes不使用具有HDFS Federation的完全分布式hadoop集群中的所有datanode(Namenodes don't use all datanodes in a fully distributed hadoop cluster with HDFS Federation)

Namenodes不使用具有HDFS Federation的完全分布式hadoop集群中的所有datanode(Namenodes don't use all datanodes in a fully distributed hadoop cluster with HDFS Federation)

实际上,作为最终项目分配工作的大数据项目,我一直在寻找在完全分布式集群上运行HDFS联合的意思。

我的群集的规格是:

  • Hadoop 2.7.2
  • JDK 1.8.74
  • OS系统是CentOS 6.7
  • 2个名称节点(Namenode1和Namenode2)
  • 2个数据节点(Datanode1和Datanode2)
  • 1个客户端(为ViewFS安装表配置)

使用一个namenode,集群(1个namenode + 2个datanode)工作正常,所有配置看起来都是正确的。

我找不到那么多教程解释如何完全配置HDFS联合(用于运行两个共享所有数据节点的名称节点),甚至在Apache Hadoop的官方文档中也没有。 我使用的是以下完全分布式Hadoop联合群集


我有效运行HDFS联合的尝试失败了,即使dfs守护程序已成功启动,所有名称节点都不使用数据节点。

实际情况 :

当我启动dfs服务(使用start-dfs.sh )时,Namednode1使用所有数据节点,Namenode2使用none。 或者每个namenode只使用一个唯一的datanode( Namenode1使用Datanode1,Namenode2使用Datanode2 )。

数据节点的使用似乎是随机的,但它们永远不会同时被两个名字节点使用(我的目标)

如果有人知道如何使用多个名称节点运行HDFS联合,欢迎您帮助= P谢谢。


Actually working on a Big Data project as a final project assignement, I'v been looking for a mean to run HDFS Federation on a fully distributed cluster.

The specifications of my cluster are :

  • Hadoop 2.7.2
  • JDK 1.8.74
  • The OS system is CentOS 6.7
  • 2 namenodes (Namenode1 and Namenode2)
  • 2 datanodes (Datanode1 and Datanode2)
  • 1 Client (configured for ViewFS mount table)

With one namenode, the cluster (1 namenode + 2 datanodes) works fine, all the configurations seem correct.

I couldn't find that many tutorials explaning how to fully configure the HDFS Federation (for running two namenodes that share all the datanodes) not even in the official documentation of Apache Hadoop. The one I used is the following Fully Distributed Hadoop Federation Cluster


My attempts to run effectively the HDFS Federation have failed, even if the dfs daemons have successfully launched, the datanodes are not used by all the namenodes.

Actual situation :

When I start the dfs services (with start-dfs.sh), the Namednode1 use all the datanodes and the Namenode2 use none. Or each namenode use only one unique datanode (Namenode1 uses Datanode1 and Namenode2 uses Datanode2).

The datanodes usage seems random but they are never all used by the two namenodes at the same time (my objective)

If anyone knows how to run the HDFS Federation with several namenodes, you're welcome to help =P Thank you.


原文:https://stackoverflow.com/questions/36158232
更新时间:2024-01-05 09:01

最满意答案

当你注释掉你的Thymeleaf / javascript时,Thymeleaf正试图让JavaScript自然模板起作用 。 它会在评论结束后删除所有内容,因为它认为您正在尝试使用Thymeleaf处理模板,并且只是在浏览器中查看它而不进行处理。

您应该移动到附加ID的位置。

function confirmDelete (id) {
  var r = confirm("Are you sure to delete the item #" + id + " ?");
  if (r == true) {
    var link = /*[[@{/company/delete/}]]*/ "";
    window.location.href = link + id;
  } 
}

When you comment out your Thymeleaf/javascript like that, Thymeleaf is attempting to make JavaScript natural templates work. It deletes everything after the end of the comment because it thinks you are trying to make the template work both using Thymeleaf to process, and just viewing it in your browser without processing.

You should just move where you are appending the id.

function confirmDelete (id) {
  var r = confirm("Are you sure to delete the item #" + id + " ?");
  if (r == true) {
    var link = /*[[@{/company/delete/}]]*/ "";
    window.location.href = link + id;
  } 
}

相关问答

更多
  • @ModelAttribute用于将常用对象绑定到模型。 您每次都从@ModelAttribute注释的方法url()返回一个String generatedurl 。 因此,在您的Thymleaf视图中,每当您执行${url}您都会获得generatedurl 。 解决您的问题的一个解决方法可能是这样的 @ModelAttribute("url") public void url(Model model) { model.addAttribute("url","YOUR_URL"); mo ...
  • 您应该可以使用urlencode提供的第二个doseq参数: http://docs.python.org/2/library/urllib.html 所以基本上,你可以像下面这样将一个列表字典传递给urlencode: urllib.urlencode(params, True) 它会做正确的事情。 You should be able to use the second doseq parameter urlencode offers: http://docs.python.org/2/library ...
  • 对象HyperLink似乎是用于链接到内部状态,可能是为了改变其href很难? 我建议您使用此课程http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/InlineHTML.html - 显然您正在以编程方式生成href ,因此生成要提供给InlineHTML对象的元素应该很容易。 The object HyperLink seems to be for linking to intern ...
  • 答案是使用th:attr
    看起来我做了更多的研究并找到了一种方法。 关键词是:预处理。 这是链接。 因此,为了我的目的,以下表达式适用: th:href="@{'/search/'+${searchType}(__(${parameter1}=='-1'?','parameter1=${parameter1})__,__(${parameter2}=='-1'?','parameter2=${parameter2})__)}" 简短解释:用双下划线__(${parameter1}=='-1'?','parameter1=${par ...
  • 当你注释掉你的Thymeleaf / javascript时,Thymeleaf正试图让JavaScript自然模板起作用 。 它会在评论结束后删除所有内容,因为它认为您正在尝试使用Thymeleaf处理模板,并且只是在浏览器中查看它而不进行处理。 您应该移动到附加ID的位置。 function confirmDelete (id) { var r = confirm("Are you sure to delete the item #" + id + " ?"); if (r == true) { ...
  • 对于我的错误“既不是BindingResult也不是bean名称的普通目标对象”,问题是我的表单期待一个post对象,但是在getAll方法中我没有提供新的post对象。 为了解决这里的错误,我做了什么 @RequestMapping(value = "/getAll") // public String create(@Valid Post post, BindingResult bindingResult, Model // model) { public ModelAndView getAll() { ...
  • 以你已有的为基础。 只需使用字符串连接来构建url ,并使用jQuery的.html()来创建链接: var dynamicContent = "secondpagetest.com"; var url = "https://www."+dynamicContent+"?extratrackingparameters"; $('#container').html('link');