Topology hierarchy

Learn about how to configure the topology hierarchy, static list, dynamic list, write path, read path and container replication.

To configure the topology hierarchy, use the net.topology.node.switch.mapping.impl configuration key. This configuration defines the implementation of org.apache.hadoop.net.CachedDNSToSwitchMapping.

As this configuration belongs to the Hadoop class, the configuration is exactly the same as the Hadoop configuration.

Static list

To configure the static list, use the TableMapping mentioned below:
<property>
   <name>net.topology.node.switch.mapping.impl</name>
   <value>org.apache.hadoop.net.TableMapping</value>
</property>
<property>
   <name>net.topology.table.file.name</name>
   <value>/opt/hadoop/compose/ozone-topology/network-config</value>
</property>

The net.topology.table.file.name property option must point to a text file. The file format is a two-column text file with columns separated by whitespace. The first column is the IP address and the second column specifies the rack where the address maps. If there is no entry for a host in the cluster, then /default-rack is assumed.

Dynamic list

To identify the Rack information, use the following external script:
<property>
   <name>net.topology.node.switch.mapping.impl</name>
   <value>org.apache.hadoop.net.ScriptBasedMapping</value>
</property>
<property>
   <name>net.topology.script.file.name</name>
   <value>/usr/local/bin/rack.sh</value>
</property>
If you are implementing an external script, the script is specified with the net.topology.script.file.name parameter in the configuration files. The external topology script is not included with the Ozone distribution and is provided by the administrator.Ozone sends multiple IP addresses to ARGV when forking the topology script.

Ozone sends multiple IP addresses to ARGV when forking the topology script. The number of IP addresses sent to the topology script is controlled with the net.topology.script.number.args property. The default value is 100. For example, if you change the net.topology.script.number.args property value to 1, then for each IP submitted, one topology script gets forked.