Hadoop:start-dfs.sh 连接被拒绝 [英] Hadoop : start-dfs.sh Connection refused
问题描述
我在 debian/stretch64 上有一个 vagrant box我尝试使用文档安装 Hadoop3http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.htm
I have a vagrant box on debian/stretch64 I try to install Hadoop3 with documentation http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/SingleCluster.htm
当我运行 start-dfs.sh我有这条消息
When I run start-dfs.sh I have this message
vagrant@stretch:/opt/hadoop$ sudo sbin/start-dfs.sh
Starting namenodes on [localhost]
pdsh@stretch: localhost: connect: Connection refused
Starting datanodes
pdsh@stretch: localhost: connect: Connection refused
Starting secondary namenodes [stretch]
pdsh@stretch: stretch: connect: Connection refused
vagrant@stretch:/opt/hadoop$
当然,我尝试使用以下命令更新我的 hadoop-env.sh:导出 HADOOP_SSH_OPTS="-p 22"
of course I tried to update my hadoop-env.sh with : export HADOOP_SSH_OPTS="-p 22"
ssh localhost 工作(无密码)
ssh localhost work (without password)
我不知道我可以改变什么来解决这个问题
I have not ideas what I can change to solve this problem
推荐答案
pdsh
默认工作方式存在问题(见编辑),但 Hadoop 可以不用它.Hadoop 检查系统是否在 /usr/bin/pdsh
上有 pdsh
,如果有就使用它.摆脱使用 pdsh
的一种简单方法是编辑 $HADOOP_HOME/libexec/hadoop-functions.sh
There is a problem the way pdsh
works by default (see edit), but Hadoop can go without it. Hadoop checks if the system has pdsh
on /usr/bin/pdsh
and uses it if so. An easy way get away from using pdsh
is editing $HADOOP_HOME/libexec/hadoop-functions.sh
换行
if [[ -e '/usr/bin/pdsh' ]]; then
通过
if [[ ! -e '/usr/bin/pdsh' ]]; then
然后 hadoop 没有 pdsh
并且一切正常.
then hadoop goes without pdsh
and everything works.
更好的解决方案是使用 pdsh
,但使用 ssh
而不是 rsh
,如 这里,所以替换 $HADOOP_HOME/libexec/hadoop-functions.sh
中的行:
A better solution would be use pdsh
, but with ssh
instead rsh
as explained here, so replace line from $HADOOP_HOME/libexec/hadoop-functions.sh
:
PDSH_SSH_ARGS_APPEND="${HADOOP_SSH_OPTS}" pdsh
通过
PDSH_RCMD_TYPE=ssh PDSH_SSH_ARGS_APPEND="${HADOOP_SSH_OPTS}" pdsh
Obs:正如我在评论中提到的那样,仅执行 export PDSH_RCMD_TYPE=ssh
是行不通的.不知道为什么……
Obs: Only doing export PDSH_RCMD_TYPE=ssh
, as I mention in the comment, doesn't work. I don't know why...
我还打开了一个问题并提交了一个补丁来解决这个问题:HADOOP-15219
I've also opened a issue and submitted a patch to this problem: HADOOP-15219
这篇关于Hadoop:start-dfs.sh 连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!