The hosting.config file enables you to assign cache partitions to specific origin servers and/or domains so that you can manage cache space efficiently and restrict disk usage. For step-by-step instructions on partitioning the cache according to origin servers and/or domains, refer to Partitioning the Cache According to Origin Server or Domain. Before you can assign cache partitions to specific origin servers and/or domains, you must first partition your cache according to size and protocol in the volume.config file. For step-by-step instructions about partitioning your cache, refer to Partitioning the Cache. For a description of the volume.config file, refer to volume.config.

After you modify hosting.config, navigate to the Traffic Server bin directory and run the traffic_line -x command to apply your changes. When you apply the changes to a node in a cluster, Traffic Server automatically applies the changes to all other nodes in the cluster.

IMPORTANT: The volume.configuration must be the same on all nodes in a cluster.

Format

Each line in the hosting.config file must have one of the following formats:

hostname= hostname partition= partition_numbers
domain= domain_name partition= partition_numbers

where hostname is the fully-qualified hostname of the origin server whose content you want to store on a particular partition (for example, www.myhost.com); domain_name is the domain whose content you want to store on a particular partition(for example, mydomain.com); and partition_numbers is a comma-separated list of the partitions on which you want to store the content that belongs to the origin server or domain listed. The partition numbers must be valid numbers listed in the volume.config file.

Note: To allocate more than one partition to an origin server or domain, you must enter the partitions in a comma-separated list on one line, as shown in the example below. The hosting.config file cannot contain multiple entries for the same origin server or domain.

Generic Partition

When configuring the hosting.config file, you must assign a generic partition to use for content that does not belong to any of the origin servers or domains listed. If all partitions for a particular origin server become corrupt, Traffic Server will also use the generic partition to store content for that origin server.

The generic partition must have the following format:

hostname=* partition=partition_numbers

where partition_numbers is a comma-separated list of generic partitions.

Examples

The following example configures Traffic Server to store content from the domain mydomain.com in partition 1 and content from www.myhost.com in partition 2. Traffic Server stores content from all other origin servers in partitions 3 and 4.

domain=mydomain.com partition=1
hostname=www.myhost.com partition=2
hostname=* partition=3,