Support Questions

Find answers, ask questions, and share your expertise

Ambari Host Registration Failed - Unable to install on hosts

avatar
Expert Contributor

i am unable to create hadoop clusters using Ambari. I am completely stuck in the third step, did everything I could but couldn't. I provided correct FQDN and valid ssh private key

When I gave ssh user account as : sridhar, I got this error

==========================
Creating target directory...
==========================

Command start time 2016-03-06 18:23:37
Automatic Agent registration timed out (timeout = 300 seconds). Check your network connectivity and retry registration, or use manual agent registration.

When I gave the ssh user account as: root, I got this error

==========================
Creating target directory...
==========================

Command start time 2016-03-06 18:43:30

Permission denied (publickey,password).
SSH command execution finished
host=sridhar25.sridhar.com, exitcode=255
Command end time 2016-03-06 18:43:31

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

STDOUT: 
Permission denied (publickey,password).

Can you help me proceed further?

what is the correct ssh user account to be provided for the successful registration?

Software Req:

OS: Ubuntu 14.10 (64bit)

Ram: 4Gb

1 ACCEPTED SOLUTION

avatar
Master Mentor
16 REPLIES 16

avatar
Expert Contributor

@Artem Ervits

After performing installation through manually, it worked perfectly and successfully got registered! Thanks a lot buddy 🙂

Yet, it is showing warning in the Service Issues

The following services should be up
Service
ntpNot running on 1 host

?

avatar
Master Mentor

You can setup NTP depending on your OS using my NTP.sh script https://github.com/dbist/scripts/tree/master/administration/rhel6 go to rhel7 for that version and please accept my answer, thanks

avatar

set SSH for root as well and give a try it will work.

Steps 1) log into your host as root

step 2) cd /root/.ssh

Step 3) run ssh-keygen

Step 4) mkdir authorized_keys

Step 5) chmod 700 ~/.ssh

Step 6) chmod 600 ~/.ssh/*

Ex:

[root@abc.ssh]# ls -lrt

total 28

-rw-r--r--. 1 root root 408 Nov 26 2014 id_rsa.pub

-rw-------. 1 root root 1675 Nov 26 2014 id_rsa

-rw-------. 1 root root 408 Nov 26 2014 authorized_keys

[root@abc .ssh]#

Step 7) cat id_rsa.pub >> authorized_keys

Step 😎 Validate your SSH

ssh <hostname>

avatar
Guru

I just implemented the passwordless SSH and it was fairly straightforward.

I mostly used the steps at http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.1.0/bk_Installing_HDP_AMB/content/_set_up_passwo... as first suggested by Artem in earlier thread. (I did a little short cut that made life a bit easier). Here are the steps I did, with commentary on each.

Note: login to all hosts are as root.

On host of ambari

1. Create public and private keys

[ambarihost root]$ ssh-keygen

You will see the following. Note: for each prompt I hit enter (without entering anything). The result is that I will use the default filenames for the keys, and I will not require a password to open the private key file. (If you want to be more secure, enter a password when prompted).

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/gkeys/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is: 
+---[RSA 2048]----+
(rest of image not shown)

Note the location of the keys created.

id_rsa.pub is the ambari host's public key. It will need to be implemented on all hosts to be deployed in the cluster (see below)

id_rsa is the ambari host's private key. It will need to be uploaded when using the ambari wizard to deploy HDP

2. Write the public key into the authorized keystore (only needed if ambari server will host will be part of cluster -- usually not the case in production deployments but often so in dev environments)

[ambarihost root]$ cat ~/.ssh/d_rsa.pub >> ~/.ssh/authorized_keys

[Loop] On each host that will be part of the HDP cluster

3. create .ssh dir (if does not exist)

[targethost root]$ mkdir ~/.ssh

[End loop]

Back to the host of ambari

[Loop] Do for each host that will be part of your cluster

4. Remotely copy public key from ambari host to target host. This writes the public key to target's /root/.ssh/authorized_keys file, as with step (2) but remotely. Note: <remote.target.host> is the ip address or hostname of the target host

[ambarihost root]$ ssh-copy-id root@<ip address>

You should see the follows. (Enter yes when prompted)

The authenticity of host '12.34.56.78 (12.34.56.78)' can't be established.
RSA key fingerprint is b1:2d:33:67:ce:35:4d:5f:f3:a8:cd:c0:c4:48:86:12.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '12.34.56.78' (RSA) to the list of known hosts.
user@12.34.56.78's password: 
Now try logging into the machine, with "ssh 'root@<remote.target.host>'", and check in:
  ~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.

5. Test that passwordless ssh now works, by sshing to the target host without being prompted for a password.

[ambarihost root]$ ssh root@<ipaddress>

You are successful if you are now on the target host and did not have to enter a password to get there.

6. To return to the ambari host, enter exit

[End loop]

Note:

Some versions of SSH require you to set permissions on each target host. If you are not successful for step 5 above, log into the target host and run

chmod 700 ~/.ssh

chmod 600 ~/.ssh/authorized_keys

(I did not have to do this)

avatar
Rising Star

when I enter

ssh-copy-id root@mssubuntudev2.corp.microsoft.com

then getting the below information. If I tried to enter/or without enter password then getting permission denied message. I tried to login ssh to target host then asking password. confusing here please help me.

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@mssubuntudev2.corp.microsoft.com's password:

avatar
New Contributor

I had a problem because the machine from where I ran the website in the browser, used a different host name then the one that was configured on the server. I am not using a DNS, but if the hostnames are not the same throught out you'll get an error like this in the logs.

Check always in the log file /var/log/ambari-server/ambari-server.log

INFO:root:BootStrapping hosts ['soe12-vm9.aus.stglabs.ibm.com'] using /usr/lib/python2.6/site-packages/ambari_server cluster primary OS: redhat-ppc7 with user 'root'with ssh Port '22' sshKey File /var/run/ambari-server/bootstrap/4/sshKey password File null using tmp dir /var/run/ambari-server/bootstrap/4 ambari: <hostname here>; server_port: 8080; ambari version: 2.5.2.0; user_run_as: root
INFO:root:Executing parallel bootstrap
ERROR:root:ERROR: Bootstrap of host <another hostname> fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: Connection to <another hostname> closed.

,

I had a problem because the machine from where I ran the website in the browser, used a different host name then the one that was configured on the server. I am not using a DNS, but if the hostnames are not the same throught out you'll get an error like this in the logs.

Check always in the log file /var/log/ambari-server/ambari-server.log

INFO:root:BootStrapping hosts ['soe12-vm9.aus.stglabs.ibm.com'] using /usr/lib/python2.6/site-packages/ambari_server cluster primary OS: redhat-ppc7 with user 'root'with ssh Port '22' sshKey File /var/run/ambari-server/bootstrap/4/sshKey password File null using tmp dir /var/run/ambari-server/bootstrap/4 ambari: <hostname here>; server_port: 8080; ambari version: 2.5.2.0; user_run_as: root
INFO:root:Executing parallel bootstrap
ERROR:root:ERROR: Bootstrap of host <another hostname> fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: Connection to <another hostname> closed.

avatar
Contributor

How did you resolve the issue ?