原由
在开发过程中,意外发现下面的TS API接口在ats 4.1.2上没有定义,但在5.3.x中有定义
bool cacheable = TSHttpTxnIsCacheable(txnp, NULL, response);
遂决定在工作机ThinkPad上升级ATS到5..3.2版本.下面记录了我升级过程和遇到问题并解决的过程.
全新安装请参见ats 4.2.1版本
http://blog.csdn.net/tao_627/article/details/18953131
1.安装依赖
因为原来是ats 4.1.2,现在属于升级,这步跳过。
2.配置,编译和安装
./configure --with-group=nogroup --enable-reclaimable-freelist --enable-debug --enable-experimental-plugins
make -j 4
make install -j 4
如果是ats 6.1.1版本,去掉--enable-reclaimable-freelist参数, 因为相应的模块已经被去掉了.其它的步骤下面完全相同.
3.配置
对几个配置文件做如下修改
在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 http://10.10.110.55:8081/cache/ http://{cache}:8081
map http://localhost/www.17dao.com http://www.17dao.com
增加logs_xml.config日志配置文件
% % % [%] %<{X-Forwarded-For}cqh> "%" % "%" %:% %<{Referer}cqh> "%<{User-Agent}cqh>" %"/>
4.踩坑实录
开启ats服务时,发现没有traffic_cop进程

单独gdb打开时,显示个别动态库加载失败

但是,我发现这个库已经存在在指定目录下面, 进一步分析如下

这说明是动态库造成的问题.因为更新或新增了动态库,但是没有更新系统的动态库信息, 所以导致了上面的错误.
解决方法
确认存在该动态库, 并确保在/etc/ld.so.conf中可以找到, 然后ldconfig更新一下动态库的索引信息就可以了.
再次打开ats服务
sudo trafficserver start
我们看到这时有3个进程了

为验证ats的功能正常, 取一个url下载测试一下,发现一切正常

至此, ats成功升级到5.3.2版本了.下面是ats 6.1.1的截图


参考文献
[1].https://cwiki.apache.org/confluence/display/TS/Ubuntu