关于HDFS的Web界面Browse the filesystem 链接无法访问问题

关于HDFS的Web界面Browse the filesystem 链接无法访问问题

虚拟机中搭建Hadoop,完成并正常启动后,物理机浏览器访问HDFS的Web界面 http://192.168.183.130:50070(注:因物理机无对NameNode节点的域名解析,故此处用IP地址访问关于HDFS的Web界面Browse the filesystem 链接无法访问问题 

链接Browse the filesystem是查看文件系统的入口,但是点击后出现页面无法访问问题。
鼠标悬停可知该链接指向jsp页面 192.168.183.130:50070/nn_browsedfscontent.jsp
点击后,页面跳转至 http://hclient1:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=%2F
关于HDFS的Web界面Browse the filesystem 链接无法访问问题 

由此,可分析出问题原因是:物理机无法解析域名 hclient1! 其他链接不能访问原因同上。

查看 /home/hadoop/hadoop-0.20.2/src/webapps/hdfs/nn_browsedfscontent.jsp 页面代码
String fqdn = InetAddress.getByName(nodeToRedirect).getCanonicalHostName();
    redirectLocation = "http://" + fqdn + ":" + redirectPort +
                       "/browseDirectory.jsp?namenodeInfoPort=" +
                       nn.getHttpAddress().getPort() +
                       "&dir=" + URLEncoder.encode("/", "UTF-8");
    resp.sendRedirect(redirectLocation);
由代码可知,当点击Browse the filesystem 时,后台会将请求随机转发到一台DataNode节点,

问题:此处的fqdn是从哪里获得的?是否读取的slaves配置文件中的服务器列表呢?

以上资料来源:http://f.dataguru.cn/thread-67180-1-1.html

相关知识:FQDN

转载于:https://my.oschina.net/HIJAY/blog/414260