使用静态发现和共享存储设置的服务器实例之间的同步
Synchronization between server instances with static discovery and shared storage setup
我已经创建了具有静态发现和共享存储模式的 Apache Artemis 服务器实例 HA 集群设置。我在一台机器上创建了主服务器设置,在第二台机器上创建了从服务器设置。我在主服务器中创建了新队列 queue.xyz
。我在从属服务器中打开了管理控制台,但队列详细信息不存在。
我想知道为什么即使我使用共享存储模式配置,第二台机器也看不到队列存在。我在这里的假设是,共享存储模式正在同步所有两个服务器中的所有队列和主题详细信息。如果我的假设有误,请告诉我。
任何人都可以提供任何线索并指导我在此设置中遗漏的地方。
这里是大师的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>
<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>
您看到的是正常情况。
在 ActiveMQ Artemis HA 对(即主从)中,一个代理将是 主动,一个代理将是被动。如果您查看活动代理的管理控制台,您将看到所有正常的运行时数据(例如地址、队列、消息计数、连接计数等)。但是,如果您查看被动代理的管理控制台,您会看到很少,因为代理是被动的。它没有加载任何消息数据(因为它不活动)。它没有任何客户端连接等
我已经创建了具有静态发现和共享存储模式的 Apache Artemis 服务器实例 HA 集群设置。我在一台机器上创建了主服务器设置,在第二台机器上创建了从服务器设置。我在主服务器中创建了新队列 queue.xyz
。我在从属服务器中打开了管理控制台,但队列详细信息不存在。
我想知道为什么即使我使用共享存储模式配置,第二台机器也看不到队列存在。我在这里的假设是,共享存储模式正在同步所有两个服务器中的所有队列和主题详细信息。如果我的假设有误,请告诉我。
任何人都可以提供任何线索并指导我在此设置中遗漏的地方。
这里是大师的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>
<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>
您看到的是正常情况。
在 ActiveMQ Artemis HA 对(即主从)中,一个代理将是 主动,一个代理将是被动。如果您查看活动代理的管理控制台,您将看到所有正常的运行时数据(例如地址、队列、消息计数、连接计数等)。但是,如果您查看被动代理的管理控制台,您会看到很少,因为代理是被动的。它没有加载任何消息数据(因为它不活动)。它没有任何客户端连接等