当前位置: 首页 > news >正文

Windows下activemq集群配置(broker-network)

1.activemq版本信息

activemq:apache-activemq-5.18.4

2.activemq架构

3.activemq集群配置

activemq集群配置基于Networks of Brokers

这种HA方案的优点:是占用的节点数更少(只需要2个节点),而且2个broker都可以响应消息的接收与发送。不足:2个broker接收的信息,彼此不会互相同步;当其中一个broker节点异常down而无法启动时,如果删除data目录下的文件,启动activemq时,其上的消息也就丢失了

以下操作,需要在两个节点进行操作

1.进入activemq conf目录,备份activemq.xml文件

2.编辑activemq.xml文件,增加如下配置

节点1:

#定义brokerName="activemq1"

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq1" dataDirectory="${activemq.data}">

#在is(192.168.10.129)服务器节点上进行配置(写入is-2:61616,is-2即:192.168.10.173)

 <networkConnectors>
            <networkConnector uri="static:(tcp://is-2:61616)" />
 </networkConnectors>

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq1" dataDirectory="${activemq.data}">
......<managementContext><managementContext createConnector="true" connectorPort="8899"/></managementContext><networkConnectors><networkConnector uri="static:(tcp://is-2:61616)" /></networkConnectors><!--Configure message persistence for the broker. The default persistencemechanism is the KahaDB store (identified by the kahaDB tag).For more information, see:http://activemq.apache.org/persistence.html--><persistenceAdapter><kahaDB directory="${activemq.data}/kahadb"/></persistenceAdapter>
......

节点2:

#定义brokerName="activemq2"

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq2" dataDirectory="${activemq.data}">

#在is-2(192.168.10.173)服务器节点上进行配置(写入is:61616,is即:192.168.10.129)

 <networkConnectors>
            <networkConnector uri="static:(tcp://is:61616)" />
 </networkConnectors>

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq2" dataDirectory="${activemq.data}">
......<managementContext><managementContext createConnector="false"/></managementContext><networkConnectors><networkConnector uri="static:(tcp://is:61616)" /></networkConnectors><!--Configure message persistence for the broker. The default persistencemechanism is the KahaDB store (identified by the kahaDB tag).For more information, see:http://activemq.apache.org/persistence.html--><persistenceAdapter><kahaDB directory="${activemq.data}/kahadb"/></persistenceAdapter>
......

3.hosts文件设置ip地址和主机名映射

节点1:

节点2:

4.配置完成后,分别启动activemq

节点1:

节点2:

5.验证

节点1:

日志

activemq控制台(http://ip:8161 (默认的账号:admin 默认密码:admin))

节点2:

日志

activemq控制台(http://ip:8161 (默认的账号:admin 默认密码:admin))

 

http://www.lryc.cn/news/386338.html

相关文章:

  • 心理辅导平台系统
  • 代理IP对SEO影响分析:提升网站排名的关键策略
  • 【leetcode--三数之和】
  • 解决Java中的ClassCastException问题
  • 【TensorFlow深度学习】混合生成模型:结合AR与AE的创新尝试
  • Spring:Spring中分布式事务解决方案
  • 音视频开发32 FFmpeg 编码- 视频编码 h264 参数相关
  • 标准版小程序订单中心path审核不通过处理教程
  • 移植对话框MFC
  • 【开源的字典项目】【macOS】:在macOS上能打开mdd and mdx 的github开源项目
  • 已解决javax.security.auth.login.LoginException:登录失败的正确解决方法,亲测有效!!!
  • 2741. 特别的排列 Medium
  • 读AI新生:破解人机共存密码笔记15辅助博弈
  • C++ 因项目需求,需要将0~2的32次方这个区间的数字保存到内存当中(内存大小为4G),并且可以实现对任意一个数字的增删。(先叙述设计思路,再写岀代码)
  • Linux 下的性能监控与分析技巧
  • 不可复制网站上的文字——2种方法
  • Ubuntu 22.04上编译安装c++ spdlog library
  • ESP32代码开发入门
  • “势”是“态”的偶然性减少
  • 人脑计算机技术与Neuroplatform:未来计算的革命性进展
  • 新版周易测算系统源码 去授权完美运行
  • 【PYTHON】力扣刷题笔记 -- 0053. 最大子数组和【中等】
  • Linux启动elasticsearch,提示权限不够
  • css 布局出现无法去除的空白
  • 使用SpringBoot整合filter
  • Python酷库之旅-第三方库openpyxl(15)
  • 葡萄串目标检测YoloV8——从Pytorch模型训练到C++部署
  • OpenAI推出自我改进AI- CriticGPT
  • springboot系列七: Lombok注解,Spring Initializr,yaml语法
  • 专访ATFX首席战略官Drew Niv:以科技创新引领企业高速发展