【问题标题】:Apache ActiveMQ Apollo: Virtual host stoppedApache ActiveMQ Apollo:虚拟主机停止
【发布时间】:2012-07-05 22:29:21
【问题描述】:

在 Windows Server 2008 R2 上运行 Apollo 1.3 时遇到问题。我正在从 Web 应用程序(使用 stomp-php 的 PHP)发送 STOMP 消息,然后使用作为 Windows 服务运行的应用程序处理这些消息。这可以正常工作一段时间,但出乎意料的是,我在向 Apollo 推送消息时收到以下错误:“虚拟主机已停止”。

Apollo 仍在运行,我什至可以从 Web 界面访问虚拟主机。让它再次运行的唯一方法(到目前为止我发现)是停止服务删除代理数据文件夹中的所有内容并再次启动服务。简单地重启服务是行不通的。

这是来自 apollo.log 的 sn-p:

| WARN  | DB operation failed. (entering recovery mode): java.io.FileNotFoundException: C:\apache-apollo-1.3\mybroker\data\dirty.index\MANIFEST-000004 (Das System kann die angegebene Datei nicht finden) | org.apache.activemq.apollo.broker.store.leveldb.LevelDBClient | leveldb store io write
...
| WARN  | Could not recover snapshot of the index: java.io.IOException: Der Prozess kann nicht auf die Datei zugreifen, da ein anderer Prozess einen Teil der Datei gesperrt hat | org.apache.activemq.apollo.broker.store.leveldb.LevelDBClient | leveldb store io write

这些是我能找到的唯一例外。

我认为这是配置错误而不是代码问题,但这里是相关代码sn-p:

$stomp = new \FuseSource\Stomp\Stomp('tcp://127.0.0.1:61613');
$stomp->connect('admin', 'password');

$message = array():

$stomp->send('/queue/messages', json_encode($message));

我猜这是在虚拟主机处于非活动状态(即没有收到消息,没有连接)一段时间后触发的。因此,我正在考虑不时重启 apollo-broker 以防止触发,但我不确定这是否真的是触发虚拟主机停止的原因。

谁能告诉我为什么虚拟主机突然停止以及我需要进行哪些配置更改以防止这种情况发生?我已经searched in the documentation,但没有找到有关虚拟主机生命周期或类似内容的任何信息。

【问题讨论】:

  • 代理的日志文件有异常吗?
  • @HiramChirino 抱歉,回答延迟。我用错误日志中的 sn-ps 更新了我的问题。还有一个警告:Using the pure java LevelDB implementation which is still experimental. If the JNI version is not available for your platform, please switch to the BDB store instead. 我会按照这个建议,希望它能解决问题。
  • 到目前为止,是的。但我还不确定,因为我在 3 个月内只遇到过两次问题。我想尝试几个星期,然后才称它已解决。我打算编写一个单元测试来模拟来自多个客户端的繁重工作负载,但还没有时间,而且优先级很低,所以我不确定在错误再次触发之前是否能解决它。
  • 进展如何?现在稳定了吗?
  • @HiramChirino 是的,它现在就像一个魅力。如果你愿意,你可以写一个答案,我会标记为已解决。

标签: activemq message-queue php-5.3 stomp apollo


【解决方案1】:

鼓励 Apollo 1.3 的用户重新配置服务器以使用 BDB,因为这样更稳定。 Apollo 甚至会在启动时记录一条消息让您知道这一点:

Using the pure java LevelDB implementation which is still experimental. If 
the JNI version is not available for your platform, please switch to the BDB 
store instead.

现在,最近 Apollo 1.5 发布,支持 Windows 上的 JNI 版本的 leveldb。因此,如果您想升级到 1.5,那也应该可以解决问题。

【讨论】:

    猜你喜欢
    • 2019-10-01
    • 2011-06-19
    • 2019-08-25
    • 2012-04-26
    • 2012-09-25
    • 2011-03-25
    • 2018-06-26
    • 2015-12-30
    • 2015-08-26
    相关资源
    最近更新 更多