Hadoop 2.6.0 - Asking password for the user while

2019-08-10 00:45发布

I've installed hadoop 2.6.0 in ubuntu linux on a pseudo distributed mode. Everything is fine except this issue. When I run the start-dfs.sh script to start daemons it's asking for the linux user password. Not sure why? It's asking for the password for every daemon (namenode, datanode & sec namenode). Could you please help to address this issue?

huser@ubuntu:~/hadoop$ sbin/start-dfs.sh
Starting namenodes on [localhost]
huser@localhost's password:

Thanks in advance.

2条回答
虎瘦雄心在
2楼-- · 2019-08-10 00:47

In Ubuntu, you can use the following one time set up steps to eliminate the need to enter password when running hadoop commands, for example, start-dfs.sh, start-yarn.sh:

sudo apt-get install openssh-server openssh-client
ssh-keygen -t rsa
ssh-copy-id user@localhost

replace user with your username. It was tested on Ubuntu 16.04.2, hadoop-2.7.3, jdk1.8.0_121

Note: 1. when execute "ssh-keygen -t rsa" command, you can simply press ENTER three times to accept the default values. 2. when execute "ssh-copy-id user@localhost" command, "Are you sure you want to continue connecting (yes/no)?" enter "yes", then your password

See this question also

查看更多
小情绪 Triste *
3楼-- · 2019-08-10 00:59

This happens if you did not setup passwordless ssh for huser@localhost. getenfor

If you did setup passwordless ssh make sure selinux is disabled by using $sestatus command.

Note: You should run sestatus as a sudo user.

查看更多
登录 后发表回答