Reputation: 11
I'm currently experiencing the following problem on my productions solr slaves servers, Solr keeps retaining disk space, even if we can't actually see which file is holding onto this space and what I need to do to solve the issue is to restart solr every day, which to be honest is not really ideal.
We think is something to do with the way log4j does the log rotation, it seems like that when the actual log file is rotated solr is leaving some kind of thread open and that thread is continuously writing on the log file.
this is the log4j.properties as of now:
solr.log=logs/
log4j.rootLogger=INFO, file, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x \u2013 %m%n
#- size rotation with log cleanup.
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.MaxFileSize=4MB
log4j.appender.file.MaxBackupIndex=9
#- File to log to and log format
log4j.appender.file.File=${solr.log}/solr.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %C; %m\n
log4j.logger.org.apache.zookeeper=WARN
log4j.logger.org.apache.hadoop=WARN
# set to INFO to enable infostream log messages
log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF
Looking at the files in the filesystem they are all 4MB big, so not sure where the space I'm missing is.
has anyone experienced a similar issue? or has any idea where I could start looking at?
Solr is running as standalone on jetty.
Thanks
Upvotes: 1
Views: 1524
Reputation: 200453
I suspect that the console log is eating up your disk space. Check the size of the file (presumably $SOLR_INSTALL_DIR/logs/solr-*-console.log
).
The setting
log4j.rootLogger=INFO, file, CONSOLE
in log4j.properties
specifies that INFO level messages are logged to both file and console appender, but unlike the file appender the console log is never rotated.
Change the default log level to WARN:
log4j.rootLogger=WARN, file, CONSOLE
and increase the log level only for appenders where you want higher verbosity:
log4j.appender.file.Threshold=INFO
Upvotes: 1