chn*_*net 1 sockets file cassandra
我在双节点(A
和B
)集群上使用了cassandra 0.6.5 .
Hector
在客户端使用.
一个节点在运行一段时间后A
总是有too many open files exception
.
我netstat
在节点上运行.
它显示了很多CLOSE_WAIT
tcp连接.
这是例外的罪魁祸首.
但是,导致这么多CLOSE_WAIT
连接的原因
是客户端Hector
问题吗?
为什么其他节点B
没有这个问题?
不要使用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.