天天看點

54.2. Configure

修改配置

vi records.config

  CONFIG proxy.config.proxy_name STRING cache1 ### 修改成cache的server name即可

  CONFIG proxy.config.cluster.ethernet_interface STRING eth0 ### 修改成需要偵聽的interface名稱,預設是 null

  CONFIG proxy.config.admin.user_id STRING nobody ### 用來運作 traffic server 的使用者,預設是nobody

  CONFIG proxy.config.http.server_port INT 80 ### traffic server 偵聽的端口,預設是8080

vi cache.config

dest_domain=www.example.com scheme=http     revalidate=2h

vi remap.conf

map http://www.example.com http://10.0.0.51  #前一個是使用者通路的位址,後一個是源站點的IP,或者域名

配置變更應用生效

/srv/ts/bin/traffic_line -x

啟動服務

/srv/ts/bin/trafficserver start

./traffic_shell

show

show:cache

show:cache-stats

show:proxy-stats

./logstats -i www.example.com

如果伺服器down掉,預設會生成core檔案,在/ts

使用

ts/bin/traffic_server -c core.1234

原文出處:Netkiller 系列 手劄

本文作者:陳景峯

轉載請與作者聯系,同時請務必标明文章原始出處和作者資訊及本聲明。

下一篇: 53.5. example