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.

Cannot add new host to Ambari

Cannot add new host to Ambari

New Contributor

Hi All,

I am trying to add from some time new host using Ambari. Firstly I used Hortonworks Sandbox 2.4 on Virtualbox with NAT network and new host is also virtual machine on Virtualbox Centos v6 as Bridge Adapter network. I thought that the case can be host names configuration but I checked already all possibilities. SSH has been configured on both machines and I can log in from sandbox to new host without providing the password. Problem starts when during the adding host process in Ambari tool Ambari Agent is trying to connect to Ambari Server nad get this error:

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

Command start time 2017-03-02 19:13:56

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:56

==========================
Copying common functions script...
==========================

Command start time 2017-03-02 19:13:56

scp /usr/lib/python2.6/site-packages/ambari_commons
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:56

==========================
Copying OS type check script...
==========================

Command start time 2017-03-02 19:13:56

scp /usr/lib/python2.6/site-packages/ambari_server/os_check_type.py
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Running OS type check...
==========================

Command start time 2017-03-02 19:13:57
Cluster primary/cluster OS family is redhat6 and local/current OS family is redhat6

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Checking 'sudo' package on remote host...
==========================

Command start time 2017-03-02 19:13:57
sudo-1.8.6p3-25.el6_8.x86_64

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Copying repo file to 'tmp' folder...
==========================

Command start time 2017-03-02 19:13:57

scp /etc/yum.repos.d/ambari.repo
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Moving file to repo dir...
==========================

Command start time 2017-03-02 19:13:57

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Changing permissions for ambari.repo...
==========================

Command start time 2017-03-02 19:13:57

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Copying setup script file...
==========================

Command start time 2017-03-02 19:13:57

scp /usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
host=centos1.example, exitcode=0
Command end time 2017-03-02 19:13:57

==========================
Running setup agent script...
==========================

Command start time 2017-03-02 19:13:57
Host registration aborted. Ambari Agent host cannot reach Ambari Server 'sandbox.hortonworks.com:8080'. Please check the network connectivity between the Ambari Agent host and the Ambari Server

Connection to centos1.example closed.
SSH command execution finished
host=centos1.example, exitcode=1
Command end time 2017-03-02 19:13:58

ERROR: Bootstrap of host centos1.example fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: tcgetattr: Invalid argument
Connection to centos1.example closed.

STDOUT: Host registration aborted. Ambari Agent host cannot reach Ambari Server 'sandbox.hortonworks.com:8080'. Please check the network connectivity between the Ambari Agent host and the Ambari Server

Connection to centos1.example closed.

Please see also etc\host configuration for both machine

ambari server:

127.0.0.1 localhost.localdomain localhost

10.0.2.15 sandbox.hortonworks.com sandbox ambari.hortonworks.com

192.168.0.160 centos1.example centos1

centos host

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

192.168.0.160 centos1.example centos1

192.168.0.104 sandbox.hortonworks.com sandbox.hortonworks.com

where 192.168.0.104 is the IP of my Windows machine where Virtualbox stand. Also tried with assigning 127.0.0.1 to sandbox.

When I start manually Ambari Agent on centos host and look into log I have below warnings:

NFO 2017-03-02 20:10:52,376 ExitHelper.py:53 - Performing cleanup before exiting... INFO 2017-03-02 20:11:06,328 main.py:71 - loglevel=logging.INFO INFO 2017-03-02 20:11:06,329 main.py:71 - loglevel=logging.INFO INFO 2017-03-02 20:11:06,331 DataCleaner.py:39 - Data cleanup thread started INFO 2017-03-02 20:11:06,333 DataCleaner.py:120 - Data cleanup started INFO 2017-03-02 20:11:06,334 DataCleaner.py:122 - Data cleanup finished INFO 2017-03-02 20:11:06,351 PingPortListener.py:50 - Ping port listener started on port: 8670 INFO 2017-03-02 20:11:06,352 main.py:283 - Connecting to Ambari server at https://sandbox.hortonworks.com:8440 (192.168.0.104) INFO 2017-03-02 20:11:06,353 NetUtil.py:60 - Connecting to https://sandbox.hortonworks.com:8440/ca WARNING 2017-03-02 20:11:06,353 NetUtil.py:89 - Failed to connect to https://sandbox.hortonworks.com:8440/ca due to [Errno 111] Connection refused WARNING 2017-03-02 20:11:06,354 NetUtil.py:112 - Server at https://sandbox.hortonworks.com:8440 is not reachable, sleeping for 10 seconds... INFO 2017-03-02 20:11:16,359 NetUtil.py:60 - Connecting to https://sandbox.hortonworks.com:8440/ca WARNING 2017-03-02 20:11:16,360 NetUtil.py:89 - Failed to connect to https://sandbox.hortonworks.com:8440/ca due to [Errno 111] Connection refused

I check Java.home in Ambari server properties file and set to proper one, but still without change

Do you have any idea how to solve it ?

1 REPLY 1

Re: Cannot add new host to Ambari

Expert Contributor

@Jakub Koterba,

The problem is that port 8440 is not forwarded from your windows machine to the sandbox. @Michael Young wrote an excellent article showing how to add the port to the forwarding for this. Just be sure that you do the docker commit sandbox sandbox before you do the docker rm sandbox. Otherwise you will lose all of your changes.

https://community.hortonworks.com/articles/65914/how-to-add-ports-to-the-hdp-25-virtualbox-sandbox.h...

Enjoy!

John

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