Ticket #104 (closed 总结: fixed)

Opened 14 years ago

Last modified 14 years ago

memcached 配置中空格引发的血案

Reported by: chenchongqi Owned by:
Priority: major Milestone: 2012报价库5.0
Component: 产品库 Version: 报价库5.0
Keywords: xindex,memcached Cc:
Due Date:

Description

xindex服务端在线上部署后,测试应用连过去总是出问题,看服务端的日志是:connection reset by xxxx

手动telent过去,发了个指令发现服务端响应正常,再联想connection reset异常应该是对方主动断开连接,也就是说应该是应用端mc客户端的问题。先看日志是memcacheclient在get的时候就出错了,没有拿到object。

xindex也是用mc协议和mc客户端的,一开始怀疑是mc客户端jar包的问题,对比了报价库线上的jar包又是ok的,反编译来看也正常,最后火青同学发现是xindex.properties里服务器的配置后面多了个空格:

xindex.servers=192.168.74.31:11311 

在本地特意加了个空格试了一下,果然也是会失败:

[2012/04/13 09:10:03.296] WebApp[http://localhost:8002] Initializing Spring root
 WebApplicationContext
com.schooner.MemCached.SchoonerSockIOPool Fri Apr 13 09:10:08 CST 2012 - ++++ fa
iled to get SockIO obj for: 192.168.74.31:11311
com.schooner.MemCached.SchoonerSockIOPool Fri Apr 13 09:10:08 CST 2012 - ++++ fa
iled to create connection to: 192.168.74.31:11311  -- only 0 created.

可以看见启动的时候sockpool初始化就失败了,希望大家以后memcached和xindex这个配置都注意这一点。

Change History

comment:1 Changed 14 years ago by chenchongqi

  • Status changed from new to closed
  • Resolution set to fixed
  • Type changed from Bug to 总结
Note: See TracTickets for help on using tickets.