cd /Users/xguo/Documents/java/rocketmq-4.9.3/bin
nohup sh mqnamesrv &
ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! !!
进入runserver.sh 和 runbroker.sh,修改JAVA_HOME指定位置
#[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java
[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/Users/xguo/Library/Java/JavaVirtualMachines/azul-1.8.0_322/Contents/Home/
#[ ! -e "$JAVA_HOME/bin/java" ] && error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)!"
OpenJDK 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
OpenJDK 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
The Name Server boot success. serializeType=JSON
提示成功启动了,不过因为jdk版本的问题有警告⚠️,暂时忽略。
nohup sh mqbroker -n localhost:9876 &
The broker[kuaiyalundeMacBook-Pro.local, 172.20.10.2:10911] boot success. serializeType=JSON and name server is localhost:9876
启动成功。
tail -f ~/logs/rocketmqlogs/namesrv.log
tail -f ~/logs/rocketmqlogs/broker.log
jps
# 进入目录
cd /Users/xguo/Documents/java/rocketmq-4.9.3/bin
# 设置环境变量
export NAMESRV_ADDR=localhost:9876
# 通过 bin 目录下的 tools.sh 脚本,使用安装包的Demo发送消息
sh tools.sh org.apache.rocketmq.example.quickstart.Producer
ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! !!
按照上面的解决方法处理即可。
# 进入目录
cd /Users/xguo/Documents/java/rocketmq-4.9.3/bin
# 设置环境变量
export NAMESRV_ADDR=localhost:9876
# 接收消息
sh tools.sh org.apache.rocketmq.example.quickstart.Consumer
sh mqshutdown namesrv
sh mqshutdown broker