我正在尝试通过Docker运行一个hadoop集群。我有一个虚拟机作为namenode,另一个作为datanode,但是datanode在运行start-dfs.sh
时给出了这个错误:
namenode: namenode running as process 130. Stop it first.
datanode上的命令jps未显示正在运行的namenode。然后我尝试手动启动它,使用:
hadoop namenode
它失败并出现此错误:
java.net.BindException: Problem binding to [namenode:9000] java.net.BindException: Cannot assign requested address; For more details see: http://wiki.apache.org/hadoop/BindException
到目前为止,似乎namenode不可访问或者没有侦听端口9000.但是网络设置是正确的:如果我在datanode上执行:
telnet namenode 9000
它正确连接到namenode,namenode中的命令netstat -apn | grep 9000
显示传入连接。如果我在namenode(stop-dfs.sh
)上关闭dfs,则来自datanode的telnet命令将失败,并显示“Connection closed by foreign host.
”
HDFS-site.xml中
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value> <!-- I have tried with 1 and 2 too -->
</property>
<property>
<name>dfs.namenode.datanode.registration.ip-hostname-check</name>
<value>false</value>
</property>
</configuration>
芯-site.xml中
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://namenode:9000</value>
</property>
</configuration>
谢谢!