首页 > 其他分享 >Cassandra2.0 JNA配置

Cassandra2.0 JNA配置

时间:2023-07-13 21:04:43浏览次数:38  
标签:log Cassandra2.0 配置 JNA JVM cassandra Cassandra


Cassandra中通过JNA可以调用Native方法优化Jvm内存,大概意思就是不让操作系统将jvm内存置换到系统swap分区,从而提升jvm内存性能。它有两个用处:

 

  • Since 0.6.2: JNA for mlockall. This prevents Linux from swapping out parts of the JVM that aren't accessed frequently. Chris Goffinet reported a 13% performance improvement in his tests from this change. CASSANDRA-1214
  • Since 0.6.6: JNA for hard links, improving snapshots. Previously Cassandra would use the /bin/ln binary to create hard links to SSTables when creating a snapshot. On nodes with thousands of SSTables, this would take a very long time, because it had to fork+exec the JVM to run the new process. With JNA, Cassandra uses the link call directlyCASSANDRA-1371

P.S. JNA配置不是必须的,但官方建议生成环境下使用JNA。

 

我的软件环境:CentOS6 64bit + Cassandra2.0(DataStax社区版,通过YUM安装的)

 

开启方法如下:

 

1. 下载并放置JNA



cp jna-4.0.0.jar /usr/share/cassandra/lib/



 

2. 开启JNA

 



vi /etc/security/limits.d/cassandra.conf

cassandra soft memlock unlimited
cassandra hard memlock unlimited



注意: 通过yum安装的dsc是通过cassandra用户启动的,所以我配置上面为cassandra用户。

 

3. 验证安装

如果没有配置JNA,cassandra log将会打印如下信息:

 



INFO 12:17:58,616 JNA not found. Native methods will be disabled.



 

 配置成功后,会出现如下log:



INFO 09:59:59,184 JNA mlockall successful



 

4. 错误诊断

将JNA jar包放置后,但如果没有配置好系统limit的话,将会出现如下log:



WARN 10:49:53,587 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.



 完成步骤2配置,就可以解决这个警告。

 


 

 

标签:log,Cassandra2.0,配置,JNA,JVM,cassandra,Cassandra
From: https://blog.51cto.com/u_16187922/6715616

相关文章

  • Tomcat中配置自定义404错误页面
    (1)%CATALINA_HOME%\conf\web.xml中web-app节点中添加<error-page><error-code>404</error-code><location>/404.html</location></error-page>在webapps下ROOT新增404.html页面<htmllang="en"><head&g......
  • ngnix配置
    centos的nginx配置在/usr/share/nginx/htmlUbuntu的nginx配置在/var/www/html 参考资料:https://gitee.com/sqqdcl/downloadd/wikis/pages?sort_id=5893382&doc_id=2890189......
  • centos下配置静态ip连接互联网
     1.修改成静态ip[root@localhostnetwork-scripts]#moreifcfg-enp0s3TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MO......
  • Nacos基本配置
    Nacos官方文档为什么需要服务注册中心?微服务时代的服务管理在微服务时代,我们所有的服务都被劲量拆分成最小的粒度,原先所有的服务都在混在1个server里,现在就被按照功能或者对象拆分成N个服务模块,这样做的好处是深度解耦,1个模块只负责自己的事情就好,能够实现快速的迭代更新。坏处......
  • minio 配置https访问
    官网文档:https://docs.min.io/docs/how-to-secure-access-to-minio-server-with-tls.html在${HOME}.minio/certs文件夹下1、生成私钥opensslgenrsa-outprivate.key20482、生成自签名证书创建一个以openssl.conf以下内容命名的文件。设置IP.1和/或DNS.1指向正确的IP/DNS......
  • nginx安装及配置
    ......
  • nginx部署 vue3 同时 配置接口代理(详细)
    Vue项目配置.env文件在项目根目录下创建文件夹(.env.production)##.env.production生产环境配置VUE_APP_SYS_URL=sysapi##nginx需要用的的代理表示VUE_APP_MODE=product##模式baseUrl使用VUE_APP_SYS_URL变量代替Nginx下载部署和配置api代理Nginx下载......
  • Archlinux安装和配置fcitx5
    本文基于archlinux系统,搭配dwm窗口管理器进行配置fcitx5安装一些基础包的安装,关于fcitx5框架我们只需要安装fcitx5-im包就可以,这个包实际上就包含了:fcitx5fcitx5-configtoolfcitx5-gtkfcitx5-qt除此之外再安装中文插件和基本的主题sudopacman-Sfcitx5-imfcitx5-chin......
  • java项目配置druid监控页面
    druid监控页面如图: 满足条件:1.项目引入了druid相关的jar包 2.项目加入druid相关的配置#####druid监控#####WebStatFilter配置spring.datasource.druid.web-stat-filter.enabled=truespring.datasource.druid.web-stat-filter.url-pattern=/*spring.datasource.......
  • Asp.net core中的配置提供程序和读取
    ASP.NETCore中的应用程序配置是使用一个或多个配置提供程序执行的。配置提供程序使用各种配置源从键值对读取配置数据:设置文件,例如appsettings.json环境变量AzureKeyVaultAzure应用程序配置命令行参数已安装或已创建的自定义提供程序目录文件内存中的.NET对象......