如何在Hadoop集群中访问master的端口50070?

时间:2016-05-02 12:05:07

标签: hadoop centos7

我已经安装了基于CentOS7的Hadoop 2.7.2,这是一个拥有3个奴隶的主人。

问题是我只能通过访问主计算机中的localhost:50070来获取Hadoop集群的状态。访问master:50070192.168.199.139:50070无效,192.168.199.139是主人的IP地址。

同时,奴隶也无法访问192.168.199.139:50070

我是否需要更多指定的配置才能访问50070

在master中运行ifconfig

 eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.199.139  netmask 255.255.255.0  broadcast 192.168.199.255
    inet6 fe80::20c:29ff:fe0d:6143  prefixlen 64  scopeid 0x20<link>
    ether 00:0c:29:0d:61:43  txqueuelen 1000  (Ethernet)
    RX packets 342080  bytes 318632744 (303.8 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 129369  bytes 16629889 (15.8 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 0  (Local Loopback)
    RX packets 6650  bytes 2908305 (2.7 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 6650  bytes 2908305 (2.7 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
    ether 52:54:00:fc:1a:4b  txqueuelen 0  (Ethernet)
    RX packets 0  bytes 0 (0.0 B)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 0  bytes 0 (0.0 B)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2 个答案:

答案 0 :(得分:1)

您应该检查文件dfs.namenode.http-address中的参数hdfs-site.xml。默认值0.0.0.0:50070允许来自任何地方的连接。但是如果你有值localhost:50070,则只允许从localhost连接。

答案 1 :(得分:0)

如果您使用/ etc / hosts中的关联IP更新主机名,则只能从任何计算机访问namenode。在主机文件中添加如下所示

192.168.199.139 master

P.S:/ etc / hosts在所有机器中都应该相同