【问题标题】:Unable to start AMQ broker with persistent store on an NFSv3 share无法在 NFSv3 共享上启动具有持久存储的 AMQ 代理
【发布时间】:2013-12-23 05:37:33
【问题描述】:

我一直在努力在 NFSv3 共享上启动具有持久存储的 AMQ 代理节点。 我不断收到以下错误,抱怨锁不可用。 在启动 AMQ 主代理之前,我已确保所有 java 进程都被杀死并删除共享文件夹上的锁定文件。

当我启动 AMQ 时,它似乎在共享文件夹上创建了一个锁文件,然后它抱怨不可用的锁。

Loading message broker from: xbean:activemq.xml
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@73cf56e9: startup date [Mon Dec 23 05:28:23 UTC 2013]; root of context hierarchy
 INFO | PListStore:[/home/pnarayan/apache-activemq-5.9.0/activemq-data/notificationsBroker/tmp_storage] started
 INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/home/y/share/nfs/amqnfs]
 INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
 INFO | Database /home/y/share/nfs/amqnfs/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: No locks available

下面是我使用的activemq xml配置文件:

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <broker 
        xmlns="http://activemq.apache.org/schema/core"
        xmlns:spring="http://www.springframework.org/schema/beans"  

    brokerName="notificationsBroker" 
    useJmx="true" 
    start="true" 
    persistent="true" 
    useShutdownHook="false" 
    deleteAllMessagesOnStartup="false">

        <persistenceAdapter>
            <kahaDB directory="/home/y/share/nfs/amqnfs" />
        </persistenceAdapter>

        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

    </broker>
</beans>

这是因为我使用的是 NFSv3,而不是 AMQ 推荐的 NFSv4 吗?

我认为 NFSv3 的问题在于,如果代理进程突然终止,它就无法清除锁。但是,在启动代理时应该没有任何问题。如果我的理解是正确的,为什么我会观察到上述错误?

【问题讨论】:

    标签: activemq


    【解决方案1】:

    你说的完全正确——NFS3 没有正确清理它的锁。使用 KahaDB 时,代理会在 $ACTIVEMQ_DATA/lock 中创建一个文件。如果该文件存在,则很可能有某些东西对其进行了保留(或者至少 NFS3 认为它确实存在)并且代理将被阻止。检查文件是否存在,如果存在,使用lsof 命令确定其持有者的进程ID。

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-18
      • 1970-01-01
      • 2012-06-24
      • 2018-01-12
      • 1970-01-01
      • 2018-09-29
      相关资源
      最近更新 更多