Artemis崩溃了,消息/队列丢失了

时间:2019-03-26 08:08:52

标签: activemq-artemis

任何想法在这里发生了什么?消息和队列可以恢复吗?如何使用ActiveMQ Artemis数据?所有队列/消息均丢失。仅DLQ / ExpiryQueue。

  1. 我们必须进行配置更改。因此,我们开始更新从站。
  2. 要故障转移到从站以修复主站,我们做了./artemis-service stop @ 16:32
  3. 对师父的一些警告,但对其他人的警告不多。
  4. 在从站上,我们可以看到一些超时和连接失败。不确定从站是否接管了队列并且工作正常。
  5. @ 16:46:27我们对大师做了./artemis-service start
  6. Artemis似乎开始移动/删除装订/日记
  7. Master似乎无法从连接问题开始@ 16:46:33
  8. 从站尝试重新启动并控制@ 16:46:37
  9. 从属清除日记帐/绑定

现在所有队列都消失了。从站上仅存在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>

1 个答案:

答案 0 :(得分:0)

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