Pivotal Knowledge Base

Follow

Host registration in Ambari fails with "Permission denied"

Environment

  • PHD 3.x
  • Ambari 1.7.x

Problem

The initial step of deploying a Hadoop cluster with Ambari is to register hosts on Ambari Web UI. However it could fail at this step with error "Permission denied". Following is an example of the detailed logs about such kind of error, which could 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).

Cause

"Permission denied" indicates that SSH access from Ambari server to provided hosts fails due to insufficient permission. This could be caused by invalid SSH key provided in the part of "Host Registration Information". Serveral possible reasons here:

1) Public SSH key of the specified user on Ambari server is provided instead of the private SSH key

2) Public SSH key of the specified user on Ambari server is not copied to remote host

3) The private SSH key of specified user on Ambari server is input with copy/paste which might result in extra white spaces being included in the key

Fix

1) Always use private SSH key from Ambari server instead of publick SSH key

2) Use ssh-copy-id to copy public key file from Ambari server host to remote host. For example,

# ssh-copy-id -i ~/.ssh/id_rsa.pub machine1.example.com

3) Try to get the private SSH key file (e.g. ~/.ssh/id_rsa) from Ambari server and choose it on Web UI instead of copying on terminal and pasting it onto Web UI

Comments

Powered by Zendesk