一般来说,出现
net.rubyeye.xmemcached.exception.MemcachedException: There is no available connection at this moment
的原因,要么就是接入的memcached服务不存在,另外可能还有一个原因:启动memcached服务的方式有问题.
在出现这个问题前,我启动服务的方法如下:
./memcached -d -m 128 -u root -l localhost -p 12000 -c 1024 -P /tmp/memcached.pid
一直都是报no available connection的错误,后来把localhost换成memcached服务的 IP地址就可以了,虽然不太懂,这里记录一下。
./memcached -d -m 128 -u root -l 192.168.0.126 -p 12000 -c 1024 -P /tmp/memcached.pid