一、RocketMQ简介
RocketMQ是由阿里捐赠给Apache的一款低延迟、高并发、高可用、高可靠的分布式消息中间件。经历了淘宝双十一的洗礼。RocketMQ既可为分布式应用系统提供异步解耦和削峰填谷的能力,同时也具备互联网应用所需的海量消息堆积、高吞吐、可靠重试等特性。
二、安装RocketMQ-Dashboard
1 、下载源代码
[root@localhost ~]# wget https://github.com/apache/rocketmq-dashboard/archive/refs/tags/rocketmq-dashboard-1.0.0.zip
[root@localhost ~]# unzip rocketmq-dashboard-1.0.0.zip
2 、安装Maven
[root@localhost ~]# wget https://dlcdn.apache.org/maven/maven-3/3.9.3/binaries/apache-maven-3.9.3-bin.zip
[root@localhost ~]# unzip apache-maven-3.9.3-bin.zip
[root@localhost ~]# mv apache-maven-3.9.3 /usr/local/maven
[root@localhost ~]# ln -sf /usr/local/maven/bin/mvn /usr/bin/
3 、开启登录验证
[root@localhost ~]# cd rocketmq-dashboard-rocketmq-dashboard-1.0.0/src/main/resources
[root@localhost resources]# sed -i '/rocketmq.config.loginRequired/s/false/true/' application.properties
4 、配置用户名和密码
默认配置
|------------------------------------------------------------------------| | # Define Admin admin=Aa123456,1 # Define Users user1=user1 user2=user2 |
注:默认用户名密码admin,这里修改admin密码为Aa123456(线上使用请使用复杂密码)
[root@localhost resources]# vim users.properties
|---------------------------------| | # Define Admin admin=Aa123456,1 |
注:配置格式为:用户名=密码
5 、代码编译
[root@localhost resources]# cd ~/rocketmq-dashboard-rocketmq-dashboard-1.0.0
[root@localhost rocketmq-dashboard-rocketmq-dashboard-1.0.0]# mvn clean package -Dmaven.test.skip=true
6 、启动RocketMQ-Dashboard
[root@localhost rocketmq-dashboard-rocketmq-dashboard-1.0.0]# cd target
[root@localhost target]# nohup java -jar rocketmq-dashboard-1.0.0.jar &
7 、访问RocketMQ-Dashboard
1)浏览器访问http://192.168.56.138:8080/,如下图所示
2)登录RocketMQ-Dashboard
3)连接RocketMQ
4)切换中文语言
5)创建Topic
6)发送消息
向指定Topic发送消息
发送结果
历史上的今天
7 月
6