【问题标题】:Artemis crashed and messages/queues lostArtemis 崩溃,消息/队列丢失
【发布时间】:2019-08-16 13:22:55
【问题描述】:

你知道这里发生了什么吗?可以恢复消息和队列吗?如何使用 ActiveMQ Artemis 数据?所有队列/消息都丢失。仅 DLQ/ExpiryQueue。

  1. 我们必须进行配置更改。所以我们开始更新 Slave。
  2. 为了故障转移到从站以修复主站,我们执行了./artemis-service stop@16:32
  3. 关于 Master 的一些警告,但不多。
  4. 在从站上,我们可以看到一些超时和连接失败。不确定 Slave 是否接管了队列并且工作正常。
  5. @16:46:27 我们在 Master 上做了一个./artemis-service start
  6. 好像 Artemis 开始移动/移除绑定/期刊
  7. Master 似乎无法启动 Connections 问题@16:46:33
  8. 从站尝试再次重新启动并控制@16:46:37
  9. Slave 清除日志/绑定

现在所有的队列都消失了。 Slave 上只存在 DLQ 和 ExpiryQueue。主人下线了。

我们可以从oldreplica 恢复吗?可能已经被刷了? 我们还没有尝试从副本中恢复。有手册或知识库吗?

大师: 其中一些:

