34

I am getting this error while performing start-dfs.sh

Starting namenodes on [localhost] 
pdsh@Gaurav: localhost: rcmd: socket: Permission denied 
Starting datanodes
pdsh@Gaurav: localhost: rcmd: socket: Permission denied
Starting secondary namenodes [Gaurav]
pdsh@Gaurav: Gaurav: rcmd: socket: Permission denied 2017-03-13 09:39:29,559 
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Using hadoop 3.0 alpha 2 version.

Any help is appreciated

BruceWayne
  • 3,286
  • 4
  • 25
  • 35
Gaurav A Dubey
  • 641
  • 1
  • 6
  • 19

5 Answers5

68

I also encountered the same thing, I did so I found that my pdsh default rcmd is rsh, not ssh, rsh and ssh remote login authentication is not the same, when installing hadoop I configured ssh localhost password-free login, but rsh is not possible.

so,try:

1.check your pdsh default rcmd rsh

pdsh -q -w localhost

See what your pdsh default rcmd is.

2.Modify pdsh's default rcmd to ssh

export PDSH_RCMD_TYPE=ssh

you can be added to ~/.bashrc, and source ~/.bashrc

3.sbin / start-dfs.sh

int32
  • 689
  • 5
  • 3
9

Uninstall pdsh will solve this problem. I am working with Hadoop version 3.2.1 on Ubuntu 18.04.4 LTS.

I test start-dfs.sh on several fresh-installed virtual machines and one old VM. The command failed only on the old VM. I have tried the high-voted answer, and found that only the old VM has pdsh installed. So I uninstall this software, and after that the command executed successfully.

So, if you did not install pdsh for some purpose, you can try to uninstall it.

Gary Wang
  • 315
  • 4
  • 11
  • This worked for me too. `pdsh` is not an absolute requirement. From the docs - `Additionally, it is recommmended that pdsh also be installed for better ssh resource management.` – Adi Krishnan Aug 26 '20 at 04:16
  • after removing pdsh i got ```ERROR: JAVA_HOME is not set and could not be found.``` I don't think it was to be removed. – Lawhatre Oct 15 '21 at 15:22
  • @Lawhatre `JAVA_HOME` can be explicitly set in `HADOOP_HOME/etc/hadoop/hadoop-env.sh` or `HOME/.bashrc` or `/etc/profile.d/hadoop.sh`. Make sure that JDK/JRE have been installed on your system. – Gary Wang Oct 20 '21 at 01:18
8

Try uninstalling pdsh

sudo apt-get remove pdsh

and then restart your hadoop by:

sudo start-dfs.sh

This is what worked for me.

Nidhi Raniyer
  • 81
  • 1
  • 1
2

A sudo user could also change pdsh's Rcmd type to ssh via the command:

echo "ssh" | sudo tee /etc/pdsh/rcmd_default

0

Try with sudo

Example:

sudo start-dfs.sh

Otherwise change the owner of the folder hadoop_1.2.7

Example:

sudo chown -R user_name:user_name hadoop_1.2.7
JochenJung
  • 7,183
  • 12
  • 64
  • 113
  • Hi! thanks for the help... The problem was occurring due to 3.0 alpha 2. When I repeated process in hadoop2.7 it solved the problem... – Gaurav A Dubey Mar 13 '17 at 14:27