rocketmq broker 配置 说明

各种组件安装

2019-03-24

58

0

技术:rocketmq

运行环境:centos7.3

demo功能:提供一个rocketmq broker配置说明

配置文件

master:

brokerName=broker name
brokerId=0=master,1=slave
brokerRole=ASYNC_MASTER
namesrvAddr=127.0.0.1:9876;127.0.0.2:9876
flushDiskType=ASYNC_FLUSH
fileReservedTime=168
deleteWhen=04
autoCreateTopicEnable=false
storePathCommitLog=/data/mqqqqq/commitlog
rejectTransactionMessage=true
storePathRootDir=/data/mqqqqq
cleanFileForciblyEnable=true
autoCreateSubscriptionGroup=false
brokerClusterName=mqqqqq-cluster-1
brokerIP1=broker ip


slave:
brokerName=broker name
brokerId=0=master,1=slave
brokerRole=SLAVE
namesrvAddr=127.0.0.1:9876;127.0.0.2:9876
flushDiskType=ASYNC_FLUSH
fileReservedTime=168
deleteWhen=04
autoCreateTopicEnable=false
storePathCommitLog=/data/mqqqqq/commitlog
rejectTransactionMessage=true
storePathRootDir=/data/mqqqqq
cleanFileForciblyEnable=true
autoCreateSubscriptionGroup=false
brokerClusterName=mqqqqq-cluster-1
brokerIP1=broker ip

部分参数说明

namesrvAddr   name server 地址
brokerIP1 本机ip 本机IP地址,默认系统自动识别,但是某些多网卡机器会存在识别错误的情况,这种情况下可以人工配置
brokerName 本机主机名  
brokerClusterName DefaultCluster Broker 所属的集群
brokerId 0 BrokerId,必须是大等于0的整数,0表示Master,>0表示Slave,一个Master可以挂多个Slave,Master与Slave通过BrokerName来配对
autoCreateTopicEnable true 是否允许Broker自动创建Topic,建议线下开启,线上关闭
autoCreateSubscriptionGroup true 是否允许Broker自动创建订阅组,建议线下开启,线上关闭
rejectTransactionMessage false 是否拒绝事务消息接入
fetchNamesrvAddrByAddressServer false 是否从web服务器获取Name Server地址,针对大规模的Broker集群建议使用这种方式
storePathRootDir ~/store 数据存放的根路径
storePathCommitLog ~/store/commitlog commitLog存储路径
flushIntervalCommitLog 500 CommitLog刷盘间隔时间(单位毫秒)
commitIntervalCommitLog 200

Only used if TransientStorePool enabled,flush data to FileChannel

flushCommitLogTimed false 是否定时方式刷盘,默认是实时刷盘
deleteWhen 04 何时触发删除文件, 默认凌晨4点删除文件
fileReservedTime 72 文件保留时间(单位小时)
maxTransferBytesOnMessageInMemory 262144 (256K) 单次最大被拉取的消息字节数,消息在内存
maxTransferCountOnMessageInMemory 32 单次最大被拉取的消息个数,消息在内存
maxTransferBytesOnMessageInDisk 65536 (64K) 单次最大被拉取的消息字节数,消息在磁盘
maxTransferCountOnMessageInDisk 8 单次最大被拉取的消息个数,消息在磁盘
accessMessageInMemoryMaxRatio 40 命中消息在内存的最大比例
messageIndexEnable true 是否开启消息索引功能
messageIndexSafe fasle 是否使用安全的消息索引功能,即可靠模式。可靠模式下,异常宕机恢复慢;非可靠模式下,异常宕机恢复快
haMasterAddress   在 Slave 上直接设置 Master 地址,默认从 Name Server 上自动获取,也可以手工强制配置
brokerRole ASYNC_MASTER

Broker 的角色

- ASYNC_MASTER 异步复制 master

- SYNC_MASTER 同步双写 master

- SLAVE

flushDiskType ASYNC_FLUSH

刷盘方式

- SYNC_FLUSH 同步刷盘

- ASYNC_FLUSH 异步刷盘

cleanFileForciblyEnable true 磁盘满(90%)、且无过期文件的情况下,TRUE 表示强制删除文件,优先保证服务可用;FALSE 表示服务不可用,文件不删除
transientStorePoolEnable false
Enable transient commitLog store poll only if transientStorePoolEnable is true and the FlushDiskType is ASYNC_FLUSH

全部参数

