Синхронизация между экземплярами сервера с обнаружением stati c и настройкой общего хранилища - PullRequest
0 голосов
/ 16 июня 2020

Я создал Apache установку кластера HA экземпляра сервера Artemis с обнаружением c статуса и режимом общего хранилища. Я создал настройку главного сервера на одной машине и настройку подчиненного сервера на второй машине. Я создал новую очередь, скажем, queue.xyz на главном сервере. Я открыл консоль управления на подчиненном сервере, но подробностей об очереди нет.

Мне интересно, почему присутствие очереди не видно на второй машине, даже если я использовал конфигурацию режима общего хранилища. Я предполагаю, что режим общего хранилища синхронизирует все очереди и детали c на всех двух серверах. Пожалуйста, дайте мне знать, если я ошибаюсь в своем предположении.

Может ли кто-нибудь иметь какую-нибудь подсказку и указать мне, где я что-то упустил в этой настройке.

Вот broker.xml: * 1009 мастера *

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
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">
   <core xmlns="urn:activemq:core">

      <bindings-directory>/home/Apache/shareddrive/ApacheArtemis/data/bindings</bindings-directory>

      <journal-directory>/home/Apache/shareddrive/ApacheArtemis/data/journal</journal-directory>
      <journal-type>NIO</journal-type>
      <journal-max-io>1</journal-max-io>

      <large-messages-directory>/home/Apache/shareddrive/ApacheArtemis/data/largemessages</large-messages-directory>

      <paging-directory>/home/Apache/shareddrive/ApacheArtemis/data/paging</paging-directory>

      <cluster-user>admin</cluster-user>

      <cluster-password>admin</cluster-password>

     <ha-policy>
        <shared-store>
            <master>

                <failover-on-shutdown>true</failover-on-shutdown>
                <wait-for-activation>true</wait-for-activation>

            </master>
        </shared-store>
    </ha-policy>

      <connectors>
         <connector name="netty-connector">tcp://192.168.1.1:61616</connector>
         <connector name="netty-backup-connector">tcp://192.168.1.2:61616</connector>
      </connectors>

      <!-- Acceptors -->
      <acceptors>
         <acceptor name="netty-acceptor">tcp://192.168.1.1:61616</acceptor>
      </acceptors>

      <cluster-connections>
         <cluster-connection name="my-cluster">
            <connector-ref>netty-connector</connector-ref>
            <static-connectors>
               <connector-ref>netty-backup-connector</connector-ref>
            </static-connectors>
         </cluster-connection>
      </cluster-connections>
      <!-- Other config -->


      <security-enabled>false</security-enabled>

      <security-settings>
         <!--security for example queue-->
         <security-setting match="exampleQueue">
            <permission roles="guest" type="createDurableQueue"/>
            <permission roles="guest" type="deleteDurableQueue"/>
            <permission roles="guest" type="createNonDurableQueue"/>
            <permission roles="guest" type="deleteNonDurableQueue"/>
            <permission roles="guest" type="consume"/>
            <permission roles="guest" type="send"/>
         </security-setting>
      </security-settings>

      <addresses>
         <address name="exampleQueue">
            <anycast>
               <queue name="exampleQueue"/>
            </anycast>
         </address>
      </addresses>
   </core>
</configuration>

Вот и раб broker.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
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">
   <core xmlns="urn:activemq:core">

      <bindings-directory>/home/Apache/shareddrive/ApacheArtemis/data/bindings</bindings-directory>

      <journal-directory>/home/Apache/shareddrive/ApacheArtemis/data/journal</journal-directory>
      <journal-type>NIO</journal-type>
      <journal-max-io>1</journal-max-io>

      <large-messages-directory>/home/Apache/shareddrive/ApacheArtemis/data/largemessages</large-messages-directory>

      <paging-directory>/home/Apache/shareddrive/ApacheArtemis/data/paging</paging-directory>

      <cluster-user>admin</cluster-user>

      <cluster-password>admin</cluster-password>

      <ha-policy>
          <shared-store>
              <slave>
                  <allow-failback>true</allow-failback>
                  <failover-on-shutdown>true</failover-on-shutdown>
               </slave>
          </shared-store>
      </ha-policy>

      <connectors>
         <connector name="netty-connector">tcp://192.168.1.2:61616</connector>
         <connector name="netty-backup-connector">tcp://192.168.1.1:61616</connector>
      </connectors>

      <!-- Acceptors -->
      <acceptors>
         <acceptor name="netty-acceptor">tcp://192.168.1.2:61616</acceptor>
      </acceptors>

      <cluster-connections>
         <cluster-connection name="my-cluster">
            <connector-ref>netty-connector</connector-ref>
            <static-connectors>
               <connector-ref>netty-backup-connector</connector-ref>
            </static-connectors>
         </cluster-connection>
      </cluster-connections>
      <!-- Other config -->


      <security-enabled>false</security-enabled>

      <security-settings>
         <!--security for example queue-->
         <security-setting match="exampleQueue">
            <permission roles="guest" type="createDurableQueue"/>
            <permission roles="guest" type="deleteDurableQueue"/>
            <permission roles="guest" type="createNonDurableQueue"/>
            <permission roles="guest" type="deleteNonDurableQueue"/>
            <permission roles="guest" type="consume"/>
            <permission roles="guest" type="send"/>
         </security-setting>
      </security-settings>

      <addresses>
         <address name="exampleQueue">
            <anycast>
               <queue name="exampleQueue"/>
            </anycast>
         </address>
      </addresses>
   </core>
</configuration>

1 Ответ

0 голосов
/ 19 июня 2020

Ожидается то, что вы видите.

В паре ActiveMQ Artemis HA (т.е. главный и подчиненный) один брокер будет активным , а один брокер будет пассивным . Если вы посмотрите на консоль управления активного брокера, вы увидите все обычные данные времени выполнения (например, адреса, очереди, количество сообщений, количество подключений и т. Д. c.). Однако, если вы посмотрите на консоль управления пассивного брокера, вы увидите очень мало, потому что брокер пассивен. Он не загрузил никаких данных сообщения (так как он не активен). У него нет клиентских подключений и т. Д. c.

...