博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
windows linux 环境rocketmq-all-4.4.0-source-release版本的启动详解
阅读量:7106 次
发布时间:2019-06-28

本文共 2586 字,大约阅读时间需要 8 分钟。

hot3.png

rocketmq-all-4.4.0-source-release版本的启动详解:

系统环境准备:

    安装64bit JDK 1.8+ 配置JAVA_HOME
    安装Maven 3.2.x 配置M2_HOME

1.windows环境:

    
    第一步:
        下载rocketmq-all-4.4.0-source-release.zip 源码。
        (https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.4.0/rocketmq-all-4.4.0-source-release.zip )
    第二步:
        解压rocketmq-all-4.4.0-source-release.zip到指定目录下
    第三步:
        打开cmd命令行窗口,进入到当前解压目录。
        > mvn -Prelease-all -DskipTests clean install -U
        > cd distribution/target/apache-rocketmq
    第四步:
        Start Name Server
        运行 \bin\mqnamesrv.cmd
        查看日志:C:\Users\Administrator\logs\rocketmqlogs\namesrv.log
        看到The Name Server boot success. 内容表明启动成功。
    第五步:
        Start Broker
        打开cmd> mqbroker.cmd -n localhost:9876
        查看日志:
        看到 The broker[USER-20160716AF, 192.168.209.1:10911] boot success. 内容表明启动成功。
    第六步:
        Send & Receive Messages 发送、接收信息
        
        设置环境变量:
        > set NAMESRV_ADDR=localhost:9876
        > tools.cmd org.apache.rocketmq.example.quickstart.Producer
        查看控制台日志输出“SendResult [sendStatus=SEND_OK, msgId=” 内容表明发送成功。
        
        > tools.cmd org.apache.rocketmq.example.quickstart.Consumer
        查看控制台日志输出“ConsumeMessageThread_1 Receive New Messages: [MessageExt“内容表明信息接收成功。
    第七步:
        卸载Apache RocketMQ:
        > mqshutdown.cmd broker
        > mqshutdown.cmd namesrv

2.linux环境:

    
    第一步:Download & Build from Release
    Click here to download the 4.4.0 source release. Also you could download a binary release from here.
    Now execute the following commands to unpack 4.4.0 source release and build the binary artifact.
    
    > unzip rocketmq-all-4.4.0-source-release.zip
    > cd rocketmq-all-4.4.0/
    > mvn -Prelease-all -DskipTests clean install -U
    > cd distribution/target/apache-rocketmq
    
    第二步:Start Name Server
     > nohup sh bin/mqnamesrv &
     > tail -f ~/logs/rocketmqlogs/namesrv.log
     The Name Server boot success...
    
    第三步:Start Broker
    > nohup sh bin/mqbroker -n localhost:9876 &
    > tail -f ~/logs/rocketmqlogs/broker.log 
    The broker[%s, 172.30.30.233:10911] boot success...
    
    第四步:Send & Receive Messages
    Before sending/receiving messages, we need to tell clients the location of name servers. RocketMQ provides multiple ways to achieve this. For simplicity, we use environment variable NAMESRV_ADDR
    
     > export NAMESRV_ADDR=localhost:9876
     > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
     SendResult [sendStatus=SEND_OK, msgId= ...

    > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

    ConsumeMessageThread_%d Receive New Messages: [MessageExt...
    
    第五步:Shutdown Servers
    > sh bin/mqshutdown broker
    The mqbroker(36695) is running...
    Send shutdown request to mqbroker(36695) OK

    > sh bin/mqshutdown namesrv

    The mqnamesrv(36664) is running...
    Send shutdown request to mqnamesrv(36664) OK
 

转载于:https://my.oschina.net/u/2607324/blog/3031471

你可能感兴趣的文章
管理CentOS常用指令
查看>>
23种设计模式的有趣见解
查看>>
Biztalk学习笔记1
查看>>
JavaScript入门篇 第二天(消息对话框+网页弹出)
查看>>
Redis Cluster
查看>>
[Reading]THIRD BASE
查看>>
高效上网教程---如何高效率收集高质量的信息
查看>>
php课程 6-21 HTML标签相关函数
查看>>
html5如何实现元素拖放
查看>>
Font Awesome 图标如何使用
查看>>
javascript创建对象的方法--工厂模式(非常好理解)
查看>>
amazeui页面分析4
查看>>
day9--paramiko模块
查看>>
多线程编程学习一(Java多线程的基础)
查看>>
CentOS6.5 升级 Python 2.7 版本
查看>>
lvs -dr
查看>>
亚马逊S3 - The difference between the request time and the current time is too large.
查看>>
问答:制造业转运营
查看>>
as3+java+mysql(mybatis) 数据自动工具(二)
查看>>
Hdu 4864(Task 贪心)(Java实现)
查看>>