Chapter IV.17. Appendix: Using Custom Hostnames

You can customize the agent registration hostname and the public hostname used for
 each host in Ambari.

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>
  4. On every host, using a text editor, open /etc/ambari-agent/conf/ambari-agent.ini.

    Add the following line to the agent section:

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

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

  5. To generate a public hostname 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/bash
    hostname <-f>
  6. On every host, using a text editor, open /etc/ambari-agent/conf/ambari-agent.ini.

    Add the following line to the agent section:

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

  7. Add the hostnames to /etc/hosts on all nodes.


loading table of contents...