中文文档
https://github.com/apache/rocketmq/tree/master/docs/cn
rocketmq官方案例
https://github.com/apache/rocketmq-spring/tree/master/rocketmq-spring-boot-samples
下载
地址:
http://rocketmq.apache.org/dowloading/releases/
说明:
安装的是4.7.0的版本,下载二进制包, 要有4G的内存可用。
设置JAVA_HOME环境变量
#查看全部的环境变量
env
echo $JAVA_HOME
which java ## 输出/usr/bin/java
ls -l /usr/bin/java
cd /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands
./java_home #输出 /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
vim ~/.bash_profile
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bash_profile
echo $JAVA_HOME
Start Name Server
nohup sh bin/mqnamesrv &
Start Broker
nohup sh bin/mqbroker -n localhost:9876 &
Shutdown Servers
sh bin/mqshutdown broker
sh bin/mqshutdown namesrv
安装可视化管理界面
下载地址:
https://github.com/apache/rocketmq-externals/tree/master/rocketmq-console
文档:
https://github.com/apache/rocketmq-externals/blob/master/rocketmq-console/doc/1_0_0/UserGuide_CN.md
1.用idea打开,修改 application.properties
#if this value is empty,use env value rocketmq.config.namesrvAddr NAMESRV_ADDR | now, you can set it in ops page.default localhost:9876
rocketmq.config.namesrvAddr=127.0.0.1:9876
2.maven 打包
mvn clean package -Dmaven.test.skip=true
nohup java -jar \
-Drocketmq.config.namesrvAddr=192.168.28.130:9876 \
-Drocketmq.config.isVIPChannel=false \
rocketmq-console-ng-1.0.0.jar &
参考:
http://rocketmq.apache.org/docs/quick-start/
https://blog.csdn.net/a158123/article/details/79684499
https://www.jianshu.com/p/56439fb70fbd
网友评论