防止Cassandra转储hprof文件 [英] Preventing Cassandra from dumping hprof files
问题描述
我想阻止Cassandra转储hprof文件,因为我不需要使用它们。
我也有非常有限的磁盘空间(100GB中有50GB) GB用于数据),这些文件吞噬了所有的磁盘空间,然后才能说停止。
我该怎么办呢?
是否有可以用来擦除这些文件的shell脚本?
这是因为Cassandra以 -XX:+ HeapDumpOnOutOfMemoryError
Java选项开头。如果你想分析哪个是好东西。此外,如果你得到大量的堆转储,表明你应该调整Cassandra可用的内存。
我还没试过。但要阻止此选项,请在 $ CASSANDRA_HOME / conf / cassandra-env.sh
<$ p $中注释以下行p>
JVM_OPTS =$ JVM_OPTS -XX:+ HeapDumpOnOutOfMemoryError
可选你也可以对这个区块发表评论,但我认为并不是真的需要。我猜这个版块有1.0+版本。我在0.7.3中找不到这个。
#set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
if [x $ CASSANDRA_HEAPDUMP_DIR!=x];然后
JVM_OPTS =$ JVM_OPTS -XX:HeapDumpPath = $ CASSANDRA_HEAPDUMP_DIR / cassandra -`date +%s`-pid $$。hprof
fi
如果有效,请告诉我。
更新
...我猜是当Cassandra崩溃/关闭时,JVM会抛弃它。有什么方法可以防止这种情况发生吗?
如果要完全禁用JVM堆转储,请参见此处如何在VM崩溃后禁用创建Java堆转储?
I would like to stop Cassandra from dumping hprof files as I do not require the use of them.
I also have very limited disk space (50GB out of 100 GB is used for data), and these files swallow up all the disk space before I can say "stop".
How should I go about it?
Is there a shell script that I could use to erase these files from time to time?
It happens because Cassandra starts with -XX:+HeapDumpOnOutOfMemoryError
Java option. Which is good stuff if you want to analyze. Also, if you are getting lots of heap-dump that indicate that you should probably tune the memory available to Cassandra.
I haven't tried it. But to block this option, comment the following line in $CASSANDRA_HOME/conf/cassandra-env.sh
JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError"
Optionally, you may comment this block as well, but not really required, I think. This block is available in 1.0+ version I guess. I can't find this in 0.7.3.
# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
if [ "x$CASSANDRA_HEAPDUMP_DIR" != "x" ]; then
JVM_OPTS="$JVM_OPTS -XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date +%s`-pid$$.hprof"
fi
Let me know if this worked.
Update
...I guess it is JVM throwing it out when Cassandra crashes / shuts down. Any way to prevent that one from happening?
If you want to disable JVM heap-dump altogether, see here how to disable creating java heap dump after VM crashes?
这篇关于防止Cassandra转储hprof文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!