• 关于rocketmq的配置启动


    #集群名称
    brokerClusterName=rocket-nameserver
    #broker-a,注意其它两个分别为broker-b和broker-c
    brokerName=broker-a
    #brokerId等于0表示是MASTER节点,小于0是SLAVE节点,我这里全设置成主节点
    brokerId=0
    deleteWhen=04
    fileReservedTime=48
    #配置nameserver地址,多台以;分割:
    namesrvAddr=rocket-nameserver-01:9876;rocket-nameserver-02:9876;rocket-nameserver-03:9876
    #存储路径
    storePathRootDir=/opt/rocketmq432/store
    #commitlog存储路径
    storePathCommitLog=/opt/rocketmq432/store/commitlog
    #消息队列
    storePathConsumeQueue=/opt/rocketmq432/store/consumequeue
    #消息索引
    storePathIndex=/opt/rocketmq432/store/index
    #checkpoint文件存储过径
    storeCheckpoint=/opt/rocketmq432/store/checkpoint
    #abort文件存储路径
    abortFile=/opt/rocketmq432/store/abort
    #限制的消息大小
    maxMessageSize=65536
    #角色和刷盘方式
    brokerRole=ASYNC_MASTER
    flushDiskType=ASYNC_FLUSH

    启动a:
    1. nohup sh mqnamesrv &

    2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-a.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &

    启动b:
    1. nohup sh mqnamesrv &

    2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-b.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &

    启动c:

    1. nohup sh mqnamesrv &

    2. nohup sh mqbroker -c /opt/rocketmq432/conf/2m-noslave/broker-c.properties autoCreateTopicEnable=true >/tmp/logs/mq.log 2>&1 &


    停止服务:
    先执行: sh mqshutdown broker

    再执行: sh mqshutdown namesrv

    消息队列样例测试导入:

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

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

  • 相关阅读:
    【Forza Horizon 5】频繁断网解决办法
    【Java】java.util.ConcurrentModificationException
    【MySQL】下发功能SQL
    【MybatisPlus】 Field '主键' doesn't have a default value
    【SpringBoot】数据源加密处理
    【VMware】将NAT虚拟机开放访问
    TreeView绑定数据库收藏
    存储过程概述
    asp.net页面直接输出纯xml
    如何保证远程登录服务器安全
  • 原文地址:https://www.cnblogs.com/lhlucky/p/10767534.html
Copyright © 2020-2023  润新知