cassandra太多打开的文件

chn*_*net 1 sockets file cassandra

我在双节点(AB)集群上使用了cassandra 0.6.5 .
Hector在客户端使用.

一个节点在运行一段时间后A总是有too many open files exception.
netstat在节点上运行.
它显示了很多CLOSE_WAITtcp连接.

这是例外的罪魁祸首.
但是,导致这么多CLOSE_WAIT连接的原因
是客户端Hector问题吗?
为什么其他节点B没有这个问题?

psa*_*ord 5

不要使用netstat,请尝试lsof -n | grep java.那里列出了多少个文件描述符(你可以得到一个计数lsof -n | grep java | wc -l)?

数据存储文档建议您可能达到1024的默认文件描述符限制.您可以通过ulimit或/etc/security/limits.conf更改它.Datastax建议进行以下更改:

echo "* soft nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "* hard nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "root soft nofile 32768" | sudo tee -a /etc/security/limits.conf
echo "root hard nofile 32768" | sudo tee -a /etc/security/limits.conf
Run Code Online (Sandbox Code Playgroud)

debian包设置以下值:

# Provided by the cassandra package
cassandra  -  memlock  unlimited
cassandra  -  nofile   100000
Run Code Online (Sandbox Code Playgroud)

我还强烈建议您升级到更新版本的Cassandra.