Ticket #91 (closed 需求: fixed)
xindex定时任务
| Reported by: | chenchongqi | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2012报价库5.0 |
| Component: | 报价库 | Version: | 报价库5.0 |
| Keywords: | xindex | Cc: | |
| Due Date: |
Description (last modified by chenchongqi) (diff)
- 生成文件部分
- 两个任务:增量同步、全同步
- 本地检查文件
- 分发到索引服务器
- 更新索引部分
- 更新本地索引文件 ant -buildfile server.xml flush
- 检测服务状态 ant -buildfile server.xml check-index
- 安装
- 安装ant 1.8
- copy mail-1.4.jar到ant_home/lib
- 配置server.xml中相关属性:
<property name="index" location="index"/> <property name="work" location="work"/> <property name="indexbackup" location="indexbackup"/> <property name="mail-server" value="192.168.11.232"/> <property name="mail-port" value="25"/> <property name="mail-user" value="abc@pconline.com.cn"/> <property name="mail-passwd" value="abc"/> <property name="mail-list" value="chenchongqi@pconline.com.cn"/>
Attachments
Change History
comment:4 Changed 14 years ago by chenchongqi
ant也支持telnet的任务,不过要在ant的lib加上一个包commons-net-3.0.1.jar,脚本这样写:
<telnet server="127.0.0.1" port="11311" timeout="10"> <write>flush_all</write> <read>OK</read> </telnet>
这里的<read>OK</read>表示期待从输出里读到OK,如果没有会一直等到timeout,如果只是<read/>那就是把返回读完,如果不读完这里会卡住。
但是telnet任务没有failonerror属性,也就是说如果超时等会直接退出ant流程,没得设输出变量值给后续使用,这样后面就没法发警告邮件等处理了,所以这个任务里直接用exec来执行指令代替真正的telnet任务。
Note: See
TracTickets for help on using
tickets.
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)
