Configure a custom host name
Before deploying components to a host, customize the host name, if desired.
Edit the contents of the /var/lib/ambari-agent/host name.sh
script to return the host name that you want the Ambari Agent to register with.
Make sure that you chmod the script so it is executable by the user running the Ambari Agent. For most installations, 0755 is the sufficient permission to use.The following script could be used to have the Ambari Agent register with the ‘c1r1.hortonworks.local’ host name.
#!/bin/sh echo ‘c1r1.hortonworks.local’
Configure the Ambari Agent to use this script, by editing the
/etc/ambari-agent/conf/ambari-agent.ini using a text editor.
Add the following property to the [agent] section: host name_script=/var/lib/ambari-agent/host name.shIn this case, Ambari Agent will use the /var/lib/ambari-agent/host name.sh script to determine the host name that it will use to register with the Ambari Server.
Restart the agent to ensure that it registers with the custom host name.