Hadoop UI shows only one Datanode

前端 未结 7 481
刺人心
刺人心 2021-01-19 17:13

I\'ve started hadoop cluster composed of on master and 4 slave nodes.

Configuration seems ok:

hduser@ubuntu-amd64:/usr/local/hadoop$ ./bin/hdfs dfsadmin -rep

相关标签:
7条回答
  • 2021-01-19 17:17

    I came across the same problem, fortunately, I solved it. I guess it causes by the 'localhost'.

    1. Config different name for these IP in /etc/host
    2. Remember to restart all the machines, things will go well.
    0 讨论(0)
  • 2021-01-19 17:27

    As @Rahul said the problem is because of the same hostname

    change your hostname in /etc/hostname file and give different hostname for each host and resolve hostname with ip address /etc/hosts file

    then restart your cluster you will see all datanodes in Datanode information tab on browser

    0 讨论(0)
  • 2021-01-19 17:34

    I have the same trouble because I use ip instead of hostname, [hdfs dfsadmin -report] is correct though it is only one[localhost] in UI. Finally, I solved it like this:

    <property>
           <name>dfs.datanode.hostname</name>                   
           <value>the name you want to show</value>
    </property>
    

    you almost can't find it in any doucument...

    0 讨论(0)
  • 2021-01-19 17:38

    Your admin report looks absolutely fine. Please run the below to check the HDFS disk space details.

    "hdfs dfs -df /"

    If you still see the size being good, its just a UI glitch.

    0 讨论(0)
  • 2021-01-19 17:38

    Sorry, feels like it's been a time. But still I'd like to share my answer: the root cause is from hadoop/etc/hadoop/hdfs-site.xml: the xml file has a property named dfs.datanode.data.dir. If you set all the datanodes with the same name, then hadoop is assuming the cluster has only one datanode. So the proper way of doing it is naming every datanode with a unique name:

    Regards, YUN HANXUAN

    0 讨论(0)
  • 2021-01-19 17:42

    It's because of the same hostname in both datanodes. In your case both datanodes are registering to the namenode with same hostname ie 'localhost' Try with different hostnames it will fix your problem.

    in UI it will show only one entry for a hostname.

    in "hdfs dfsadmin -report" output you can see both.

    0 讨论(0)
提交回复
热议问题