RocketMQ 參數詳解


   

NameServer配置屬性
參數名 參數類型 描述 默認參數(時間為單位ms,數據單位為byte)
rocketmqHome String RockerMQ主目錄,默認用戶主目錄  
namesrvAddr String NameServer地址  
kvConfigPath String kv配置文件路徑,包含順序消息主題的配置信息  
configStorePath String NameServer配置文件路徑,建議使用-c指定NameServer配置文件路徑  
clusterTest boolean 是否開啟集群測試,默認為false  
orderMessageEnable boolean 是否支持順序消息,默認為false  
NameServer、Broker、filter網絡配置屬性
accessMessageInMemoryMaxRatio int 訪問消息在內存中比率,默認為40 40
adminBrokerThreadPoolNums int 服務端處理控制台管理命令線程池線程數量 16
autoCreateSubscriptionGroup boolean 是否自動創建消費組 true
autoCreateTopicEnable boolean 是否自動創建主題 true
bitMapLengthConsumeQueueExt int ConsumeQueue擴展過濾bitmap大小 112
brokerClusterName String Broker集群名稱 TestCluster
brokerFastFailureEnable boolean 是否支持broker快速失敗 如果為true表示會立即清除發送消息線程池,消息拉取線程池中排隊任務 ,直接返回系統錯誤 true
brokerId int brokerID 0表示主節點 大於0表示從節點 0
brokerIP1 String Broker服務地址  
brokerIP2 String BrokerHAIP地址,供slave同步消息的地址  
brokerName String Broker服務器名稱morning服務器hostname broker-a
brokerPermission int Broker權限 默認為6表示可讀可寫 6
brokerRole enum broker角色,分為 ASYNC_MASTER SYNC_MASTER, SLAVE ASYNC_MASTER
brokerTopicEnable boolean broker名稱是否可以用做主體使用 true
channelNotActiveInterval long   60000
checkCRCOnRecover boolean 文件恢復時是否校驗CRC true
cleanFileForciblyEnable boolean 是否支持強行刪除過期文件 true
cleanResourceInterval int 清除過期文件線程調度頻率 10000
clientAsyncSemaphoreValue int   65535
clientCallbackExecutorThreads int   8
clientChannelMaxIdleTimeSeconds int   120
clientCloseSocketIfTimeout boolean   false
clientManagerThreadPoolQueueCapacity int 客戶端管理線程池任務隊列初始大小 1000000
clientManageThreadPoolNums int 服務端處理客戶端管理(心跳 注冊 取消注冊線程數量) 32
clientOnewaySemaphoreValue int   65535
clientPooledByteBufAllocatorEnable boolean   false
clientSocketRcvBufSize long 客戶端socket接收緩沖區大小 131072
clientSocketSndBufSize long 客戶端socket發送緩沖區大小 131072
clientWorkerThreads int   4
clusterTopicEnable boolean 集群名稱是否可用在主題使用 true
commercialBaseCount int   1
commercialBigCount int   1
commercialEnable boolean   true
commercialTimerCount int   1
commercialTransCount int   1
commitCommitLogLeastPages int 一次提交至少需要臟頁的數量,默認4頁,針對 commitlog文件 4
commitCommitLogThoroughInterval int Commitlog兩次提交的最大間隔,如果超過該間隔,將忽略commitCommitLogLeastPages直接提交 200
commitIntervalCommitLog int commitlog提交頻率 200
compressedRegister boolean   false
connectTimeoutMillis long 鏈接超時時間 3000
consumerFallbehindThreshold long 消息消費堆積閾值默認16GB在disableConsumeifConsumeIfConsumerReadSlowly為true時生效 17179869184
consumerManagerThreadPoolQueueCapacity int 消費管理線程池任務隊列大小 1000000
consumerManageThreadPoolNums int 服務端處理消費管理 獲取消費者列表 更新消費者進度查詢消費進度等  32
debugLockEnable boolean 是否支持 PutMessage Lock鎖打印信息 false
defaultQueryMaxNum int 查詢消息默認返回條數,默認為32 32
defaultTopicQueueNums int 主體在一個broker上創建隊列數量 8
deleteCommitLogFilesInterval int 刪除commitlog文件的時間間隔,刪除一個文件后等一下再刪除一個文件 100
deleteConsumeQueueFilesInterval int 刪除consumequeue文件時間間隔 100
deleteWhen String 磁盤文件空間充足情況下,默認每天什么時候執行刪除過期文件,默認04表示凌晨4點 04
destroyMapedFileIntervalForcibly int 銷毀MappedFile被拒絕的最大存活時間,默認120s。清除過期文件線程在初次銷毀mappedfile時,如果該文件被其他線程引用,引用次數大於0.則設置MappedFile的可用狀態為false,並設置第一次刪除時間,下一次清理任務到達時,如果系統時間大於初次刪除時間加上本參數,則將ref次數一次減1000,知道引用次數小於0,則釋放物理資源 120000
disableConsumeIfConsumerReadSlowly boolean 如果消費組消息消費堆積是否禁用該消費組繼續消費消息 false
diskFallRecorded boolean 是否統計磁盤的使用情況,默認為true true
diskMaxUsedSpaceRatio int commitlog目錄所在分區的最大使用比例,如果commitlog目錄所在的分區使用比例大於該值,則觸發過期文件刪除 75
duplicationEnable boolean 是否允許重復復制,默認為 false false
enableCalcFilterBitMap boolean 是否開啟比特位映射,這個屬性不太明白 false
enableConsumeQueueExt boolean 是否啟用ConsumeQueue擴展屬性 false
enablePropertyFilter boolean 是否支持根據屬性過濾 如果使用基於標准的sql92模式過濾消息則改參數必須設置為true false
endTransactionPoolQueueCapacity int 處理提交和回滾消息線程池線程隊列大小 100000
endTransactionThreadPoolNums int 處理提交和回滾消息線程池 24
expectConsumerNumUseFilter boolean 布隆過濾器參數 32
fastFailIfNoBufferInStorePool boolean 從 transientStorepool中獲取 ByteBuffer是否支持快速失敗 false
fetchNamesrvAddrByAddressServer boolean 是否支持從服務器獲取nameServer false
fileReservedTime String 文件保留時間,默認72小時,表示非當前寫文件最后一次更新時間加上filereservedtime小與當前時間,該文件將被清理 120
filterDataCleanTimeSpan long 清除過濾數據的時間間隔 86400000
filterServerNums int broker服務器過濾服務器數量 0
filterSupportRetry boolean 消息過濾是否支持重試 false
flushCommitLogLeastPages int 一次刷盤至少需要臟頁的數量,針對commitlog文件 4
flushCommitLogThoroughInterval int commitlog兩次刷盤的最大間隔,如果超過該間隔,將fushCommitLogLeastPages要求直接執行刷盤操作 10000
flushCommitLogTimed boolean 表示await方法等待FlushIntervalCommitlog,如果為true表示使用Thread.sleep方法等待 false
flushConsumeQueueLeastPages int 一次刷盤至少需要臟頁的數量,默認2頁,針對 Consume文件 2
flushConsumeQueueThoroughInterval int Consume兩次刷盤的最大間隔,如果超過該間隔,將忽略 60000
flushConsumerOffsetHistoryInterval int fushConsumeQueueLeastPages直接刷盤 60000
flushConsumerOffsetInterval int 持久化消息消費進度 consumerOffse.json文件的頻率ms 5000
flushDelayOffsetInterval long 延遲隊列拉取進度刷盤間隔。默認10s 10000
flushDiskType enum 刷盤方式,默認為 ASYNC_FLUSH(異步刷盤),可選值SYNC_FLUSH(同步刷盤) ASYNC_FLUSH
flushIntervalCommitLog int commitlog刷盤頻率 500
flushIntervalConsumeQueue int consumuQueue文件刷盤頻率 1000
flushLeastPagesWhenWarmMapedFile int 用字節0填充整個文件的,每多少頁刷盤一次。默認4096頁,異步刷盤模式生效 4096
forceRegister boolean 是否強制注冊 true
haHousekeepingInterval int Master與save長連接空閑時間,超過該時間將關閉連接 20000
haListenPort int Master監聽端口,從服務器連接該端口,默認為10912 10912
haMasterAddress String Master服務器IP地址與端口號  
haSendHeartbeatInterval int Master與Slave心跳包發送間隔 5000
haSlaveFallbehindMax int 允許從服務器落戶的最大偏移字節數,默認為256M。超過該值則表示該Slave不可用 268435456
haTransferBatchSize int 一次HA主從同步傳輸的最大字節長度,默認為32K 32768
heartbeatThreadPoolNums int 心跳線程池線程數 8
heartbeatThreadPoolQueueCapacity int 心跳線程隊列數量 50000
highSpeedMode boolean 當前版本未使用 false
listenPort int 服務端監聽端口 10911
longPollingEnable boolean 是否開啟長輪訓 true
mapedFileSizeCommitLog int 單個conmmitlog文件大小默認1GB 1073741824
mapedFileSizeConsumeQueue int 單個consumequeue文件大小默認30W*20表示單個Consumequeue文件中存儲30W個ConsumeQueue條目 6000000
mappedFileSizeConsumeQueueExt int ConsumeQueue擴展文件大小默認48MB 50331648
maxDelayTime int 當前版本未使用 40
maxErrorRateOfBloomFilter int 布隆過濾器參數 20
maxHashSlotNum int 單個索引文件hash槽的個數,默認為五百萬 5000000
maxIndexNum int 單個索引文件索引條目的個數,默認為兩千萬 20000000
maxMessageSize int 默認允許的最大消息體默認4M 4194304
maxMsgsNumBatch int 一次查詢消息最大返回消息條數,默認64條 64
maxTransferBytesOnMessageInDisk   一次服務消息端消息拉取,消息在磁盤中傳輸允許的最大字節 65536
maxTransferBytesOnMessageInMemory int 一次服務端消息拉取,消息在內存中傳輸允許的最大傳輸字節數默認256kb 262144
maxTransferCountOnMessageInDisk int 一次消息服務端消息拉取,消息在磁盤中傳輸允許的最大條數,默認為8條 8
maxTransferCountOnMessageInMemory int 一次服務消息拉取,消息在內存中傳輸運行的最大消息條數,默認為32條 32
messageDelayLevel String 延遲隊列等級(s=秒,m=分,h=小時) 1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
messageIndexEnable boolean 是否支持消息索引文件 true
messageIndexSafe boolean 消息索引是否安全,默認為 false,文件恢復時選擇文件檢測點(commitlog.consumeque)的最小的與文件最后更新對比,如果為true,文件恢復時選擇文件檢測點保存的索引更新時間作為對比 false
messageStorePlugIn String 消息存儲插件地址默認為空字符串  
namesrvAddr String nameServer地址  
notifyConsumerIdsChangedEnable   消費者數量變化后是否立即通知RebalenceService線程,以便馬上進行重新負載 true
offsetCheckInSlave boolean 從服務器是否堅持 offset檢測 false
osPageCacheBusyTimeOutMills long putMessage鎖占用超過該時間,表示 PageCache忙 1000
pullMessageThreadPoolNums int 服務端處理消息拉取線程池線程數量 默認為16加上當前操作系統CPU核數的兩倍 32
pullThreadPoolQueueCapacity int 消息拉去線程池任務隊列初始大小 100000
putMsgIndexHightWater int 當前版本未使用 600000
queryMessageThreadPoolNums int 服務端處理查詢消息線程池數量默認為8加上當前操作系統CPU核數的兩倍 16
queryThreadPoolQueueCapacity int 查詢消息線程池任務隊列初始大小 20000
redeleteHangedFileInterval int 重試刪除文件間隔,配合destorymapedfileintervalforcibly 120000
regionId String 消息區域 DefaultRegion
registerBrokerTimeoutMills int 注冊broker超時時間 6000
registerNameServerPeriod int broker注冊頻率 大於1分鍾為1分鍾小於10秒為10秒 30000
rejectTransactionMessage boolean 是否拒絕事物消息 false
rocketmqHome String RocketMQ主目錄 /home/rocketmq/rocketmq-all-4.3.2-bin-release
sendMessageThreadPoolNums int 服務端處理消息發送線程池數量 1
sendThreadPoolQueueCapacity int 消息發送線程池任務隊列初始大小 10000
serverAsyncSemaphoreValue int 異步消息發送最大並發度 64
serverCallbackExecutorThreads int netty public任務線程池個數,netty網絡設計沒根據業務類型會創建不同線程池毛筆如處理發送消息,消息消費心跳檢測等。如果業務類型(RequestCode)未注冊線程池,則由public線程池執行 0
serverChannelMaxIdleTimeSeconds int 網絡連接最大空閑時間。如果鏈接空閑時間超過此參數設置的值,連接將被關閉 120
serverOnewaySemaphoreValue int send oneway消息請求並發度 256
serverPooledByteBufAllocatorEnable boolean ByteBuffer是否開啟緩存 true
serverSelectorThreads int IO線程池線程個數,主要是NameServer.broker端解析請求,返回相應的線程個數,這類縣城主要是處理網絡請求的,解析請求包。然后轉發到各個業務線程池完成具體的業務無操作,然后將結果在返回調用方 3
serverSocketRcvBufSize int netty網絡socket接收緩存區大小16MB 131072
serverSocketSndBufSize int netty網絡socket發送緩存區大小16MB 131072
serverWorkerThreads int netty業務線程池個數 8
shortPollingTimeMills long 短輪訓等待時間 1000
slaveReadEnable boolean 從節點是否可讀 false
startAcceptSendRequestTimeStamp int   0
storePathCommitLog String Commitlog存儲目錄默認為${storePathRootDir}/commitlog /home/rocketmq/store/commitlog
storePathRootDir String broker存儲目錄 默認為用戶的主目錄/store /home/rocketmq/store
syncFlushTimeout long 同步刷盤超時時間 5000
traceOn boolean   true
transactionCheckInterval long 事物回查周期 60000
transactionCheckMax int 事物回查次數 15
transactionTimeOut long 事物回查超時時間 6000
transferMsgByHeap boolean 消息傳輸是否使用堆內存 true
transientStorePoolEnable boolean Commitlog是否開啟 transientStorePool機制,默認為 false false
transientStorePoolSize int transientStorePool中緩存 ByteBuffer個數,默認5個 5
useEpollNativeSelector boolean 是否啟用Epoll IO模型。Linux環境建議開啟 false
useReentrantLockWhenPutMessage boolean 消息存儲到commitlog文件時獲取鎖類型,如果為true使用ReentrantLock否則使用自旋鎖 false
useTLS boolean 是否使用安全傳輸層協議 false
waitTimeMillsInHeartbeatQueue long 清理broker心跳線程等待時間 31000
waitTimeMillsInPullQueue long 清除消息拉取線程池任務隊列的等待時間。如果系統時間減去任務放入隊列中的時間小於waitTimeMillsInPullQueue,本次請求任務暫時不移除該任務 5000
waitTimeMillsInSendQueue long 清除發送線程池任務隊列的等待時間。如果系統時間減去任務放入隊列中的時間小於waitTimeMillsInSendQueue,本次請求任務暫時不移除該任務 200
waitTimeMillsInTransactionQueue long 清理提交和回滾消息線程隊列等待時間 3000
warmMapedFileEnable boolean 是否溫和地使用 MappedFile如果為true,將不強制將內存映射文件鎖定在內存中 false
connectWhichBroker String FilterServer連接的Broker地址  
filterServerIP String FilterServerIP地址,默認為本地服務器IP  
compressMsgBodyOverHowmuch int 如果消息Body超過該值則啟用  
zipCompresslevel int Zip壓縮方式,默認為5,詳細定義請參考java.util.Deflate中的定義  
clientUploadFilterClassEnable boolean 是否支持客戶端上傳 FilterClass代碼  
filterClassRepertoryUrl String filterClass服務地址,如果 clientUploadFilterClassEnable為false,則需要提供一個地址從該服務器獲取過濾類的代碼  
fsServerAsyncSemaphorevalue int FilterServer異步請求並發度,默認為2048  
fsServerCallbackExecutorThreads int 處理回調任務的線程池數量,默認為64  
fsServerWorkerThreads int 遠程服務調用線程池數量,默認為64  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM