Rate This Document
Findability
Accuracy
Completeness
Readability

Deploying the Cache Node

Deploying the Nginx Proxy

For details about how to use and deploy Nginx, see Nginx Porting Guide. This section describes only the related settings.

  1. Edit the nginx.conf configuration file to set the port number to the LVS access port number.
    1. Open nginx.conf.
      vim /usr/local/nginx/conf/nginx.conf 
    2. 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.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  2. Specify the configuration file to start Nginx.
    1
    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    

Deploying ATS

  • For details about how to use and deploy ATS, see ATS 8.0.5 Porting Guide. This section describes only the related settings.
  • Before starting the ATS, you need to modify the related configuration files in the /opt/trafficServer/etc/trafficserver directory.
  1. To to the /opt/trafficServer/etc/trafficserver directory.
    1
    cd /opt/trafficServer/etc/trafficserver
    
  2. Modify the remaps.config file.
    1. Open remaps.config.
      1
      vim remap.config
      
    2. 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/
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Modify the cache.config file.
    1. Open cache.config.
      1
      vim cache.config
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Modify the storage.config file.
    1. Open storage.config.
      1
      vim storage.config
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Grant the read and write permission.
    1
    chmod a+rw /dev/sdd
    
  6. Start the ATS.
    1
    trafficserver 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.