2016-09-28 75 views
1

我正在使用NServiceBus 5.2.16,我遇到了审计日志清理问题。在ServiceControl管理实用程序中,审核保留期限设置为30天。但是,RavenDB数据库每天都在不断增长,并且在ServiceInsight中,我可以看到超过30天的成功消息,因此我怀疑旧消息不会从数据库中删除。我能做些什么来限制NServiceBus RavenDB数据库的大小?NServiceBus审计清理不起作用

+0

但是,您是否可以尝试更新ServiceControl并将其更新到最新版本? http://particular.net/downloads –

+0

我已经在使用最新版本(1.23)。我就此问题联系了特别支持。一旦我从他们那里获得任何信息,我会发布更新。 –

+0

我也注意到使用最新版本的这个问题。 – Kye

回答

1

我设法通过删除整个Raven数据库并重新启动ServiceControl来解决此问题。这创建了一个新的数据库,之后,旧的审计条目被ServiceControl正确删除。

我确实从特定的支持获得了一些有用的信息。您可以通过ServiceControl.exe.config文件中的设置来控制审计清理过程。特别是,ServiceControl/ExpirationProcessTimerInSecondsServiceControl/ExpirationProcessBatchSize设置很有用,因为它们允许您更频繁地安排清理过程或增加每批中删除的项目的最大数量。您可以在NServiceBus documentation中找到有关这些设置的更多详细信息。

此外,您可以监视ServiceControl的日志文件中的清理过程。但是,首先您需要将日志记录详细程度提高到至少Info。这可以使用ServiceControl.exe.config文件中的ServiceControl/LogLevel设置完成。更改日志级别后,您应该在ServiceControl的Logs目录中的文件中看到类似于下面的日志条目。

2016-10-26 09:49:06.2652|77|Info|ServiceControl.Infrastructure.RavenDB.Expiration.SagaHistoryCleaner|Batching deletion of 0-499 sagahistory documents completed. 
2016-10-26 09:49:06.2808|77|Info|ServiceControl.Infrastructure.RavenDB.Expiration.SagaHistoryCleaner|Batching deletion of 500-715 sagahistory documents. 
2016-10-26 09:49:06.4996|77|Info|ServiceControl.Infrastructure.RavenDB.Expiration.SagaHistoryCleaner|Batching deletion of 500-715 sagahistory documents completed. 
2016-10-26 09:49:06.4996|77|Info|ServiceControl.Infrastructure.RavenDB.Expiration.SagaHistoryCleaner|Deleted 716 expired sagahistory documents. Batch execution took 11635ms 
2016-10-26 09:49:06.4996|77|Info|ServiceControl.Infrastructure.RavenDB.Expiration.ErrorMessageCleaner|No expired error documents found