如何设置Cassandra (>2.0) JVM堆大小为8 8GB?当我输入free -m时,它会给我以下信息。如何将Cassandra JVM堆大小设置为8 8GB?
total used free shared buffers cached
Mem: 16047 11336 4711 0 81 5814
-/+ buffers/cache: 5441 10606
Swap: 0 0 0发布于 2016-01-12 22:16:51
如文档的Tuning Java resources部分所述:
如果您决定更改Java大小,应该在conf/cassandra-env.sh中同时设置MAX_HEAP_SIZE和HEAP_NEWSIZE。
在cassandra-env.sh中,搜索下面这一行:
#MAX_HEAP_SIZE="4G"代码中的这一行发生在MAX_HEAP_SIZE计算之后,因此它作为覆盖。将其取消注释,并相应地进行设置。
MAX_HEAP_SIZE="8G"在超过8G时要小心。有关调优JVM的指导,我推荐使用Amy Tobey's Cassandra 2.1 Tuning Guide。她提供了一些调整内容管理系统的技巧,以及关于实现新的G1GC的一个很好的部分。
发布于 2018-06-05 23:44:19
cassandra-env.sh 更新
删除/注释掉整个calculate_heap_sizes()函数
cassandra
的原因。
使用$MAX_HEAP_SIZE删除/注释掉其他行。
这一行的开头是:“ calcuate
”
将MAX_HEAP_SIZE设置为新值。例如:16G
操作的唯一位置
重新启动
另请参阅另一个示例:https://medium.com/@mlowicki/move-cassandra-2-1-to-g1-garbage-collector-b9fb27365509
https://stackoverflow.com/questions/34745419
复制相似问题