[ https://issues.apache.org/jira/browse/AMBARI-10354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rodolfo Dias updated AMBARI-10354: ---------------------------------- Affects Version/s: 2.2.0 > 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, 2.2.0 > Environment: Centos 6 > Reporter: Nick Ivanov > Priority: Minor > Labels: server, setup > Original Estimate: 10m > Remaining Estimate: 10m > > 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)