Chapter 3. Using Custom Host Names

You can customize the agent registration host name and the public host name used for
 each host in Ambari. Use this capability when "hostname" does not return the public network host name for your machines.

To customize the name of each host in your cluster:

  1. On the Install Options screen, select Perform Manual Registration for Ambari Agents.

  2. Install the Agents manually, as described in Installing Ambari Agents Manually.

  3. To echo the customized name of the host to which the Ambari agent registers, for every host, create a script like the following example, named
 /var/lib/ambari-agent/hostname.sh.

    #!/bin/sh

    echo ambari_hostname

    where ambari_hostname is the hostname to use for Agent registration

  4. Open /etc/ambari-agent/conf/ambari-agent.ini on every host, using a text editor.

  5. Add to the agent section the following line:

    hostname_script=/var/lib/ambari-agent/hostname.sh

    where/var/lib/ambari-agent/hostname.sh is the name of your custom echo script.

  6. To generate a public host name for every host, create a script like the following example, named /var/lib/ambari-agent/public_hostname.sh to show the name for that host in the UI.

    #!/bin/sh
    hostname -f
  7. Open /etc/ambari-agent/conf/ambari-agent.ini on every host, using a text editor.

  8. Add to the agent section the following line:

    public_hostname_script=/var/lib/ambari-agent/public_hostname.sh

  9. Add the host names to /etc/hosts on every host.


loading table of contents...