Vivek Sadh
Vivek Sadh

Reputation: 4268

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 ?

Upvotes: 4

Views: 6527

Answers (2)

Mobility
Mobility

Reputation: 3305

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

Upvotes: 1

Tim Bish
Tim Bish

Reputation: 18366

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.

Upvotes: 4

Related Questions