java – 如何在Solr 4.0中自动删除事务日志文件?

在Solr 4.0中,在添加文档时创建事务日志文件.提交文档后,该位置中存在事务日志文件.如果事务日志文件大小很大并且提交的事务日志文件占用了不必要的空间.如何删除已提交的事务日志文件,如果不再使用它也将自动删除?

是否有任何配置来设置事务日志的最大大小?如果是这样,一旦达到事务日志文件的最大大小,是否将创建新的事务日志文件?

最佳答案 从这个问题 –
Solr Transaction Log Question,在Solr用户邮件列表上:

Q: How large will the transaction log grow, and how long should it be kept around?

A: We keep around enough logs to satisfy a minimum of 100 updates
lookback. Unneeded log files are deleted automatically.
When a hard commit is done, we create a new log file (since we know
the normal index files have been sync’d and hence we no longer need
the update log for durability).

发出硬提交是将事务日志保持在可管理大小的关键.您可以将Solr配置为根据时间或文档计数自动执行提交 – 有关详细信息,请参阅Solr Wiki上的Update Handler Section.

点赞