[
https://issues.apache.org/jira/browse/AMBARI-22828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Srikanth Janardhan resolved AMBARI-22828.
-----------------------------------------
Resolution: Not A Problem
> Ambari agent registration passes even though the hostnames do not match
> -----------------------------------------------------------------------
>
> Key: AMBARI-22828
> URL: https://issues.apache.org/jira/browse/AMBARI-22828
> Project: Ambari
> Issue Type: Bug
> Components: ambari-agent
> Affects Versions: 2.6.2
> Reporter: Srikanth Janardhan
> Priority: Blocker
> Labels: regression
> Fix For: 2.6.2
>
>
> h6. Test Steps
> # # Setup Ambari and start it
> # Start Deployment of HDP till Install Options page
> # Enter different hostnames in Target Hosts field (for e.g. ambari-host.1 and
> ambari-host.2)
> # Change the hostnames for other hosts in the cluster in /etc/hosts in Ambari
> Server machine to match the above 2 host names (e.g. x.x.x.x abc.example.com
> to x.x.x.x ambari-host.1)
> # At this point, other machines in the cluster have different host names from
> what is provided in the server.
> # Add the SSH keys in Install Options page and click "Register and Confirm"
> h6. Expected
> # The ambari agent registration fails in Ambari UI
> # A Warning message appears in the agent logs: {quote}Ambari agent machine
> hostname (ctr-e137-1514896590304-32888-01-000005.hwx.site.) does not match
> expected ambari server hostname (ambari.host-1). Aborting registration.
> Please check hostname, hostname -f and /etc/hosts file to confirm your
> hostname is setup correctly{quote}
> h6. Actual
> # Ambari agent registration passes successfully !Screen Shot 2018-01-23 at
> 12.34.06 PM.png|thumbnail!
> # The warning message does not appear in agent logs.
> Whereas attempting a restart of the agent with incorrect hostname does not
> succeed:
> {code:bash}
> [root@ctr-e137-1514896590304-32888-01-000003 ~]# /usr/sbin/ambari-agent
> restart --expected-hostname=ambari.host-2
> Restarting ambari-agent
> Verifying Python version compatibility...
> Using python /usr/bin/python
> Found ambari-agent PID: 28192
> Stopping ambari-agent
> Removing PID file at /run/ambari-agent/ambari-agent.pid
> ambari-agent successfully stopped
> Verifying Python version compatibility...
> Using python /usr/bin/python
> Checking for previously running Ambari Agent...
> Checking ambari-common dir...
> Starting ambari-agent
> Killed
> ===================
> INFO 2018-01-23 07:03:36,654 DataCleaner.py:120 - Data cleanup started
> INFO 2018-01-23 07:03:36,655 hostname.py:67 - agent:hostname_script
> configuration not defined thus read hostname
> 'ctr-e137-1514896590304-32888-01-000003.hwx.site' using socket.getfqdn().
> ERROR 2018-01-23 07:03:36,656 main.py:244 - Ambari agent machine hostname
> (ctr-e137-1514896590304-32888-01-000003.hwx.site) does not match expected
> ambari server hostname (ambari.host-2). Aborting registration. Please check
> hostname, hostname -f and /etc/hosts file to confirm your hostname is setup
> correctly
> INFO 2018-01-23 07:03:36,657 ExitHelper.py:56 - Performing cleanup before
> exiting...
> ===================
> {code}
> Ambari build: 2.6.2.0-32.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)