rocketmqHome=/apache-rocketmq
namesrvAddr=
brokerIP1=192.168.23.149
brokerIP2=192.168.23.149
brokerName=bogon
brokerClusterName=DefaultCluster
brokerId=0
brokerPermission=6
defaultTopicQueueNums=8
autoCreateTopicEnable=true
clusterTopicEnable=true
brokerTopicEnable=true
autoCreateSubscriptionGroup=true
messageStorePlugIn=
sendMessageThreadPoolNums=1
pullMessageThreadPoolNums=32
adminBrokerThreadPoolNums=16
clientManageThreadPoolNums=32
consumerManageThreadPoolNums=32
flushConsumerOffsetInterval=5000
flushConsumerOffsetHistoryInterval=60000
rejectTransactionMessage=false
fetchNamesrvAddrByAddressServer=false
sendThreadPoolQueueCapacity=10000
pullThreadPoolQueueCapacity=100000
clientManagerThreadPoolQueueCapacity=1000000
consumerManagerThreadPoolQueueCapacity=1000000
filterServerNums=0
longPollingEnable=true
shortPollingTimeMills=1000
notifyConsumerIdsChangedEnable=true
highSpeedMode=false
commercialEnable=true
commercialTimerCount=1
commercialTransCount=1
commercialBigCount=1
commercialBaseCount=1
transferMsgByHeap=true
maxDelayTime=40
regionId=DefaultRegion
registerBrokerTimeoutMills=6000
slaveReadEnable=false
disableConsumeIfConsumerReadSlowly=false
consumerFallbehindThreshold=17179869184
waitTimeMillsInSendQueue=200
startAcceptSendRequestTimeStamp=0
traceOn=true
enableCalcFilterBitMap=false
expectConsumerNumUseFilter=32
maxErrorRateOfBloomFilter=20
filterDataCleanTimeSpan=86400000
filterSupportRetry=false
enablePropertyFilter=false
listenPort=10911
serverWorkerThreads=8
serverCallbackExecutorThreads=0
serverSelectorThreads=3
serverOnewaySemaphoreValue=256
serverAsyncSemaphoreValue=64
serverChannelMaxIdleTimeSeconds=120
serverSocketSndBufSize=131072
serverSocketRcvBufSize=131072
serverPooledByteBufAllocatorEnable=true
useEpollNativeSelector=false
clientWorkerThreads=4
clientCallbackExecutorThreads=8
clientOnewaySemaphoreValue=65535
clientAsyncSemaphoreValue=65535
connectTimeoutMillis=3000
channelNotActiveInterval=60000
clientChannelMaxIdleTimeSeconds=120
clientSocketSndBufSize=131072
clientSocketRcvBufSize=131072
clientPooledByteBufAllocatorEnable=false
clientCloseSocketIfTimeout=false
storePathRootDir=/Users/store
storePathCommitLog=/Users/store/commitlog
mapedFileSizeCommitLog=1073741824
mapedFileSizeConsumeQueue=6000000
enableConsumeQueueExt=false
mappedFileSizeConsumeQueueExt=50331648
bitMapLengthConsumeQueueExt=64
flushIntervalCommitLog=500
commitIntervalCommitLog=200
useReentrantLockWhenPutMessage=false
flushCommitLogTimed=false
flushIntervalConsumeQueue=1000
cleanResourceInterval=10000
deleteCommitLogFilesInterval=100
deleteConsumeQueueFilesInterval=100
destroyMapedFileIntervalForcibly=120000
redeleteHangedFileInterval=120000
deleteWhen=04
diskMaxUsedSpaceRatio=75
fileReservedTime=72
putMsgIndexHightWater=600000
maxMessageSize=4194304
checkCRCOnRecover=true
flushCommitLogLeastPages=4
commitCommitLogLeastPages=4
flushLeastPagesWhenWarmMapedFile=4096
flushConsumeQueueLeastPages=2
flushCommitLogThoroughInterval=10000
commitCommitLogThoroughInterval=200
flushConsumeQueueThoroughInterval=60000
maxTransferBytesOnMessageInMemory=262144
maxTransferCountOnMessageInMemory=32
maxTransferBytesOnMessageInDisk=65536
maxTransferCountOnMessageInDisk=8
accessMessageInMemoryMaxRatio=40
messageIndexEnable=true
maxHashSlotNum=5000000
maxIndexNum=20000000
maxMsgsNumBatch=64
messageIndexSafe=false
haListenPort=10912
haSendHeartbeatInterval=5000
haHousekeepingInterval=20000
haTransferBatchSize=32768
haMasterAddress=
haSlaveFallbehindMax=268435456
brokerRole=ASYNC_MASTER
flushDiskType=ASYNC_FLUSH
syncFlushTimeout=5000
messageDelayLevel=1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
flushDelayOffsetInterval=10000
cleanFileForciblyEnable=true
warmMapedFileEnable=false
offsetCheckInSlave=false
debugLockEnable=false
duplicationEnable=false
diskFallRecorded=true
osPageCacheBusyTimeOutMills=1000
defaultQueryMaxNum=32
transientStorePoolEnable=false
transientStorePoolSize=5
fastFailIfNoBufferInStorePool=false
 

欢迎添加微信,互相学习↑↑↑ -_-

发表评论

全部评论:0条

白老虎

programming is not only to solve problems, ways to think