16:32:15,847 WARN  [org.apache.activemq.artemis.core.server] AMQ222061: Client connection failed, clearing up resources for session ID:xxx.yyy.zzz-30305-1552451287008-17:1:-1 
16:32:15,847 WARN  [org.apache.activemq.artemis.core.server] AMQ222107: Cleared up resources for session ID:xxx.yyy.zzz-30305-1552451287008-17:1:-1 
...
16:32:16,088 INFO  [org.apache.activemq.hawtio.plugin.PluginContextListener] Destroyed artemis-plugin plugin 
16:32:16,093 INFO  [org.apache.activemq.hawtio.branding.PluginContextListener] Destroyed activemq-branding plugin 
16:32:16,104 INFO  [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.4.0 [06926557-2906-11e8-a15f-005056926b6e] stopped, uptime 4 days 3 hours

同时在奴隶上:

16:32:15,867 INFO  [org.apache.activemq.artemis.core.server] AMQ221066: Initiating quorum vote: LiveFailoverQuorumVote 
16:32:15,868 INFO  [org.apache.activemq.artemis.core.server] AMQ221067: Waiting 30 seconds for quorum vote results. 
16:32:15,869 INFO  [org.apache.activemq.artemis.core.server] AMQ221068: Received all quorum votes. 
16:32:15,869 INFO  [org.apache.activemq.artemis.core.server] AMQ221071: Failing over based on quorum vote results. 
16:32:15,889 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119015: The connection was disconnected because of server shutdown [code=DISCONNECTED] 
16:32:15,944 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119015: The connection was disconnected because of server shutdown [code=DISCONNECTED] 
16:32:15,999 INFO  [org.apache.activemq.artemis.core.server] AMQ221037: ActiveMQServerImpl::serverUUID=06926557-2906-11e8-a15f-005056926b6e to become 'live' 
16:32:16,450 WARN  [org.apache.activemq.artemis.core.client] AMQ212004: Failed to connect to server. 
16:32:34,825 INFO  [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue DLQ on address DLQ 
16:32:34,825 INFO  [org.apache.activemq.artemis.core.server] AMQ221003: Deploying queue ExpiryQueue on address ExpiryQueue 
16:32:35,156 INFO  [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live 

16:33:51,161 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:53781 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:34:10,061 INFO  [io.hawt.web.LoginServlet] hawtio login is using 1800 sec. HttpSession timeout 
16:34:11,891 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:34:52,912 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:35:01,183 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:47171 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:36:01,191 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:54700 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:36:12,705 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:36:53,104 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:37:11,203 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:16751 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:38:11,209 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:20634 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:38:12,182 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:39:21,216 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:61541 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:40:21,225 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:49708 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:41:18,720 ERROR [org.apache.activemq.artemis.core.server] AMQ224088: Timeout (10 seconds) while handshaking has occurred. 
16:45:51,271 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119014: Did not receive data from /aaa.bbb.ccc.ddd:20748 within the 60,000ms connection TTL. The connection will now be closed. [code=CONNECTION_TIMEDOUT] 
16:46:32,151 INFO  [org.apache.activemq.artemis.core.server] AMQ221025: Replication: sending AIOSequentialFile:/opt/brokers/ActiveMQServer2/./data/journal/activemq-data-167.amq (size=10,485,760) to replica. 
16:46:33,100 INFO  [org.apache.activemq.artemis.core.server] AMQ221025: Replication: sending AIOSequentialFile:/opt/brokers/ActiveMQServer2/./data/journal/activemq-data-168.amq (size=10,485,760) to replica. 
16:46:33,182 WARN  [org.apache.activemq.artemis.core.server] AMQ222061: Client connection failed, clearing up resources for session ID:xxx.yyy.zzz-30305-1552451287008-19:1:-1 
16:46:33,188 WARN  [org.apache.activemq.artemis.core.server] AMQ222107: Cleared up resources for session ID:xxx.yyy.zzz-30305-1552451287008-19:1:-1 
16:46:33,199 WARN  [org.apache.activemq.artemis.core.server] AMQ222061: Client connection failed, clearing up resources for session 380d4fc6-4f13-11e9-b0fb-00505692a0af 
16:46:33,288 INFO  [io.hawt.web.AuthenticationFilter] Destroying hawtio authentication filter 
16:46:33,290 INFO  [io.hawt.HawtioContextListener] Destroying hawtio services 
16:46:33,391 INFO  [org.apache.activemq.hawtio.plugin.PluginContextListener] Destroyed artemis-plugin plugin 
16:46:33,397 INFO  [org.apache.activemq.hawtio.branding.PluginContextListener] Destroyed activemq-branding plugin 
16:46:33,408 INFO  [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.4.0 [06926557-2906-11e8-a15f-005056926b6e] stopped, uptime 4 days 3 hours 


16:46:37,163 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server 
16:46:37,266 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: backup Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=./data/journal,bindingsDirectory=./data/bindings,largeMessagesDirectory=./data/large-messages,pagingDirectory=./data/paging) 
16:46:37,288 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer2/./data/bindings/oldreplica.45 
16:46:37,292 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer2/./data/bindings to /opt/brokers/ActiveMQServer2/./data/bindings/oldreplica.47 
16:46:37,295 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer2/./data/journal/oldreplica.49 
16:46:37,597 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer2/./data/journal to /opt/brokers/ActiveMQServer2/./data/journal/oldreplica.51 
16:46:37,628 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer2/./data/paging/oldreplica.45 
16:46:37,852 INFO  [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin 
16:46:38,056 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer2/./data/paging to /opt/brokers/ActiveMQServer2/./data/paging/oldreplica.47 
16:46:38,091 INFO  [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal 
16:46:38,157 INFO  [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 2,147,483,648 
16:46:38,252 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE 
16:46:38,252 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP 
16:46:38,253 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ 
16:46:38,253 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT 
16:46:38,253 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE 
16:46:38,254 INFO  [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP 
16:46:38,328 INFO  [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin 
16:46:42,502 INFO  [io.hawt.HawtioContextListener] Initialising hawtio services 
16:46:42,572 INFO  [io.hawt.web.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/opt/brokers/ActiveMQServer2//etc/jolokia-access.xml] 
16:46:42,617 INFO  [io.hawt.web.RBACMBeanInvoker] Using MBean [hawtio:type=security,area=jmx,rank=0,name=HawtioDummyJMXSecurity] for role based access control 
16:46:42,788 INFO  [io.hawt.system.ProxyWhitelist] Initial proxy whitelist: [localhost, 127.0.0.1, aaa.bbb.ccc.50, nodep02.domain.local] 
16:46:43,202 INFO  [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://nodep02:8161
16:46:43,202 INFO  [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://nodep02:8161/console/jolokia

回到大师

16:46:27,913 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server 
16:46:27,999 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=./data/journal,bindingsDirectory=./data/bindings,largeMessagesDirectory=./data/large-messages,pagingDirectory=./data/paging) 
16:46:28,440 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer1/./data/bindings/oldreplica.18 
16:46:28,447 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer1/./data/bindings to /opt/brokers/ActiveMQServer1/./data/bindings/oldreplica.20 
16:46:28,450 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer1/./data/journal/oldreplica.18 
16:46:28,478 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer1/./data/journal to /opt/brokers/ActiveMQServer1/./data/journal/oldreplica.20 
16:46:28,482 INFO  [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/brokers/ActiveMQServer1/./data/paging/oldreplica.18 
16:46:28,517 INFO  [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/brokers/ActiveMQServer1/./data/paging to /opt/brokers/ActiveMQServer1/./data/paging/oldreplica.20 
16:46:28,580 INFO  [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal 
16:46:33,209 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119015: The connection was disconnected because of server shutdown [code=DISCONNECTED] 
16:46:33,266 WARN  [org.apache.activemq.artemis.core.client] AMQ212037: Connection failure has been detected: AMQ119015: The connection was disconnected because of server shutdown [code=DISCONNECTED] 
16:46:33,273 WARN  [org.apache.activemq.artemis.journal] File not opened, file=null: java.lang.NullPointerException: File not opened, file=null 
        at org.apache.activemq.artemis.core.io.aio.AIOSequentialFile.checkOpened(AIOSequentialFile.java:328) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.io.aio.AIOSequentialFile.writeDirect(AIOSequentialFile.java:242) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.io.AbstractSequentialFile$LocalBufferObserver.flushBuffer(AbstractSequentialFile.java:306) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.io.buffer.TimedBuffer.flushBatch(TimedBuffer.java:310) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.io.buffer.TimedBuffer.flush(TimedBuffer.java:281) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.io.AbstractSequentialFileFactory.flush(AbstractSequentialFileFactory.java:195) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.journal.impl.JournalImpl.flush(JournalImpl.java:2194) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.journal.impl.JournalImpl.stop(JournalImpl.java:2356) [artemis-journal-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.stop(JournalStorageManager.java:266) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.stop(JournalStorageManager.java:203) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.replication.ReplicationEndpoint.stop(ReplicationEndpoint.java:327) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stopComponent(ActiveMQServerImpl.java:1256) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation.run(SharedNothingBackupActivation.java:259) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$ActivationThread.run(ActiveMQServerImpl.java:2951) [artemis-server-2.4.0.jar:2.4.0] 
16:46:33,318 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation: ActiveMQIllegalStateException[errorType=ILLEGAL_STATE message=AMQ119026: Backup Server was not yet in sync with live] 
        at org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation.run(SharedNothingBackupActivation.java:314) [artemis-server-2.4.0.jar:2.4.0] 
        at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$ActivationThread.run(ActiveMQServerImpl.java:2951) [artemis-server-2.4.0.jar:2.4.0] 
16:46:33,995 INFO  [io.hawt.web.keycloak.KeycloakServlet] Keycloak integration is disabled 
16:46:40,486 WARN  [org.apache.activemq.artemis.core.server] AMQ222040: Server is stopped 
16:46:50,033 WARN  [org.apache.activemq.artemis.core.server] AMQ222040: Server is stopped 
16:47:00,034 WARN  [org.apache.activemq.artemis.core.server] AMQ222040: Server is stopped 

Broker.xml(主)

        <?xml version="1.0"?>
    <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
        <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq:core ">
            <name>ActiveMQ1</name>
            <persistence-enabled>true</persistence-enabled>
            <journal-type>ASYNCIO</journal-type>
            <paging-directory>./data/paging</paging-directory>
            <bindings-directory>./data/bindings</bindings-directory>
            <journal-directory>./data/journal</journal-directory>
            <large-messages-directory>./data/large-messages</large-messages-directory>
            <journal-datasync>true</journal-datasync>
            <journal-min-files>2</journal-min-files>
            <journal-pool-files>-1</journal-pool-files>
            <journal-file-size>10M</journal-file-size>
            <journal-buffer-size>33554432</journal-buffer-size>
            <!-- Size in bytes -->
            <journal-buffer-timeout>128000</journal-buffer-timeout>
            <journal-max-io>4096</journal-max-io>
            <connectors>
                <connector name="artemis">tcp://nodep01:61616</connector>
                <connector name="ActiveMQ2-Connector">tcp://nodep02:61616</connector>
            </connectors>
            <disk-scan-period>5000</disk-scan-period>
            <max-disk-usage>100</max-disk-usage>
            <critical-analyzer>true</critical-analyzer>
            <critical-analyzer-timeout>120000</critical-analyzer-timeout>
            <critical-analyzer-check-period>60000</critical-analyzer-check-period>
            <critical-analyzer-policy>HALT</critical-analyzer-policy>
            <acceptors>
                <acceptor name="artemis">tcp://nodep01:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
                <acceptor name="amqp">tcp://nodep01:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300</acceptor>
                <acceptor name="stomp">tcp://nodep01:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
                <acceptor name="hornetq">tcp://nodep01:5445?protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
                <acceptor name="artemis+ssl">tcp://nodep01:61443?sslEnabled=true;keyStorePath=/opt/brokers/ActiveMQServer1/activemq.keystore;keyStorePassword=CCCCC;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
            </acceptors>
            <cluster-user>XXXXXXXX</cluster-user>
            <cluster-password>YYYYYYY</cluster-password>
            <cluster-connections>
                <cluster-connection name="ActiveMQClusterPROD">
                    <connector-ref>artemis</connector-ref>
                    <min-large-message-size>33554432</min-large-message-size>
                    <!-- Size should be eqvialent to journal-buffer-size -->
                    <message-load-balancing>ON_DEMAND</message-load-balancing>
                    <max-hops>1</max-hops>
                    <static-connectors>
                        <connector-ref>ActiveMQ2-Connector</connector-ref>
                    </static-connectors>
                </cluster-connection>
            </cluster-connections>
            <ha-policy>
                <replication>
                    <master>
                        <check-for-live-server>true</check-for-live-server>
                    </master>
                </replication>
            </ha-policy>
            <security-settings>
                <security-setting match="#">
                    <permission type="createNonDurableQueue" roles="amq" />
                    <permission type="deleteNonDurableQueue" roles="amq" />
                    <permission type="createDurableQueue" roles="amq" />
                    <permission type="deleteDurableQueue" roles="amq" />
                    <permission type="createAddress" roles="amq" />
                    <permission type="deleteAddress" roles="amq" />
                    <permission type="consume" roles="amq" />
                    <permission type="browse" roles="amq" />
                    <permission type="send" roles="amq" />
                    <!-- we need this otherwise ./artemis data imp wouldn't work-->
                    <permission type="manage" roles="amq" />
                </security-setting>
            </security-settings>
            <address-settings>
                <!-- if you define auto-create on certain queues, management has to be auto-create -->
                <address-setting match="activemq.management#">
                    <dead-letter-address>DLQ</dead-letter-address>
                    <expiry-address>ExpiryQueue</expiry-address>
                    <redelivery-delay>0</redelivery-delay>
                    <!-- with -1 only the global-max-size is in use for limiting -->
                    <max-size-bytes>-1</max-size-bytes>
                    <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    <address-full-policy>PAGE</address-full-policy>
                    <auto-create-queues>true</auto-create-queues>
                    <auto-create-addresses>true</auto-create-addresses>
                    <auto-create-jms-queues>true</auto-create-jms-queues>
                    <auto-create-jms-topics>true</auto-create-jms-topics>
                </address-setting>
                <!--default for catch all-->
                <address-setting match="#">
                    <dead-letter-address>DLQ</dead-letter-address>
                    <expiry-address>ExpiryQueue</expiry-address>
                    <redelivery-delay>0</redelivery-delay>
                    <!-- with -1 only the global-max-size is in use for limiting -->
                    <max-size-bytes>-1</max-size-bytes>
                    <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    <address-full-policy>PAGE</address-full-policy>
                    <auto-create-queues>true</auto-create-queues>
                    <auto-create-addresses>true</auto-create-addresses>
                    <auto-create-jms-queues>true</auto-create-jms-queues>
                    <auto-create-jms-topics>true</auto-create-jms-topics>
                </address-setting>
            </address-settings>
            <addresses>
                <address name="DLQ">
                    <anycast>
                        <queue name="DLQ" />
                    </anycast>
                </address>
                <address name="ExpiryQueue">
                    <anycast>
                        <queue name="ExpiryQueue" />
                    </anycast>
                </address>
            </addresses>
        </core>
    </configuration>

Broker.xml(从属)

    <?xml version="1.0"?>
    <configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
        <core xmlns="urn:activemq:core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq:core ">
            <name>ActiveMQ2</name>
            <persistence-enabled>true</persistence-enabled>
            <journal-type>ASYNCIO</journal-type>
            <paging-directory>./data/paging</paging-directory>
            <bindings-directory>./data/bindings</bindings-directory>
            <journal-directory>./data/journal</journal-directory>
            <large-messages-directory>./data/large-messages</large-messages-directory>
            <journal-datasync>true</journal-datasync>
            <journal-min-files>2</journal-min-files>
            <journal-pool-files>-1</journal-pool-files>
            <journal-file-size>10M</journal-file-size>
            <journal-buffer-size>33554432</journal-buffer-size>
            <!-- size in bytes -->
            <journal-buffer-timeout>104000</journal-buffer-timeout>
            <journal-max-io>4096</journal-max-io>
            <connectors>
                <!-- Connector used to be announced through cluster connections and notifications -->
                <connector name="artemis">tcp://nodep02:61616</connector>
                <connector name="ActiveMQ1-Connector">tcp://nodep01:61616</connector>
            </connectors>
            <disk-scan-period>5000</disk-scan-period>
            <max-disk-usage>100</max-disk-usage>
            <critical-analyzer>true</critical-analyzer>
            <critical-analyzer-timeout>120000</critical-analyzer-timeout>
            <critical-analyzer-check-period>60000</critical-analyzer-check-period>
            <critical-analyzer-policy>HALT</critical-analyzer-policy>
            <acceptors>
                <acceptor name="artemis">tcp://nodep02:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
                <acceptor name="amqp">tcp://nodep02:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300</acceptor>
                <acceptor name="stomp">tcp://nodep02:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>
                <acceptor name="hornetq">tcp://nodep02:5445?protocols=HORNETQ,STOMP;useEpoll=true</acceptor>
                <acceptor name="mqtt">tcp://nodep02:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
                <acceptor name="artemis+ssl">tcp://nodep02:61443?sslEnabled=true;keyStorePath=/opt/brokers/ActiveMQServer2/activemq.keystore;keyStorePassword=CCCCC;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
            </acceptors>
            <cluster-user>XXXXXXXX</cluster-user>
            <cluster-password>YYYYYYY</cluster-password>
            <cluster-connections>
                <cluster-connection name="ActiveMQClusterPROD">
                    <connector-ref>artemis</connector-ref>
                    <min-large-message-size>33554432</min-large-message-size>
                    <message-load-balancing>ON_DEMAND</message-load-balancing>
                    <max-hops>1</max-hops>
                    <static-connectors>
                        <connector-ref>ActiveMQ1-Connector</connector-ref>
                    </static-connectors>
                </cluster-connection>
            </cluster-connections>
            <ha-policy>
                <replication>
                    <slave>
                        <allow-failback>true</allow-failback>
                    </slave>
                </replication>
            </ha-policy>
            <security-settings>
                <security-setting match="#">
                    <permission type="createNonDurableQueue" roles="amq" />
                    <permission type="deleteNonDurableQueue" roles="amq" />
                    <permission type="createDurableQueue" roles="amq" />
                    <permission type="deleteDurableQueue" roles="amq" />
                    <permission type="createAddress" roles="amq" />
                    <permission type="deleteAddress" roles="amq" />
                    <permission type="consume" roles="amq" />
                    <permission type="browse" roles="amq" />
                    <permission type="send" roles="amq" />
                    <!-- we need this otherwise ./artemis data imp wouldn't work-->
                    <permission type="manage" roles="amq" />
                </security-setting>
            </security-settings>
            <address-settings>
                <!-- if you define auto-create on certain queues, management has to be auto-create -->
                <address-setting match="activemq.management#">
                    <dead-letter-address>DLQ</dead-letter-address>
                    <expiry-address>ExpiryQueue</expiry-address>
                    <redelivery-delay>0</redelivery-delay>
                    <!-- with -1 only the global-max-size is in use for limiting -->
                    <max-size-bytes>-1</max-size-bytes>
                    <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    <address-full-policy>PAGE</address-full-policy>
                    <auto-create-queues>true</auto-create-queues>
                    <auto-create-addresses>true</auto-create-addresses>
                    <auto-create-jms-queues>true</auto-create-jms-queues>
                    <auto-create-jms-topics>true</auto-create-jms-topics>
                </address-setting>
                <!--default for catch all-->
                <address-setting match="#">
                    <dead-letter-address>DLQ</dead-letter-address>
                    <expiry-address>ExpiryQueue</expiry-address>
                    <redelivery-delay>0</redelivery-delay>
                    <!-- with -1 only the global-max-size is in use for limiting -->
                    <max-size-bytes>-1</max-size-bytes>
                    <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    <address-full-policy>PAGE</address-full-policy>
                    <auto-create-queues>true</auto-create-queues>
                    <auto-create-addresses>true</auto-create-addresses>
                    <auto-create-jms-queues>true</auto-create-jms-queues>
                    <auto-create-jms-topics>true</auto-create-jms-topics>
                </address-setting>
            </address-settings>
            <addresses>
                <address name="DLQ">
                    <anycast>
                        <queue name="DLQ" />
                    </anycast>
                </address>
                <address name="ExpiryQueue">
                    <anycast>
                        <queue name="ExpiryQueue" />
                    </anycast>
                </address>
            </addresses>
        </core>
    </configuration>

【问题讨论】:

  • 所有队列都被“删除/移除”。当它故障转移到辅助时,只有 DLQ 和 ExpiryQueue 队列存在。我们其余的队列都不见了。
  • 已在上面编辑。更多错误。
  • 更新了上面的 Broker.xml。 1. ./artemis-service stop 2. secondary 试图接管(但我怀疑它失败了。) 3. 在我停止 master 后大约 7-10 分钟,我输入了 ./artemis-service start 4. 看起来 Master 从未收回从辅助控制。
  • 更新和清理。必须删除 som INFO 才能放入一篇文章中。谢谢你。是否有关于如何从副本失败后恢复的好的手册或知识库?
  • 您如何确认所有队列都已删除/移除?您的配置中定义的唯一地址和队列是DLQExpiryQueue,因此看起来一切都按预期工作。如果您使用自动创建的地址和队列,代理将不会在启动时记录有关部署它们的信息。

标签: activemq-artemis


【解决方案1】:

您可以从“oldreplica”备份中恢复完整的日志。这就是他们的目的。您只需将文件从备份位置复制到原始位置。与往常一样,复制数据时要小心,以免覆盖以后可能需要的内容。

【讨论】:

  • 当我们这样做时。/artemis-service stop 它故障转移到辅助/从属。但故障转移后只有 DLQ/ExpiryQueue 出现。
  • 副本好像被删除了? 16:46:37,628 INFO [org.apache.activemq.artemis.core.server] AMQ221055:启动时有太多旧的复制文件夹,删除 /opt/brokers/ActiveMQServer2/./data/paging/oldreplica.45 16: 46:28,478 INFO AMQ222162:将数据目录 /opt/brokers/ActiveMQServer1/./data/journal 移动到 /opt/brokers/ActiveMQServer1/./data/journal/oldreplica.20 16:46:28,482 INFO AMQ221055:也有启动时许多旧的复制文件夹,删除 /opt/brokers/Activ eMQServer1/./data/paging/oldreplica.18
  • 您是否尝试恢复任何备份?我正在解决您是否可以从“oldreplica”备份中恢复的问题。
  • 根据max-saved-replicated-journals-size(默认为2)的配置删除旧副本。首先删除最旧的副本。
  • “max-saved-replicated-journals-size”有什么好的设置。两个太小了,因为很快就被移除了。还有其他看起来奇怪的设置吗?
猜你喜欢
  • 2017-06-29
  • 1970-01-01
  • 1970-01-01
  • 2017-10-25
  • 1970-01-01
  • 1970-01-01
  • 2020-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多