Hi,

I configured replicating HA master-slave of Artemis 1.1.0 instances on
Ubuntu 14.04.3.

When I kill master the slave takes over as expected and starts serving as
new master. When I then start the old master, it fails with the following
errors in the log:

16:35:46,476 ERROR [org.apache.activemq.artemis.core.server] AMQ224008:
Failed to store id: java.lang.IllegalStateException: Cannot find add info 1
at
org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendDeleteRecord(JournalImpl.java:799)
[artemis-journal-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.journal.impl.JournalBase.appendDeleteRecord(JournalBase.java:183)
[artemis-journal-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendDeleteRecord(JournalImpl.java:79)
[artemis-journal-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.deleteID(JournalStorageManager.java:1194)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator.deleteID(BatchingIDGenerator.java:152)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator.cleanup(BatchingIDGenerator.java:75)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.persistence.impl.journal.JournalStorageManager.loadBindingJournal(JournalStorageManager.java:1784)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:1625)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:1535)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation.run(SharedNothingBackupActivation.java:249)
[artemis-server-1.1.0.jar:1.1.0]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

16:35:46,572 WARN  [org.apache.activemq.artemis.core.server] AMQ222173:
Queue jms.queue.DLQ is duplicated during reload. This queue will be renamed
as jms.queue.DLQ-0
16:35:46,572 ERROR [org.apache.activemq.artemis.core.server] AMQ224000:
Failure in initialisation: java.lang.IllegalStateException: Cursor 2 had
already been created
at
org.apache.activemq.artemis.core.paging.cursor.impl.PageCursorProviderImpl.createSubscription(PageCursorProviderImpl.java:97)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.PostOfficeJournalLoader.initQueues(PostOfficeJournalLoader.java:140)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:1631)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:1535)
[artemis-server-1.1.0.jar:1.1.0]
at
org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation.run(SharedNothingBackupActivation.java:249)
[artemis-server-1.1.0.jar:1.1.0]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

As a result both master and the slave remain unaccessible and no further
restarts solve the situation.

Attached also master and slave broker.xml files.

BR!

Mihkel Nõges
<?xml version='1.0'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
               xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

   <jms xmlns="urn:activemq:jms">
      <queue name="DLQ"/>
      <queue name="ExpiryQueue"/>
   </jms>

   <core xmlns="urn:activemq:core">

      <!-- this could be ASYNCIO or NIO
       -->
      <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-min-files>10</journal-min-files>

      <!--
       This value was determined through a calculation.
       Your system could perform 7.14 writes per millisecond
       on the current journal configuration.
       That translates as a sync write every 140000 nanoseconds
      -->
      <journal-buffer-timeout>140000</journal-buffer-timeout>

    <connectors>
        <!-- Connector used to be announced through cluster connections and notifications -->
        <connector name="netty-connector">tcp://broker1:61616</connector>
    </connectors>


      <acceptors>
         <!-- Default ActiveMQ Artemis Acceptor.  Multi-protocol adapter.  Currently supports Core, OpenWire, Stomp and AMQP. -->
         <!-- performance tests have shown that openWire performs best with these buffer sizes -->
         <acceptor name="netty-acceptor">tcp://broker1:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
         <acceptor name="netty-ssl-acceptor">tcp://broker1:61617?sslEnabled=true;enabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA,SSL_DH_anon_WITH_3DES_EDE_CBC_SHA;keyStorePath=/var/lib/artemismq/master/etc/cacerts;keyStorePassword=Kalamaja123</acceptor>
      </acceptors>


      <cluster-user>artemiscl</cluster-user>

      <cluster-password>Kalamaja123</cluster-password>

      <broadcast-groups>
         <broadcast-group name="bg-group1">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <broadcast-period>5000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group1">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>10000</refresh-timeout>
         </discovery-group>
      </discovery-groups>

      <cluster-connections>
         <cluster-connection name="my-cluster">
            <address>jms</address>
            <connector-ref>netty-connector</connector-ref>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>0</max-hops>
            <discovery-group-ref discovery-group-name="dg-group1"/>
         </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="consume" 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>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <max-size-bytes>10485760</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>BLOCK</address-full-policy>
         </address-setting>
      </address-settings>
   </core>
</configuration>
<?xml version='1.0'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<configuration xmlns="urn:activemq"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
               xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">

   <jms xmlns="urn:activemq:jms">
      <queue name="DLQ"/>
      <queue name="ExpiryQueue"/>
   </jms>

   <core xmlns="urn:activemq:core">

      <!-- this could be ASYNCIO or NIO
       -->
      <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-min-files>10</journal-min-files>

      <!--
       This value was determined through a calculation.
       Your system could perform 7.14 writes per millisecond
       on the current journal configuration.
       That translates as a sync write every 140000 nanoseconds
      -->
      <journal-buffer-timeout>140000</journal-buffer-timeout>


    <connectors>
        <!-- Connector used to be announced through cluster connections and notifications -->
        <connector name="netty-connector">tcp://broker2:61616</connector>
    </connectors>


      <acceptors>
         <!-- Default ActiveMQ Artemis Acceptor.  Multi-protocol adapter.  Currently supports Core, OpenWire, Stomp and AMQP. -->
         <!-- performance tests have shown that openWire performs best with these buffer sizes -->
         <acceptor name="netty-acceptor">tcp://broker2:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576</acceptor>
         <acceptor name="netty-ssl-acceptor">tcp://broker2:61617?sslEnabled=true;enabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA,SSL_DH_anon_WITH_3DES_EDE_CBC_SHA;keyStorePath=/var/lib/artemismq/slave/etc/cacerts;keyStorePassword=Kalamaja123</acceptor>
      </acceptors>


      <cluster-user>artemiscl</cluster-user>

      <cluster-password>Kalamaja123</cluster-password>

      <broadcast-groups>
         <broadcast-group name="bg-group1">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <broadcast-period>5000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group1">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <refresh-timeout>10000</refresh-timeout>
         </discovery-group>
      </discovery-groups>

      <cluster-connections>
         <cluster-connection name="my-cluster">
            <address>jms</address>
            <connector-ref>netty-connector</connector-ref>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>0</max-hops>
            <discovery-group-ref discovery-group-name="dg-group1"/>
         </cluster-connection>
      </cluster-connections>

      <ha-policy>
         <replication>
            <slave>
               <allow-failback>true</allow-failback>
               <failback-delay>5000</failback-delay>
            </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="consume" 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>
         <!--default for catch all-->
         <address-setting match="#">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>
            <redelivery-delay>0</redelivery-delay>
            <max-size-bytes>10485760</max-size-bytes>
            <message-counter-history-day-limit>10</message-counter-history-day-limit>
            <address-full-policy>BLOCK</address-full-policy>
         </address-setting>
      </address-settings>
   </core>
</configuration>

Reply via email to