【问题标题】:timeout index not present on ravendbravendb 上不存在超时索引
【发布时间】:2014-08-06 07:14:01
【问题描述】:

tl;博士:

  • 我的 web api 服务运行缓慢,添加了日志记录
  • 日志记录给了我关于无法找到超时的错误
  • 在服务器上没有看到 webapi 项目的 ravendb 数据库,但是开发机器有它
  • raven 在 8080 上运行并运行
  • 尝试通过平台安装程序重新安装nservicebus(昨天从nservicebus下载)
  • 还是有同样的问题
  • 我想我要么搞砸了部署,要么我需要以某种方式进行全新安装
  • 我需要做什么才能让 webapi 项目读取超时?

我正在尝试让我们的应用程序在生产机器上运行,为 Alpha 版做准备。
我们的应用程序有多个 web api 站点和许多服务主机。

我看到的错误目前在 web api 主机中仅在生产中

2014-08-06 01:55:24,789 [52] DEBUG NServiceBus.Timeout.Hosting.Windows.TimeoutPersisterReceiver [(null)] - Polling for timeouts at 08/06/2014 01:55:24.
2014-08-06 01:55:24,793 [46] WARN  NServiceBus.Timeout.Hosting.Windows.TimeoutPersisterReceiver [(null)] - Failed to fetch timeouts from the timeout storage

这会重复一段时间。最终(大约 2 分钟)端点放弃并死了

2014-08-06 01:57:03,645 [17] WARN  NServiceBus.CircuitBreakers.RepeatedFailuresOverTimeCircuitBreaker [(null)] - The circuit breaker for TimeoutStorageConnectivity will now be triggered
2014-08-06 01:57:03,645 [17] FATAL NServiceBus [(null)] - Repeated failures when fetching timeouts from storage, endpoint will be terminated.
System.InvalidOperationException: There is no index named: dynamic/TimeoutData

我通过为 nservicebus 启用 log4net 文件附加程序来获取这些日志,以了解 Web api 服务发生了什么。

主机服务在我们的开发机器上运行良好,但出于某种原因,它们在生产机器上运行速度很慢。我们在开发机器上看不到错误。我们在生产机器上安装了许可证,所以它不像我们受到过期许可证的限制。

奇怪的是,在我们的开发机器上,我们看到了我们的 web api 项目的数据库,但在生产机器上,只有安装的服务主机有数据库条目。

我们已经为这个特定的应用程序开发了大约 18 个月。可能是我们在安装 nservicebus 时,没有设置安装超时。但是,我尝试运行平台安装程序(昨天下载)并且超时仍然不存在。我假设当我安装服务主机时,超时会被安装,但由于某种原因它们没有出现。

此时我正在考虑卸载 nservicebus 和 ravendb,但我不确定如何重新安装。

这是我 global.asax 中的一些相关行

        IContainer container = IoC.Initialize();
        DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
        GlobalConfiguration.Configuration.DependencyResolver = new StructureMapDependencyResolver(container);

        Configure.Transactions.Enable();
        Configure.Serialization.Json();

        Configure.With()
            .DefiningEventsAs(t => t.Namespace != null && t.Namespace.Contains(".Events"))
            .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.Contains(".Commands"))
            .StructureMapBuilder(container)
            .Log4Net()
            .UseTransport<Msmq>()
            .UnicastBus()
            .CreateBus()
            .Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());

【问题讨论】:

  • 这对我来说不再是问题,因为我升级到 NSB 5 并使用 mongo db 而不是 raven。在我们进行切换之前,我们认为这可能是权限问题。

标签: asp.net-web-api nservicebus4


【解决方案1】:

要解决此问题,请执行以下步骤

  • 打开RavenDB控制面板,通常位于http://RAVEN_DB_SERVER:8080
  • 选择端点的数据库
  • 转到索引选项卡
  • 点击删除所有索引

一旦服务端点启动,索引就会重新创建。

【讨论】:

    【解决方案2】:

    您的生产环境中似乎没有安装 Raven。

    安装说明请take a look here

    HTH

    【讨论】:

    • Raven 正在我的生产机器上运行,正如我在 OP 中指出的那样,我看到了我的 nservicebus 主机服务的主机数据库,而不是 webapi 服务的主机数据库。
    • raven 在你的 web api 服务的机器上运行什么端口?它们都在同一台机器上运行吗?你运行的是什么版本的 NServiceBus?你有 Endpoint 启动的日志吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多