Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

起因

開發時發現一個 TS API 在 ATS 4.1.2 上根本沒有定義,但 5.3.x 已經有了:

bool cacheable = TSHttpTxnIsCacheable(txnp, NULL, response);

於是決定把工作日知機 ThinkPad 上的 ATS 從 4.1.2 升到 5.3.2,順帶記錄整個過程與解法。全新安裝可參考 ATS 4.2.1 的相關文章:https://blog.csdn.net/tao_627/article/details/18953131

一、安裝相依

因為原本是 4.1.2、屬於升級而非全新安裝,這一步跳過。

二、設定、編譯、安裝

./configure --with-group=nogroup --enable-reclaimable-freelist \\
 --enable-debug --enable-experimental-plugins
make -j 4
make install -j 4

若是 6.1.1 版本,要去掉 --enable-reclaimable-freelist,因為對應模組已被移除,其餘步驟完全相同。

三、設定檔調整

records.config 中需要(沒有的選項直接加上):

CONFIG proxy.config.http.server_ports STRING 8081
CONFIG proxy.config.http.insert_request_via_str INT 1
CONFIG proxy.config.http.insert_response_via_str INT 2
CONFIG proxy.config.log.custom_logs_enabled INT 1
CONFIG proxy.config.log.squid_log_enabled INT 0
CONFIG proxy.config.log.xml_config_file STRING logs_xml.config
CONFIG proxy.config.reverse_proxy.enabled INT 0
CONFIG proxy.config.url_remap.pristine_host_hdr INT 0
CONFIG proxy.config.url_remap.remap_required INT 0

remap.config 中加入映射規則:

map https://10.10.110.55:8081/cache/ https://{cache}:8081
map https://localhost/www.17dao.com https://www.17dao.com

新增 logs_xml.config:

<LogFormat>
 <Name = "access"/>
 <Format = "%<cqtq> %<ttms> %<pssc> %<sssc> [%<cqtt>] %<{X-Forwarded-For}cqh> \\
  \"%<cqtx>\" %<psql> \"%<pqsi>\" %<crc>:%<phr> %<{Referer}cqh> \\
  \"%<{User-Agent}cqh>\" %<psct>"/>
</LogFormat>
<LogObject>
 <Format = "access"/>
 <Filename = "access"/>
</LogObject>

四、踩坑:traffic_cop 起不來

啟動服務後發現沒有 traffic_cop 行程。

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

用 gdb 單獨打開時,顯示某個動態庫載入失敗。

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

但那個庫明明就在指定目錄下,繼續往下查:

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

結論很清楚:問題出在動態庫本身。因為新增或更新了動態庫,卻沒有更新系統的動態庫索引資訊。

解法:確認該庫存在、且 /etc/ld.so.conf 能找到它,然後執行 ldconfig 更新索引即可。

再次啟動:sudo trafficserver start,這次能看到 3 個行程了。

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

抓一個 URL 下載測試,一切正常。

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

至此 5.3.2 升級完成。以下是 6.1.1 的截圖:

Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄Ubuntu 14.04 64 位升級 ATS 5.3.2/6.1.1 踩坑實錄

參考文獻:https://cwiki.apache.org/confluence/display/TS/Ubuntu

Copyright © Linux教程網 All Rights Reserved