Traffic Server Administration¶
Installing Traffic Server¶
Build the Traffic Server RPM. The best way to do this is to follow the Apache Traffic Server documentation.
Build the astats RPM using the appropriate version number - ours are built here
astatsplugin is bundled as a part of Apache Traffic Server as of version 7.2.
Install Traffic Server and astats
yum -y install trafficserver-*.rpm astats_over_http*.rpm
Add the server using the Traffic Portal UI:
Click on the + button at the top of the page.
Complete the form. Be sure to fill out all fields marked ‘Required’
- Set ‘Interface Name’ to the name of the network interface device from which Apache Traffic Server delivers content.
- Set ‘Type’ to ‘MID’ or ‘EDGE’.
- If you wish for the server to immediately be polled by the Health Protocol, set ‘Status’ to ‘REPORTED’.
Click on the Create button to submit the form.
Verify that the server status is now listed as Reported
Install the ORT script and run it in ‘BADASS’ mode to create the initial configuration
systemctl start trafficserver
(Optional) Configure ATS to start automatically when the system powers on
systemctl enable trafficserver
Verify that the installation is working
Make sure that the service is running
systemctl status trafficserver
Assuming a Traffic Monitor is already installed somewhere, check the “Cache States” table in its Web UI to verify that the ATS server appears.
Configuring Traffic Server¶
All of the ATS application configuration files are generated by Traffic Ops and installed by ORT. The
traffic_ops_ort.pl file should be installed on all cache server s (See Installing the ORT Script), usually in
/opt/ort. It is used to do the initial install of the configuration files when the cache server is being deployed, and to keep the configuration files up-to-date when the cache server is already in service.
Installing the ORT Script¶
Install modules required by ORT if needed
yum install -y perl-JSON perl-Crypt-SSLeay
For initial configuration or when major changes (like a Profile change) need to be made, run the script in “BADASS”. All required RPM packages will be installed, all ATS configuration files will be fetched and installed, and (if needed) the ATS service will be restarted.
The first run gives a lot of state errors that are expected. The “BADASS” mode fixes these issues. If you run it a second time, this should be cleaner. Also, note that many “ERROR” messages emitted by ORT are actually information messages. Do not panic.
By default, running ORT on an Edge-tier cache server will cause it to first wait for its parents (usually Mid-tier cache server s) to download their configuration before downloading its own configuration. Because of this, scheduling ORT for running every 15 minutes (with 5 minutes default dispersion) means that it might take up to ~35 minutes for queued updates to affect all cache server s. To customize this dispersion time, use the command line option
xis the number of seconds for the dispersion period. Servers will select a random number from within this dispersion period to being downloading configuration files from Traffic Ops. Another option,
--login_dispersion=xcan be used to create a dispersion period after the job begins during which ORT will wait before logging in and checking Traffic Ops for updates to the server. This defaults to 0. If
use_reval_pending, a.k.a. “Rapid Revalidate” is enabled, Edge-tier cache server s will not wait for their parents to download their configuration before downloading their own.
In “SYNCDS” mode, the ORT script updates only configurations that might be changed as part of normal operations, such as:
If “Rapid Revalidate” is enabled in Traffic Ops, create a second cron(8) job for revalidation checks by running ORT in “REVALIDATE” mode. ORT will not check revalidation files if “Rapid Revalidate” is enabled. This setting allows for a separate check to be performed every 60 seconds to verify if a revalidation update has been made.