Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete kahaDB logs

There are many kahaDB logs which are not clearing up. Is it safe to clear old "data-< id >-log" files ? Shall I restart activeMQ or redeploy app after manually deleting kahaDB files ?

like image 923
Vivek Sadh Avatar asked Oct 17 '25 22:10

Vivek Sadh


2 Answers

No. It is not safe to simply go into the KahaDB logs and start deleting them, these logs are where your messages and other runtime broker information is stored. The logs are also used if the index files become corrupted to replay and recover broker state. Removing old logs can mean you cannot recover from disk corruption etc.

What you need to do is to determine why you have such a growth of journal files. There are a number of reasons that this can happen and the solution differs based on what the cause is. You can do some debug yourself to get some answers on what is keeping old logs alive by reading the documentation on this topic.

like image 199
Tim Bish Avatar answered Oct 19 '25 12:10

Tim Bish


I sugest you to find out why your kahadb file not cleared at first. By adding this log config to log4j.properties. Then you can see exactly what is holding kahadb files in kahadb.log.

log4j.appender.kahadb=org.apache.log4j.RollingFileAppender 
log4j.appender.kahadb.file=${activemq.base}/data/kahadb.log 
log4j.appender.kahadb.maxFileSize=1024KB 
log4j.appender.kahadb.maxBackupIndex=5
log4j.appender.kahadb.append=true
log4j.appender.kahadb.layout=org.apache.log4j.PatternLayout 
log4j.appender.kahadb.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1}    - %m%n 
log4j.logger.org.apache.activemq.store.kahadb.MessageDatabase=TRACE, kahadb
like image 36
Mobility Avatar answered Oct 19 '25 11:10

Mobility



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!