Activemq关闭失败,然后终止进程

Activemq关闭失败,然后终止进程,activemq,jmx,Activemq,Jmx,我正在实现复制的leveldb activemq设置。我有3个activemq实例在同一个机器上运行。我正在更改配置文件中的rmiPort、amqpport和openwire端口 类似配置的外观如下所示: <?xml version="1.0" encoding="UTF-8"?><beans xmlns=" http://www.springframework.org /schema/beans" xmlns:amq=" http://activemq.apache.o

我正在实现复制的leveldb activemq设置。我有3个activemq实例在同一个机器上运行。我正在更改配置文件中的rmiPort、amqpport和openwire端口

类似配置的外观如下所示:

   <?xml version="1.0" encoding="UTF-8"?><beans xmlns=" http://www.springframework.org /schema/beans" xmlns:amq=" http://activemq.apache.org/schema/core" 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">

<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <value>file:${activemq.conf}/credentials.properties</value>
    </property>
</bean>


<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq_8200" dataDirectory="${activemq.data}">


    <destinationPolicy>
        <policyMap>
          <policyEntries>
            <policyEntry producerFlowControl="false" topic="&gt;">
                <!-- The constantPendingMessageLimitStrategy is used to prevent
                     slow topic consumers to block producers and affect other consumers
                     by limiting the number of messages that are retained
                     For more information, see: 
                     http://activemq.apache.org/slow-consumer-handling.html

                -->
              <pendingMessageLimitStrategy>
                <constantPendingMessageLimitStrategy limit="1000"/>
              </pendingMessageLimitStrategy>
            </policyEntry>
           <policyEntry producerFlowControl="false" queue="&gt;">
              <deadLetterStrategy>
                                    <!--
                                      Use the prifix 'DLQ.' for the destination name,  and make the DLQ a queue rather than a topic
                                    -->
                                    <individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true"/>
                              </deadLetterStrategy>
              <!-- Use VM cursor for better latency
                   For more information, see:

                   http://activemq.apache.org/message-cursors.html

              <pendingQueuePolicy>
                <vmQueueCursor/>
              </pendingQueuePolicy>
              -->
            </policyEntry>
          </policyEntries>
        </policyMap>
    </destinationPolicy>


    <!--
        The managementContext is used to configure how ActiveMQ is exposed in
        JMX. By default, ActiveMQ uses the MBean server that is started by
        the JVM. For more information, see:

        http://activemq.apache.org/jmx.html
    -->
    <managementContext>
        <managementContext createConnector="false"/>
    </managementContext>


    <persistenceAdapter>
        <replicatedLevelDB bind="tcp://0.0.0.0:0" directory="${activemq.data}/leveldb" replicas="3" zkAddress="gwxdev05.northamerica.cerner.net:2181,gwxdev05.northamerica.cerner.net:2182,gwxdev05.northamerica.cerner.net:2183" zkPassword="password" zkPath="/opt/gwx/activemqdata"/>
    </persistenceAdapter>



            <systemUsage>
        <systemUsage sendFailIfNoSpace="true">
            <memoryUsage>
                <memoryUsage limit="256 mb"/>
            </memoryUsage>
            <storeUsage>
                <storeUsage limit="1 gb"/>
            </storeUsage>
            <tempUsage>
                <tempUsage limit="128 mb"/>
            </tempUsage>
        </systemUsage>
    </systemUsage>


    <transportConnectors>
        <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
        <transportConnector name="openwire" uri="tcp://0.0.0.0:${openwirePort}?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>
        <transportConnector name="amqp" uri="amqp://0.0.0.0:${amqpPort}?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600"/>
    </transportConnectors>

    <!-- destroy the spring context on shutdown to stop jetty -->
    <shutdownHooks>
        <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook"/>
    </shutdownHooks>

</broker>


 <import resource="jetty.xml"/>
以下是我得到的例外:

 Connecting to pid: 2410
 INFO: failed to resolve jmxUrl for pid:2410, using default JMX url Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
 ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason: java.io.IOException: Failed to retrieve RMIServer stub: 
 javax.naming.ServiceUnavailableException [Root exception is  java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:     java.net.ConnectException: Connection refused] java.lang.RuntimeException: Failed to execute stop task. Reason: java.io.IOException: Failed to retrieve RMIServer stub:

javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused]
    at 
我检查了防火墙。这不是问题

知道是什么导致了这个问题吗

Activemq 5.10版快照

Java 1.7


OS linux 6.4

如果它仍然帮助某人:

当我在垃圾箱/环境中

 export ACTIVEMQ_SUNJMX_CONTROL="-Dactivemq.jmx.url=service:jmx:rmi:///jndi/rmi://127.0.0.1:8100/jmxrmi"
 #
 ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=8100 "
 ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"   
 ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
,它不工作,进程甚至在没有日志记录的情况下也失败。 我不知道为什么,但是这个方法是有效的(对于AMQ 5.13):u向xml添加以下内容:

<managementContext>
            <managementContext connectorPort="1099"/>
</managementContext>


没有任何东西像ACTIVEMQ_SUNJMX_START in env file

你检查了启动日志以查看JMX端口的实际位置吗?我没有看到任何关于jmxport的内容。我所看到的openwireport和amqp端口的所有内容。我能够使用jconsole从我的机器通过以下url:service:jmx:rmi:///jndi/rmi://:8100/jmxrmiDo 你认为这和港口的捆绑有关吗?我运行netstat。11:02:47#netstat-lptun | grep 8100->输出:tcp 0:::8100:::*监听9810/java设置管理上下文也不受鼓励,但是设置
ACTIVEMQ_SUNJMX_START=
空是我的窍门。在启动时设置ACTIVEMQ_SUNJMX_CONTROL您所做的方式将赋予JVM对JMX的控制权,这是正确的。如果需要正确的日志记录,我发现使用至少
-Dlog4j.configuration=file://${ACTIVEMQ\u CONF}/log4j.properties
覆盖
ACTIVEMQ\u OPTS
有助于获得更好的信息。整个设置太大,无法在评论中发布。
<managementContext>
            <managementContext connectorPort="1099"/>
</managementContext>