Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop : start-dfs.sh Connection refused

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

like image 955
Bob's Jellyfish Avatar asked Jan 10 '18 14:01

Bob's Jellyfish


4 Answers

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

like image 177
Hugo Oshiro Avatar answered Oct 10 '22 16:10

Hugo Oshiro


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.

like image 44
Yoga Yang Avatar answered Oct 10 '22 16:10

Yoga Yang


check if your /etc/hosts file contains the hostname stretch and localhost mapping or not

my /etc/hosts file

like image 2
Manoj Mamidyala Avatar answered Oct 10 '22 15:10

Manoj Mamidyala


Go to your hadoop home directory

~$ cd libexec

~$ nano hadoop-functions.sh

edit this line:

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

with:

if [[ ! -e '/usr/bin/pdsh' ]]; then
like image 1
Umer Rana Avatar answered Oct 10 '22 17:10

Umer Rana