zoukankan      html  css  js  c++  java
  • Rocketmq 集群部署

    10.1.0.178 配置文件

    broker-a-m.properties

    brokerClusterName=PaymentCluster
    brokerName=broker-a
    namesrvAddr=10.1.0.178:9876;10.1.0.179:9876
    brokerId=0
    listenPort=10921
    brokerIP1=10.1.0.178
    deleteWhen=04
    fileReservedTime=72
    brokerRole=ASYNC_MASTER
    storePathRootDir=/data/rocketmq/a-m/rootdir
    storePathCommitLog=/data/rocketmq/a-m/commitlog
    defaultTopicQueueNums=4
    autoCreateTopicEnable=true
    autoCreateSubscriptionGroup=true
    flushDiskType=ASYNC_FLUSH

    10.1.0.179 配置文件

    broker-a-s.properties

    brokerClusterName=PaymentCluster
    brokerName=broker-a
    namesrvAddr=10.1.0.178:9876;10.1.0.179:9876
    brokerId=1
    listenPort=10911
    brokerIP1=10.1.0.179
    deleteWhen=04
    fileReservedTime=72
    brokerRole=SLAVE
    storePathRootDir=/data/rocketmq/a-s/rootdir
    storePathCommitLog=/data/rocketmq/a-s/commitlog
    defaultTopicQueueNums=4
    autoCreateTopicEnable=true
    autoCreateSubscriptionGroup=true
    flushDiskType=ASYNC_FLUSH

    在安装目录下创建启动脚本

    startNameServer.sh脚本

    #!/bin/bash

    mqLogDir=$ROCKETMQ_LOG
    if [ ! -n "$mqLogDir" ];then

    mqLogDir=`pwd`/logs
    fi
    echo $mqLogDir
    nohup bin/mqnamesrv >$mqLogDir/mqnamesrv.log 2>&1 &


    startBroker.sh脚本

    #!/bin/bash

    if [ ! -n "$1" ];then
    echo 'please specify config name'
    exit 1
    fi

    mqLogDir=`pwd`
    confFile=$mqLogDir/conf/$1.properties
    logFile=$mqLogDir/logs/$1.log
    echo $ROCKETMQ_LOG
    echo $confFile
    echo $logFile
    nohup bin/mqbroker -c $confFile > $logFile 2>&1 &

    官方配置启动内存为nameserver 4g, broker 8g, 如果需要可根据实际情况配置 runserver.sh和 runbroker.sh。

    开启

    sh startNameServer.sh
    sh startBroker.sh broker-a-m
    sh startBroker.sh broker-a-s

    关闭

    sh bin/mqshutdown broker
    sh bin/mqshutdown namesrv

    起开  rocketmq-console 监控后台

    nohup java -Xmx1024m -Drocketmq.namesrv.addr="172.16.235.105:9876;172.16.235.106:9876" -Dcom.rocketmq.sendMessageWithVIPChannel=false -jar rocketmq-console-ng-1.0.0.jar &

  • 相关阅读:
    Functional Programming Contest
    CodeChef--SEPT14小结
    Weekly 10 小结
    CSS中的 REM PX EM
    phoenegap3.5 采坑
    PPT插件 用js制作PPT
    js 代码命名规范系列
    文档列表
    mockjax MOCK.js的拦截ajax请求
    css Tab选项卡
  • 原文地址:https://www.cnblogs.com/fqybzhangji/p/11065648.html
Copyright © 2011-2022 走看看