1闪水、環(huán)境要求
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
JAVA_OPT="${JAVA_OPT} -server -Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
修改runbroker.sh
JAVA_OPT="${JAVA_OPT} -server -Xms512m -Xmx512m -Xmn256m"
修改tools.sh
JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx256m -Xmn128m -XX:PermSize=128m -XX:MaxPermSize=128m"
4、啟動Name Server
sh ./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粪狼、發(fā)送消息驗證
export NAMESRV_ADDR=localhost:9876
sh tools.sh org.apache.rocketmq.example.quickstart.Producer
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
7、關(guān)閉
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上傳到服務(wù)器
如果要修改配置文件把application.properties放到同一目錄,修改
rocketmq.config.namesrvAddr=namesrv服務(wù)地址(ip1:port;ip2:port)
啟動 java -jar rocketmq-console-ng-1.0.0.jar &
本文由作者pm1280415703:JAVA實驗手冊 發(fā)布,交流群:583284584再榄!