一、環境要求java
-
64bit OS, Linux/Unix/Mac is recommended;git
-
64bit JDK 1.8+;github
-
Maven 3.2.x;web
-
Git;apache
-
4g+ free disk for Broker server服務器
-
RocketMQ 4.6.0app
二、下載 wget https://www-eu.apache.org/dist/rocketmq/4.6.0/rocketmq-all-4.6.0-bin-release.zipmaven
下載資源包ui
wget https://archive.apache.org/dist/rocketmq/4.6.0/rocketmq-all-4.6.0-source-release.zipspa
三、解壓 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.一、修改配置 修改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"
四、啓動Name Server sh ./bin/mqnamesrv &
日誌
tail -f ~/logs/rocketmqlogs/namesrv.log
五、啓動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
六、發送消息驗證 export NAMESRV_ADDR=localhost:9876
sh tools.sh org.apache.rocketmq.example.quickstart.Producer
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
七、關閉 sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
八、安裝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 & > 本文由做者pm1024:JAVA實驗手冊 發佈,交流:583284584!