In this EC2 example two VMs have been allocated. Each VM has an external hostname by which it can be accessed via the internet. However the EC2 VM is unaware of this external host name, and instead is configured with the internal hostname.
External hostnames - ec2-23-22-31-165.compute-1.amazonaws.com, ec2-23-23-25-10.compute-1.amazonaws.com
Internal hostnames - ip-10-118-99-172.ec2.internal, ip-10-39-107-209.ec2.internal
The following shows the Hostmap definition required to allow access external to the Hadoop cluster via the Apache Knox Gateway.
<topology> <gateway> ...
<provider> <role>hostmap</role> <name>static</name>
<enabled>true</enabled> <!-- For each host enter a set of parameters
--> <param> <name>ec2-23-22-31-165.compute-1.amazonaws.com</name>
<value>ip-10-118-99-172.ec2.internal</value> </param> <param>
<name>ec2-23-23-25-10.compute-1.amazonaws.com</name>
<value>ip-10-39-107-209.ec2.internal</value> </param>
</provider> ... </gateway> <service> ... </service> ...
</topology>