Deploying the Cache Node
Deploying the Nginx Proxy
- Edit the nginx.conf configuration file to set the port number to the LVS access port number.
- Open nginx.conf.
vim /usr/local/nginx/conf/nginx.conf
- Press i to enter the insert mode. The following figure shows the proxy configuration in the nginx.conf file.

The details are as follows:upstream http_test { server 192.168.100.206:8080; keepalive 2000; keepalive_timeout 100; keepalive_requests 20000; } upstream https_test { server 192.168.100.206:8443; keepalive 2000; keepalive_timeout 100; keepalive_requests 20000; } server { listen 10001 reuseport; ... location / { root html; index index.html index.htm ; proxy_pass http://http_test; } } server { listen 20001 ssl; ... location / { root html; index index.html index.htm ; proxy_pass https://https_test; } }Table 1 describes some configuration items.Table 1 Configuration items Item
Description
server 192.168.100.206:8080;
Specifies the IP address and HTTP port number of the ATS (HTTP forwarding configuration).
server 192.168.100.206:8443;
Specifies the IP address and HTTPS port number of the ATS (HTTPS forwarding configuration).
listen 10001 reuseport;
Specifies the HTTP port number of Nginx.
proxy_pass http://http_test;
Specifies the Nginx forwarding configuration.
listen 20001 ssl;
Specifies the HTTPS port number of Nginx.
proxy_pass https://https_test;
Specifies the Nginx forwarding configuration.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open nginx.conf.
- Specify the configuration file to start Nginx.
1/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Deploying ATS
- To to the /opt/trafficServer/etc/trafficserver directory.
1cd /opt/trafficServer/etc/trafficserver
- Modify the remaps.config file.
- Open remaps.config.
1vim remap.config - Press i to enter the insert mode and add the configuration of the specified origin server IP address and port number.
map / http://192.168.100.216:80/
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open remaps.config.
- Modify the cache.config file.
- Open cache.config.
1vim cache.config - Press i to enter the insert mode and configure the origin website and cache time.
dest_domain=192.168.100.216 ttl-in-cache=2h
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open cache.config.
- Modify the storage.config file.
- Open storage.config.
1vim storage.config - Press i to enter the insert mode and configure the drive cache. ATS supports the configuration of directories or raw drives.
Configure either a directory or a raw drive.
- Configure a directory.
var/trafficserver 20G
- Configure a raw drive such as an SSD.
/dev/sdd 20G
- Configure a directory.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open storage.config.
- Grant the read and write permission.
1chmod a+rw /dev/sdd
- Start the ATS.
1trafficserver start
If Starting Apache Traffic Server: [OK] is displayed, the ATS is started successfully.
Related commands:
- trafficserver start: starts the trafficserver.
- trafficserver stop: stops the trafficserver.
- trafficserver restart: restarts the trafficserver.
- traffic_top: shows trafficserver cache information.
Parent topic: Component Deployment