The first step to deploying a Hadoop cluster with Ambari is to register hosts on Ambari Web UI. However, it fails with the error message "Permission denied". Below is an example of the detailed logs related to such an error. This information and log can be viewed on Ambari Web UI.
========================== Creating target directory... ========================== Command start time 2015-04-28 21:59:09 Warning: Permanently added 'hdm1.hadoop.local,192.168.4.23' (RSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). SSH command execution finished host=hdm1.hadoop.local, exitcode=255 Command end time 2015-04-28 21:59:09 ERROR: Bootstrap of host hdm1.hadoop.local fails because previous action finished with non-zero exit code (255) ERROR MESSAGE: Warning: Permanently added 'hdm1.hadoop.local,192.168.4.23' (RSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). STDOUT: Warning: Permanently added 'hdm1.hadoop.local,192.168.4.23' (RSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
"Permission denied" indicates that SSH access from the Ambari server to the provided hosts fails due to insufficient permission. This is caused by an invalid SSH key provided in the "Host Registration Information". There are a few reasons this occurs:
1. Public SSH key of the specified user on the Ambari server is provided instead of the private SSH key.
2. Public SSH key of the specified user on the Ambari server is not copied to remote host.
3. The private SSH key of a specified user on the Ambari server is inputed by coping and pasting the information. This might result in extra white spaces being included in the key.
Follow the instructions below to resolve this issue:
1. Always use a private SSH key from the Ambari server instead of the public SSH key.
2. Use ssh-copy-id to copy public key file from the Ambari server host to the remote host. For example:
# ssh-copy-id -i ~/.ssh/id_rsa.pub machine1.example.com
3. Try to get the private SSH key file (~/.ssh/id_rsa) from the Ambari server and choose it on the Web UI instead of copying it from the terminal and pasting it onto the Web UI.