亿万流量消息中间件RocketMQ单机环境安装

亿万流量消息中间件RocketMQ单机环境安装_第1张图片

1、环境要求

  1. 64bit OS, Linux/Unix/Mac is recommended;

  2. 64bit JDK 1.8+;

  3. Maven 3.2.x;

  4. Git;

  5. 4g+ free disk for Broker server

  6. 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、发送消息验证
export NAMESRV_ADDR=localhost:9876

sh tools.sh org.apache.rocketmq.example.quickstart.Producer

sh tools.sh org.apache.rocketmq.example.quickstart.Consumer

7、关闭
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上传到服务器

如果要修改配置文件把application.properties放到同一目录,修改

rocketmq.config.namesrvAddr=namesrv服务地址(ip1:port;ip2:port)

启动 java -jar rocketmq-console-ng-1.0.0.jar &

本文由作者pm1280415703:JAVA实验手册 发布,交流群:583284584!

你可能感兴趣的:(亿万流量消息中间件RocketMQ单机环境安装)