Hadoop : start-dfs.sh Connection refused

依然范特西╮ 提交于 2019-12-10 17:44:12

问题


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

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$

of course I tried to update my hadoop-env.sh with : export HADOOP_SSH_OPTS="-p 22"

ssh localhost work (without password)

I have not ideas what I can change to solve this problem


回答1:


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

replace the line

if [[ -e '/usr/bin/pdsh' ]]; then

by

if [[ ! -e '/usr/bin/pdsh' ]]; then

then hadoop goes without pdsh and everything works.

EDIT:

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 \

by

PDSH_RCMD_TYPE=ssh PDSH_SSH_ARGS_APPEND="${HADOOP_SSH_OPTS}" pdsh \

Obs: Only doing export PDSH_RCMD_TYPE=ssh, as I mention in the comment, doesn't work. I don't know why...

I've also opened a issue and submitted a patch to this problem: HADOOP-15219




回答2:


Check if the firewalls are running on your vagrant box

chkconfig iptables off
/etc/init.d/iptables stop

if not that have a look in the underlying logs /var/log/...




回答3:


I fixed this problem for hadoop 3.1.0 by adding

PDSH_RCMD_TYPE=ssh

in my .bashrc as well as $HADOOP_HOME/etc/hadoop/hadoop-env.sh.



来源:https://stackoverflow.com/questions/48189954/hadoop-start-dfs-sh-connection-refused

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!