消息中间件activemq-5.14.1安全验证配置
activemq分为控制端和客户端,下面分别介绍安全认证配置方法。
1.控制端安全配置
(1). ActiveMQ目录conf下找到jetty.xml:
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint"><property name="name" value="BASIC" /><property name="roles" value="user,admin" /><!-- set authenticate=false to disable login --><property name="authenticate" value="true" /> </bean>
含义:
<property name="authenticate" value="true" /> true:需要认证; false:不需要认证
(2). ActiveMQ目录conf下找到jetty-realm.properties
# username: password [,rolename ...] admin: admin123, admin user: user, user
说明:
第一个admin,为认证用户名。
第二个admin123,为认证密码。
第三个admin,为角色。
(3). 重启ActiveMQ验证是否需要认证
重启activemq后,访问:http://127.0.0.1:8161/admin/,弹出http基本认证框,这时候认证生效。
1.客户端安全配置
(1). 解压目录/conf/activemq.xml的broken中添加:
<plugins><!-- use JAAS to authenticate using the login.config file on the classpath to configure JAAS --> <!-- 添加jaas认证插件activemq在login.config里面定义,详细见login.config--> <jaasAuthenticationPlugin configuration="activemq" />
<!-- lets configure a destination based authorization mechanism --><authorizationPlugin><map><authorizationMap><authorizationEntries><authorizationEntry topic=">" read="admins" write="admins" admin="admins" /><authorizationEntry queue=">" read="admins" write="admins" admin="admins" /> <!--authorizationEntry topic="FirstTopic" read="smeall,smeadmin" write="smeadmin" admin="smeall,smeadmin" /--><authorizationEntry topic="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/><authorizationEntry queue="ActiveMQ.Advisory.>" read="admins" write="admins" admin="admins"/></authorizationEntries></authorizationMap></map></authorizationPlugin></plugins>
若是集群则broken中继续添加:
<networkConnectors><networkConnector userName="用户名" password="密码" uri="static:(tcp://localhost:61616)" duplex="true"/></networkConnectors>
此配置可以忽略掉
(2). 解压目录/conf/login.config中:
activemq{org.apache.activemq.jaas.PropertiesLoginModule requireddebug=trueorg.apache.activemq.jaas.properties.user="users.properties" org.apache.activemq.jaas.properties.group="groups.properties"; };
(3). 解压目录/conf/groups.properties中:
admins=用户名
(4). 解压目录/conf/users.properties中:
用户名=密码
三。其他配置说明
除了安全验证的配置需要我们理解,还有一部分配置需要理解:
<transportConnectors><!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB --><transportConnector name="openwire" uri="tcp://10.8.0.1:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="amqp" uri="amqp://10.8.0.1:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="stomp" uri="stomp://10.8.0.1:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="mqtt" uri="mqtt://10.8.0.1:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/><transportConnector name="ws" uri="ws://10.8.0.1:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/></transportConnectors>
上述中的
name="openwire" uri="tcp://10.8.0.1:61616?ma name="amqp" uri="amqp://10.8.0.1:5672?max其中 tcp:// 和 amqp:// 这都是指协议,而name是随意定义的,但是这个name是在管理url界面中显示的,如图:
# cat /etc/hosts ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 quanli_dev02.fistforward.com 10.8.0.1 quanli_dev02.fistforward.com
# cat /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no PEERNTP=no GATEWAY=10.8.3.253 HOSTNAME=quanli_dev02.fistforward.com
消息中间件activemq-5.14.1安全验证配置相关推荐
- 消息中间件-Activemq之Broker-Cluster
2019独角兽企业重金招聘Python工程师标准>>> 接着上一篇消息中间件-Activemq之Master-Slaver,下面看看Broker-Cluster实现负载均衡 Brok ...
- 消息中间件activeMQ原理和使用
一: 消息中间件的优势 1.使用消息中间件,降低了dubbo服务之间的耦合度,使得两个原本使用远程注入耦合了的模块可以实现松耦合,使用消息中间件进了间接通信. 2.缓冲能力,消息中间件 ...
- 安装Nginx1.14.2过程及配置
CentOS7.4安装Nginx1.14.2过程及配置 安装make: yum -y install gcc automake autoconf libtool make 安装g++: yum ...
- ActiveMQ的几种集群配置
ActiveMQ是一款功能强大的消息服务器,它支持许多种开发语言,例如Java, C, C++, C#等等.企业级消息服务器无论对服务器稳定性还是速度,要求都很高,而ActiveMQ的分布式集群则能很 ...
- 消息中间件ActiveMQ、RabbitMQ、RocketMQ、ZeroMQ、Kafka如何选型
转载自 消息中间件ActiveMQ.RabbitMQ.RocketMQ.ZeroMQ.Kafka如何选型? 最近要为公司的消息队列中间件进行选型,市面上相关的开源技术又非常多,如ActiveMQ.Ra ...
- Linux部署Apache ActiveMQ 5.14.1
Linux部署Apache ActiveMQ 5.14.1 简单记一下,下载地址 http://activemq.apache.org/download.html 一.安装JDK7以上,官方说明:ht ...
- 数据科学 IPython 笔记本 8.14 自定义 Matplotlib:配置和样式表
8.14 自定义 Matplotlib:配置和样式表 原文:Customizing Matplotlib: Configurations and Stylesheets 译者:飞龙 协议:CC BY- ...
- 2.14 加载Firefox配置
2.14 加载Firefox配置(略,已在2.1.8讲过,请查阅2.1.8节课) 回到顶部 2.14-1 加载Chrome配置 一.加载Chrome配置 chrome加载配置方法,只需改下面一个地方, ...
- aws rds监控慢sql_AWS RDS SQL Server中的初始Windows身份验证配置
aws rds监控慢sql In this article, we will be exploring the process of enabling Windows authentication i ...
最新文章
- android studio快捷键大全
- getdc 与getwindowDc的区别,loadbitmap 与loadimage的区别
- maven配置testng_TestNG和Maven配置指南
- 前端学习(2751):uni-app目录设置
- 接口测试 java_接口测试--Java
- NGUI里的sprite和label有白色的边框
- 《Google Go: A Primer》学习笔记
- idea中 Application Server not specified
- 【HTML练习】登录注册界面模板1
- Python 监控linux之dstat
- IT服务体系工具支撑
- matlab tdb,计算相图中的TDB文件 - 计算模拟 - 小木虫 - 学术 科研 互动社区
- 使用Spring 定时器 + selenium打卡
- 织梦模板下载:驾驶学校汽车类行业网站织梦模板
- phpStrom 连接数据库时报错:Uncaught Error: Class ‘mysqli‘ not found in
- unkown the request
- 请问打开PB时出现其停止工作的提示,如何处理?
- 在word里按空格键文字不能向后移动
- 新冠无情人有情,ONV助力打造电子防控后盾
- html 网页自动关闭,网页自动关闭怎么回事 怎么解决【图解】