Networking 如何使用JGroup协议为Artemis群集启用多播IP地址
我正在尝试使用JGroup和复制技术来设置artemis集群,因此当我启动主实例和从实例时,它会成功启动,但我无法看到主节点和从节点之间发生复制。我猜多播IP地址被阻止了。那么如何启用多播IP地址呢。如果我遗漏了什么,请引导我。我试过做以下事情,但没有成功Networking 如何使用JGroup协议为Artemis群集启用多播IP地址,networking,activemq-artemis,jgroups,Networking,Activemq Artemis,Jgroups,我正在尝试使用JGroup和复制技术来设置artemis集群,因此当我启动主实例和从实例时,它会成功启动,但我无法看到主节点和从节点之间发生复制。我猜多播IP地址被阻止了。那么如何启用多播IP地址呢。如果我遗漏了什么,请引导我。我试过做以下事情,但没有成功 已尝试禁用防火墙服务 还尝试禁用Selinux 检查VM是否支持多播,并且它是否支持多播,通过运行ifconfig命令进行确认 ifconfig eth0:flags=4163 mtu 1500 我执行的步骤如下 systemctl停
- systemctl停止防火墙D
- systemctl禁用防火墙
- wget
- 解压缩apache-artemis-2.15.0-bin.zip
- cd/apache-artemis-2.15.0/bin
- ./artemis创建/opt/master代理
- cd/opt/master broker/etc
- 更改了jolokia access.xml
*://*
- 将bootstrap.xml更改为
jolokia.xml
和bootstrap.xml
也在从属代理中更改
master-broker.xml:
tcp://172.16.20.129:61616
tcp://172.16.20.129:61616
5000
test-jgroups-file_-ping.xml
活动广播频道
网状连接器
test-jgroups-file_-ping.xml
活动广播频道
10000
网状连接器
1000
5000
50000
5000
500
1
5000
-1
-1
真的
随需应变
1.
32000
30000
1000
2.
管理
管理
DLQ
过期队列
0
-1
10
页
真的
真的
真的
真的
DLQ
过期队列
0
-1
10
页
真的
真的
真的
真的
真的
slave-broker.xml:
tcp://172.16.24.85:61616
tcp://172.16.24.85:61616
test-jgroups-file_-ping.xml
活动广播频道
网状连接器
test-jgroups-file_-ping.xml
活动广播频道
10000
网状连接器
1000
5000
50000
5000
500
1
5000
-1
-1
真的
随需应变
1.
32000
30000
1000
2.
管理
管理
DLQ
过期队列
0
-1
10
页
真的
真的
真的
真的
DLQ
过期队列
0
-1
10
页
真的
真的
真的
真的
-->
真的
在/opt/master broker/etc和/opt/slave broker/etc中提供了test-jgroups-file_ping.xml文件
主代理的日志如下所示
[root@devops-centos-1 bin]# ./artemis run
_ _ _
/ \ ____| |_ ___ __ __(_) _____
/ _ \| _ \ __|/ _ \ \/ | |/ __/
/ ___ \ | \/ |_/ __/ |\/| | |\___ \
/_/ \_\| \__\____|_| |_|_|/___ /
Apache ActiveMQ Artemis 2.15.0
2020-09-25 06:21:27,117 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2020-09-25 06:21:27,142 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)
2020-09-25 06:21:27,306 WARNING [org.jgroups.stack.Configurator] JGRP000014: BasicTCP.use_send_queues has been deprecated: will be removed in 4.0
2020-09-25 06:21:27,307 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.loopback has been deprecated: enabled by default
2020-09-25 06:21:27,308 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.discard_incompatible_packets has been deprecated: incompatible packets are discarded anyway
2020-09-25 06:21:27,309 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.enable_bundling has been deprecated: will be ignored as bundling is on by default
2020-09-25 06:21:27,328 WARNING [org.jgroups.stack.Configurator] JGRP000014: UNICAST.setTimeout has been deprecated: not used anymore
-------------------------------------------------------------------
GMS: address=devops-centos-1-59285, cluster=active_broadcast_channel, physical address=fe80:0:0:0:7da5:f59f:7e18:fca5%ens192:36345
-------------------------------------------------------------------
2020-09-25 06:21:29,384 WARNING [org.jgroups.protocols.pbcast.FLUSH] devops-centos-1-59285: waiting for UNBLOCK timed out after 2000 ms
2020-09-25 06:21:42,449 INFO [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal
2020-09-25 06:21:42,502 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 1,073,741,824
2020-09-25 06:21:42,525 WARNING [org.jgroups.stack.Configurator] JGRP000014: BasicTCP.use_send_queues has been deprecated: will be removed in 4.0
2020-09-25 06:21:42,526 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.loopback has been deprecated: enabled by default
2020-09-25 06:21:42,526 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.discard_incompatible_packets has been deprecated: incompatible packets are discarded anyway
2020-09-25 06:21:42,527 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.enable_bundling has been deprecated: will be ignored as bundling is on by default
2020-09-25 06:21:42,530 WARNING [org.jgroups.stack.Configurator] JGRP000014: UNICAST.setTimeout has been deprecated: not used anymore
-------------------------------------------------------------------
GMS: address=devops-centos-1-62777, cluster=active_broadcast_channel, physical address=fe80:0:0:0:7da5:f59f:7e18:fca5%ens192:41165
-------------------------------------------------------------------
2020-09-25 06:21:44,568 WARNING [org.jgroups.protocols.pbcast.FLUSH] devops-centos-1-62777: waiting for UNBLOCK timed out after 2000 ms
2020-09-25 06:21:44,593 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2020-09-25 06:21:44,593 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
2020-09-25 06:21:44,594 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
2020-09-25 06:21:44,594 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
2020-09-25 06:21:44,594 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
2020-09-25 06:21:44,595 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
2020-09-25 06:21:45,094 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address DLQ supporting [ANYCAST]
2020-09-25 06:21:45,096 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue DLQ on address DLQ
2020-09-25 06:21:45,104 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
2020-09-25 06:21:45,104 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
2020-09-25 06:21:45,399 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 172.16.20.129:61616 for protocols [CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE]
2020-09-25 06:21:45,400 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live
2020-09-25 06:21:45,400 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.15.0 [artemis-master, nodeID=592bdbd4-fe40-11ea-bdec-0050569b585d]
2020-09-25 06:21:45,726 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin
2020-09-25 06:21:45,762 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin
2020-09-25 06:21:46,075 INFO [io.hawt.HawtioContextListener] Initialising hawtio services
2020-09-25 06:21:46,087 INFO [io.hawt.system.ConfigManager] Configuration will be discovered via system properties
2020-09-25 06:21:46,088 INFO [io.hawt.jmx.JmxTreeWatcher] Welcome to hawtio 1.5.12 : http://hawt.io/ : Don't cha wish your console was hawt like me? ;-)
2020-09-25 06:21:46,090 INFO [io.hawt.jmx.UploadManager] Using file upload directory: /opt/master-broker/tmp/uploads
2020-09-25 06:21:46,100 INFO [io.hawt.web.AuthenticationFilter] Starting hawtio authentication filter, JAAS realm: "activemq" authorized role(s): "amq" role principal classes: "org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal"
2020-09-25 06:21:46,118 INFO [io.hawt.web.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/opt/master-broker/etc/jolokia-access.xml]
2020-09-25 06:21:46,133 INFO [io.hawt.web.RBACMBeanInvoker] Using MBean [hawtio:type=security,area=jmx,rank=0,name=HawtioDummyJMXSecurity] for role based access control
2020-09-25 06:21:46,207 INFO [io.hawt.system.ProxyWhitelist] Initial proxy whitelist: [localhost, 127.0.0.1, 172.16.20.129]
2020-09-25 06:21:46,377 INFO [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://0.0.0.0:8161
2020-09-25 06:21:46,377 INFO [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://0.0.0.0:8161/console/jolokia
2020-09-25 06:21:46,378 INFO [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://0.0.0.0:8161/console
从属代理的日志是
[root@devops-centos-2 bin]# ./artemis run
_ _ _
/ \ ____| |_ ___ __ __(_) _____
/ _ \| _ \ __|/ _ \ \/ | |/ __/
/ ___ \ | \/ |_/ __/ |\/| | |\___ \
/_/ \_\| \__\____|_| |_|_|/___ /
Apache ActiveMQ Artemis 2.15.0
2020-09-25 06:21:49,996 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server 2020-09-25 06:21:50,029 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)
2020-09-25 06:21:50,065 INFO [org.apache.activemq.artemis.core.server] AMQ221055: There were too many old replicated folders upon startup, removing /opt/slave-broker/data/journal/oldreplica.7
2020-09-25 06:21:50,066 INFO [org.apache.activemq.artemis.core.server] AMQ222162: Moving data directory /opt/slave-broker/data/journal to /opt/slave-broker/data/journal/oldreplica.9
2020-09-25 06:21:50,097 INFO [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal
2020-09-25 06:21:50,138 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 1,073,741,824
2020-09-25 06:21:50,310 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.loopback has been deprecated: enabled by default
2020-09-25 06:21:50,310 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.discard_incompatible_packets has been deprecated: incompatible packets are discarded anyway
2020-09-25 06:21:50,311 WARNING [org.jgroups.stack.Configurator] JGRP000014: TP.enable_bundling has been deprecated: will be ignored as bundling is on by default
2020-09-25 06:21:50,333 WARNING [org.jgroups.stack.Configurator] JGRP000014: UNICAST.setTimeout has been deprecated: not used anymore
2020-09-25 06:21:50,342 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin
2020-09-25 06:21:50,403 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin
-------------------------------------------------------------------
GMS: address=devops-centos-2-63024, cluster=active_broadcast_channel, physical address=172.16.24.85:43265
-------------------------------------------------------------------
2020-09-25 06:21:50,744 INFO [io.hawt.jmx.JmxTreeWatcher] Welcome to hawtio 1.5.12 : http://hawt.io/ : Don't cha wish your console was hawt like me? ;-) 2020-09-25 06:21:50,746 INFO [io.hawt.jmx.UploadManager] Using file upload directory: /opt/slave-broker/tmp/uploads
"org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal"
2020-09-25 06:21:50,778 INFO [io.hawt.web.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/opt/slave-broker/etc/jolokia-access.xml] 2020-09-25 06:21:50,880 INFO [io.hawt.system.ProxyWhitelist] Initial proxy whitelist: [localhost, 127.0.0.1, 172.16.24.85, devops-centos-2.xebialabs.com]
2020-09-25 06:21:51,057 INFO [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://0.0.0.0:8161
2020-09-25 06:21:51,057 INFO [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://0.0.0.0:8161/console/jolokia
2020-09-25 06:21:51,057 INFO [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://0.0.0.0:8161/console
2020-09-25 06:21:52,442 WARNING [org.jgroups.protocols.pbcast.FLUSH] devops-centos-2-63024: waiting for UNBLOCK timed out after 2000 ms
2020-09-25 06:21:52,458 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE 2020-09-25 06:21:52,458 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP 2020-09-25 06:21:52,458 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
2020-09-25 06:21:52,459 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT 2020-09-25 06:21:52,459 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
2020-09-25 06:21:52,459 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
此外,如果您的环境以某种方式阻止了UDP多播,那么无论ActiveMQ Artemis如何配置都无关紧要。您应该从等式中删除代理,并从基础架构的角度简单地解决这个问题。不幸的是,您提供的关于您的基础设施/环境的信息非常少,因此任何人都很难提供帮助。感谢@JustinBertram的快速响应。我已经提供了我为主代理和从代理所做的所有配置。从基础设施的角度来看,我尝试禁用防火墙和selinux,但复制没有发生。从日志中,我可以看到单独的主代理和从代理提前出现。但我看不到发布的live server或backup server等日志。您的JGroups配置正在使用
文件\u PING
。这不是使用UDP多播。此机制需要共享文件系统上的目录,两个代理都可以查看和使用该目录,或者两个代理必须在同一台机器上运行。您似乎不符合这两个要求,因此您的代理不会聚集在一起。如果需要UDP多播,为什么要使用文件\u PING
?如果只需要UDP多播进行群集,为什么不使用默认群集机制?为什么需要jgroup?为UDP多播无法工作的云用例添加了JGroups支持。我想使用JGroups而不是UDP多播进行集群。我这里没有使用udp协议