1、环境要求
- 64bit OS, Linux/Unix/Mac is recommended;
- 64bit JDK 1.8 ;
- Maven 3.2.x;
- Git;
- 4g free disk for Broker server
- RocketMQ 4.6.0
2、下载wget https://www-eu.apache.org/dist/rocketmq/4.6.0/rocketmq-all-4.6.0-bin-release.zip
下载资源包
wget https://archive.apache.org/dist/rocketmq/4.6.0/rocketmq-all-4.6.0-source-release.zip
3、解压release版本
unzip rocketmq-all-4.6.0-bin-release.zip
cd rocketmq-all-4.6.0-bin-release
资源包方式
mvn -Prelease-all -DskipTests clean install -U
3.1、修改配置修改runserver.sh
JAVAOPT="${JAVAOPT} -server -Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
修改runbroker.sh
JAVAOPT="${JAVAOPT} -server -Xms512m -Xmx512m -Xmn256m"
修改tools.sh
JAVAOPT="${JAVAOPT} -server -Xms256m -Xmx256m -Xmn128m -XX:PermSize=128m -XX:MaxPermSize=128m"
4、启动Name Serversh ./bin/mqnamesrv &
日志
tail -f ~/logs/rocketmqlogs/namesrv.log
5、启动Borker添加
vi ./conf/broker.conf
namesrvAddr=192.168.136.200:9876
brokerIP1=192.168.136.200
sh ./bin/mqbroker -n 192.168.136.200:9876 autoCreateTopicEnable=true -c /usr/local/soft/rocketmq/rocketmq-all-4.6.0-bin-release/conf/broker.conf &
日志
tail -f ~/logs/rocketmqlogs/broker.log
6、发送消息验证export NAMESRV_ADDR=localhost:9876
sh tools.sh org.apache.rocketmq.example.quickstart.Producer
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
7、关闭sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
8、安装web界面下载 wget https://github.com/apache/rocketmq-externals/releases
mvn clean package -Dmaven.test.skip=true打包
rocketmq-console-ng-1.0.0.jar上传到服务器
如果要修改配置文件把application.properties放到同一目录,修改
rocketmq.config.namesrvAddr=namesrv服务地址(ip1:port;ip2:port)
启动 java -jar rocketmq-console-ng-1.0.0.jar &
本文由作者pm1280415703:JAVA实验手册 发布,交流群:583284584!