Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to add new hosts using ambari

Highlighted

Unable to add new hosts using ambari

New Contributor

I have a running hortonworks sandbox and I am trying to add a new host (ubuntu) to it. I have assigned ip addresses to each of the machines and I am also able to ssh into both the sandbox and the ubuntu machine remotely. I have also added the public key of sandbox to my host using https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/. So I am also able to login to my host (ubuntu) from the sandbox without any password. However, when I try to add the host using the ambari UI, I get an error.

==========================
Creating target directory...
==========================
Command start time 2018-09-13 21:45:39
Permission denied (publickey,password).
SSH command execution finished
host=10.99.162.xxx, exitcode=255
Command end time 2018-09-13 21:45:40
ERROR: Bootstrap of host 10.99.162.xxx fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: Permission denied (publickey,password).
STDOUT: 
Permission denied (publickey,password).
2 REPLIES 2

Re: Unable to add new hosts using ambari

Super Mentor

@Sahil M

Sandbox is basically designed for quick testing and learning the HDP/HDF components. It is basically designed to be a Single Node Cluster installation. So is there any specific reason that you are trying to add more hosts to your Sandbox?

Also the error which you shared seems to bre due to SSH keys setup.

ERROR: Bootstrap of host 10.99.162.xxx fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: Permission denied (publickey,password).



Note that the Sandbox are customized containers which runs on Docker so there are different ports used for some services like port 2222 for doing the SSH ..etc.

In general if you want to fix the "Permission denied (publickey,password)" error then you might need to kee the following things in mind.


1. The correct SSH port is being used. (by default in the abari UI during host registration you will see the default SSH port as 22. Where as Sandbox uses port 2222)

2. You need to check the following directory and file permissions.

######## ls -l ~/.ssh/
total 16
-rw-------. 1 root root  412 Aug 18  2016 authorized_keys
-rw-------. 1 root root 1675 Feb 13  2017 id_rsa
-rw-r--r--. 1 root root  404 Feb 13  2017 id_rsa.pub
-rw-r--r--. 1 root root 2821 Dec  4  2017 known_hosts
######## ls -ld ~/.ssh/
drwx------. 2 root root 4096 Feb 13  2017 /root/.ssh

.

3. The Hostname (FQDN) resolution should be correct. Ambari Cluster relies on the FQDN not directly on the IP Address) Every cluster node should be able to resolve each other using their correct FQDN (including Ambari Server)

# hostname -f
# cat /etc/hosts

.

Please use the Hostnames to do ssh or to register a host instead of using the IP Addresses (host=10.99.162.xxx)

Re: Unable to add new hosts using ambari

New Contributor

@Jay Kumar SenSharma

1. I think the correct ssh port is being used while registering the hosts as I am able to ssh to my host from the sandbox using port 22.

2. On my sandbox:

ls -l ~/.ssh/

-rw-r--r-- 1 root root410 Sep 13 22:55 authorized_keys

-rw------- 1 root root 1675 Sep 13 22:48 id_rsa

-rw-r--r-- 1 root root410 Sep 13 22:48 id_rsa.pub

-rw-r--r-- 1 root root798 Sep 13 22:53 known_hosts

ls -ld ~/.ssh/

drwx------ 1 root root 4096 Sep 13 22:55 /root/.ssh/

3. On sandbox:

hostname -f

sandbox.hortonworks.com

cat /etc/hosts

127.0.0.1 localhost

::1 localhost ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

172.17.0.2 sandbox.hortonworks.com

10.99.162.xxx sahil-virtual-machine

10.99.162.xxx sandbox.hortonworks.com

On the host:

hostname -f

sahil-virtual-machine

cat /etc/hosts

127.0.0.1 localhost

127.0.1.1 sahil-virtual-machine

10.99.162.xxx sahil-virtual-machine

10.99.162.xxx sandbox.hortonworks.com

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

Also I am able to ssh to my ubuntu machine using hostname (sahil-virtual-machine) however I am unable to ssh to the sandbox using the hostname (sandbox.hortonworks.com)

This is just for learning purposes as I am new to all this. Your help is very much appreciated.

Don't have an account?
Coming from Hortonworks? Activate your account here