简体   繁体   English

Hadoop名称节点不侦听外部IP

[英]Hadoop namenode does not listen outside IPs

I have a simple hadoop cluster of 3 machines. 我有一个由3台机器组成的简单hadoop集群。 One master and two slaves. 一位主人和两位奴隶。 All of them are running the latest minimalist version of CentOS I downloaded there . 所有这些正在运行的CentOS我的最新版本无华下载那里

All my machines have the same hosts file: 我所有的机器都有相同的主机文件:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.101  master
192.168.56.102  slave1
192.168.56.103  slave2

The core-site.xml file is configured as follows: (The namenode should listen on port 9000) core-site.xml文件的配置如下:(namenode应该在端口9000上侦听)

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
    <name>fs.default.name</name>
    <value>hdfs://master:9000/</value>
</property>
<property>
    <name>dfs.permissions</name>
    <value>false</value>
</property>
</configuration>

When starting hdfs from the master and checking the logs of the datanodes/slaves I noticed the datanodes could not connect to the namenode . 从主机启动hdfs并检查datanode / slave的日志时, 我注意到datanode无法连接到namenode

Retrying connect to server: master/192.168.56.101:9000. Already tried 0 time(s).

After further checking it looks like the port 9000 is only accessible if I attempt to connect to it from the namenode itself. 经过进一步检查后,看起来只有当我尝试从namenode自身连接到端口9000时,才能访问该端口9000。

[root@HadoopMaster conf]# sudo netstat -tulpn | grep :9000
tcp6       0      0 192.168.56.101:9000     :::*                    LISTEN      11055/java

Attempting a telnet master 9000 only succeeds from the master host. 尝试telnet master 9000只能从主机进行。 The slaves get the following error: 从站出现以下错误:

[root@Slave1 logs]# telnet master 9000
Trying 192.168.56.101...
telnet: connect to address 192.168.56.101: No route to host

But on the contrary they can connect to port 22 just fine 但是相反,它们可以连接到端口22

[root@Slave1 logs]# telnet master 22
Trying 192.168.56.101...
Connected to master.
Escape character is '^]'.
SSH-2.0-OpenSSH_6.6.1

So this has to be an IP binding issue . 因此,这必须是IP绑定问题 I have looked everywhere and could not find a viable answer. 我到处都是,找不到可行的答案。 Similar questions to mine were solved by using a fully qualified domain name in the core-site.xml file which I did without success. 我的类似问题是通过在core-site.xml文件中使用完全限定的域名解决的,但我没有成功。

By the way, I also disabled iptables and before that opened all my master's ports to my slaves IPs. 顺便说一句,我也禁用了iptables,在此之前,我打开了所有主机的端口到从机IP。 No success. 没有成功

If you find the answer, I would definitely like to send you a delicious virtual cookie ;) 如果您找到答案,我肯定会向您发送美味的虚拟Cookie;)

I just realized CentOS's default firewall is not iptables but firewalld. 我刚刚意识到CentOS的默认防火墙不是iptables而是firewalld。 After configuring this firewall correctly I managed to solve my problem! 正确配置此防火墙后,我设法解决了问题!

Why is iptables installed but not used, that is a mystery though. 为什么安装但未使用iptables,但这是一个谜。 Boy, I prefer so much the Debian family. 男孩,我非常喜欢Debian家庭。

If you are running those VM in several instances of VM VirtualBox that seems natural, even if they are on the same network they can't see each other. 如果您在看起来很自然的VM VirtualBox的多个实例中运行这些VM,则即使它们在同一网络上也不会看到对方。

Check virtualbox manual to configure the network properly, you can also check this answer 检查virtualbox手册以正确配置网络,也可以检查此答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM