[Cassandra] Increase RLIMIT_MEMLOCK for cassandra

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wawa8899/article/details/79956296

环境:

CentOS6.5

Cassnadra3.10

 

问题:Cassandra WARN级别日志

WARN  [main] 2018-04-11 13:32:51,296 CLibrary.java:178 - Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out, especially with mmapped I/O enabled. Increase RLIMIT_MEMLOCK or run Cassandra as root.

WARN  [main] 2018-04-11 13:32:51,296 CLibrary.java:178 - Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out, especially with mmapped I/O enabled. Increase RLIMIT_MEMLOCK or run Cassandra as root.

我的Cassandra是以cassandra用户运行的,不是root,按照WARN提示将RLIMIT_MEMLOCK增大。

 

问题解决:

步骤一: 修改limits.conf

vi /etc/security/limits.conf

写入

cassandra - memlock unlimited
cassandra - nofile 100000
cassandra - nproc 32768
cassandra - as unlimited

其中,cassandra是我运行cassandra服务的用户名。

 

步骤二: 修改90-nproc.conf

vi /etc/security/limits.d/90-nproc.conf

写入

cassandra - nproc 32768

步骤三: 修改 sysctl.conf

vi /etc/sysctl.conf

写入

# Increase RLIMIT_MEMLOCK for cassandra
vm.max_map_count = 1048575

 

步骤四:让配置生效

 

sysctl -p

步骤五:重启cassandra服务

步骤六:查看修改后的参数已经生效

cat /proc/cassandra_pid/limits

其中,cassandra_pid为cassandra服务的进程id
 

 

其他操作系统配置参考官方文档:https://docs.datastax.com/en/dse-trblshoot/doc/troubleshooting/insufficientResources.html

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页