环境介绍:
- CentOS Linux release 7.3.1611 (Core)
- jdk8(详细安装教程:https://blog.csdn.net/Cavan_C/article/details/108617291)
- maven3.5.4(详细安装教程:https://blog.csdn.net/Cavan_C/article/details/108583840)
下载rocketmq:
- 创建rocketmq目录
mkdir /opt/rocketmq
- 进入rocketmq目录
cd /opt/rocketmq
- 下载rocketmq安装文件
wget http://mirrors.hust.edu.cn/apache/rocketmq/4.7.1/rocketmq-all-4.7.1-bin-release.zip
- 解压rocketmq安装文件并移动至/opt/rocketmq目录下
unzip rocketmq-all-4.7.1-bin-release.zip
mv rocketmq-all-4.7.1-bin-release/* /opt/rocketmq/
-
编译rocketmq:
cd /opt/rocketmq
mvn -Prelease-all -DskipTests clean install -U # 使用mvn编译
配置修改:
- runserver.sh
- runbroker.sh
启动:
- nameserver
nohup sh bin/mqnamesrv &
查看日志文件,输出以下信息表示启动成功
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: MaxNewSize (524288k) is equal to or greater than the entire heap (524288k). A new max generation size of 524224k will be used.
The Name Server boot success. serializeType=JSON
- broker
nohup sh bin/mqbroker -c ./conf/broker.conf -n 192.168.189.135:9876 &
查看日志文件,输出以下信息表示启动成功
The broker[broker-a, 192.168.189.135:10911] boot success. serializeType=JSON and name server is 192.168.189.135:9876