You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Nick Ivanov (JIRA)" <ji...@apache.org> on 2015/04/03 20:09:53 UTC
[jira] [Created] (AMBARI-10354) Ambari agent setup fails on
localhost: server creates invalid configuration file
Nick Ivanov created AMBARI-10354:
------------------------------------
Summary: Ambari agent setup fails on localhost: server creates invalid configuration file
Key: AMBARI-10354
URL: https://issues.apache.org/jira/browse/AMBARI-10354
Project: Ambari
Issue Type: Bug
Components: ambari-server
Affects Versions: 1.7.0
Environment: Centos 6
Reporter: Nick Ivanov
Priority: Minor
setupAgent.py attempts to replace the default server setting "hostname=localhost" with whatever the user provided. In certain circumstances this can make the "hostname" entry invalid. For example: the user supplies something that contains "localhost", e.g. "localhost.localdomain" and deployment fails for some reason. The user fixes the problem and retries deployment, this time the configuration file already contains "hostname=localhost.localdomain" and setupAgent.py, when running for the 2nd time, turns it into "hostname=localhost.localdomain.localdomain".
This is a minor issue, obviously, but the use case is still valid when installing Ambari on a standalone machine for testing or education.
The fix would make the regex match more exact, e.g instead of
{code:title=setupAgent.py}
osCommand = ["sed", "-i.bak", "s/hostname=localhost/hostname=" + server_hostname +
"/g", "/etc/ambari-agent/conf/ambari-agent.ini"]
{code}
use
{code:title=setupAgent.py}
osCommand = ["sed", "-i.bak", "s/^hostname=localhost$/hostname=" + server_hostname +
"/", "/etc/ambari-agent/conf/ambari-agent.ini"]
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)