环境要求

  1. 64bit JDK 1.8+;
  2. Maven 3.2.x;
  3. Git;
  4. 4g+ free disk for Broker server

下载安装

  1. unzip rocketmq-all-4.3.2-source-release.zip
  2. cd rocketmq-all-4.3.2/
  3. mvn -Prelease-all -DskipTests clean install -U
  4. cd distribution/target/apache-rocketmq

服务启动、停止

  1. ## Start NameServer
  2. nohup sh bin/mqnamesrv &
  3. tail -f ~/logs/rocketmqlogs/namesrv.log
  4. ## Start Broker
  5. nohup sh bin/mqbroker -n localhost:9876 &
  6. tail -f ~/logs/rocketmqlogs/broker.log
  7. ## Shutdown Broker
  8. sh bin/mqshutdown broker
  9. ## Shutdown NameServer
  10. sh bin/mqshutdown namesrv

示例运行

  1. export NAMESRV_ADDR=localhost:9876
  2. sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
  3. sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

docker 安装

  1. https://github.com/apache/rocketmq-externals/tree/master/rocketmq-docker
  2. sh play-docker.sh
  3. docker start mqnamesrv | mqbroker
  4. # 控制台安装
  5. docker run -e "JAVA_OPTS=-Drocketmq.namesrv.addr=127.0.0.1:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -p 8080:8080 -t styletang/rocketmq-console-ng