Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-10354

Ambari agent setup fails on localhost: server creates invalid configuration file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.7.0, 2.2.0
    • None
    • ambari-server
    • Centos 6

    Description

      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

      setupAgent.py
      osCommand = ["sed", "-i.bak", "s/hostname=localhost/hostname=" + server_hostname +
                                    "/g", "/etc/ambari-agent/conf/ambari-agent.ini"]
      

      use

      setupAgent.py
      osCommand = ["sed", "-i.bak", "s/^hostname=localhost$/hostname=" + server_hostname +
                                    "/", "/etc/ambari-agent/conf/ambari-agent.ini"]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            nickivanov Nick Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified