mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-01 15:47:01 +08:00
RIP-9 RocketMQ Develop Guide: add description section for broker configuration
This commit is contained in:
+18
-12
@@ -176,11 +176,24 @@ msgId一定是全局唯一标识符,但是实际使用中,可能会存在相
|
||||
### 3.2 FlushDiskType
|
||||
SYNC_FLUSH(同步刷新)相比于ASYNC_FLUSH(异步处理)会损失很多性能,但是也更可靠,所以需要根据实际的业务场景做好权衡。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### 3.3 Broker配置
|
||||
|
||||
| 参数名 | 默认值 | 说明 |
|
||||
| -------------------------------- | ----------------------------- | ------------------------------------------------------------ |
|
||||
| listenPort | 10911 | 接受客户端连接的监听端口 |
|
||||
| namesrvAddr | null | nameServer 地址 |
|
||||
| brokerIP1 | 网卡的InetAddress | 当前broker监听的IP |
|
||||
| brokerIP2 | 跟brokerIP1一样 | 存在broker主从时,在broker主节点上配置了brokerIP2的话,broker从节点会连接主节点配置的brokerIP2来同步 |
|
||||
| brokerName | null | broker 名 |
|
||||
| brokerClusterName | DefaultCluster | 本 broker 所属的 Cluser 名字 |
|
||||
| brokerId | 0 | broker id, 0 表示 master, 其他的正整数表示 slave |
|
||||
| storePathCommitLog | $HOME/store/commitlog/ | 存储 commit log 的路径 |
|
||||
| storePathConsumerQueue | $HOME/store/consumequeue/ | 存储 consume queue 的路径 |
|
||||
| mapedFileSizeCommitLog | 1024 * 1024 * 1024(1G) | commit log 的映射文件大小 |
|
||||
| deleteWhen | 04 | 在每天的什么时间删除已经超过文件保留时间的 commit log |
|
||||
| fileReserverdTime | 72 | 以小时计算的文件保留时间 |
|
||||
| brokerRole | ASYNC_MASTER | SYNC_MASTER/ASYNC_MASTER/SLAVE |
|
||||
| flushDiskType | ASYNC_FLUSH | {SYNC_FLUSH/ASYNC_FLUSH}. Broker of SYNC_FLUSH 模式下的 broker 保证在收到确认生产者之前将消息刷盘。ASYNC_FLUSH 模式下的 broker 则利用刷盘一组消息的模式,取得更好的性能。 |
|
||||
|
||||
## 4 NameServer
|
||||
|
||||
@@ -191,9 +204,6 @@ msgId一定是全局唯一标识符,但是实际使用中,可能会存在相
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 5 客户端配置
|
||||
|
||||
相对于RocketMQ的Broker集群,生产者和消费者都是客户端。本小节主要描述生产者和消费者公共的行为配置。
|
||||
@@ -313,10 +323,6 @@ DefaultMQProducer、TransactionMQProducer、DefaultMQPushConsumer、DefaultMQPul
|
||||
| DelayTimeLevel | 0 | 选填,消息延时级别,0表示不延时,大于0会延时特定的时间才会被消费 |
|
||||
| WaitStoreMsgOK | TRUE | 选填,表示消息是否在服务器落盘后才返回应答。 |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 6 系统配置
|
||||
|
||||
本小节主要介绍系统(JVM/OS)相关的配置。
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
# Best practices
|
||||
|
||||
## 1 Producer
|
||||
|
||||
## 2 Consumer
|
||||
|
||||
## 3 Broker
|
||||
|
||||
### 3.1 Broker Role
|
||||
|
||||
### 3.2 FlushDiskType
|
||||
|
||||
### 3.3 Broker Configuration
|
||||
| Parameter name | Default | Description |
|
||||
| -------------------------------- | ----------------------------- | ------------------------------------------------------------ |
|
||||
| listenPort | 10911 | listen port for client |
|
||||
| namesrvAddr | null | name server address |
|
||||
| brokerIP1 | InetAddress for network interface | Should be configured if having multiple addresses |
|
||||
| brokerIP2 | InetAddress for network interface | If configured for the Master broker in the Master/Slave cluster, slave broker will connect to this port for data synchronization |
|
||||
| brokerName | null | broker name |
|
||||
| brokerClusterName | DefaultCluster | this broker belongs to which cluster |
|
||||
| brokerId | 0 | broker id, 0 means master, positive integers mean slave |
|
||||
| storePathCommitLog | $HOME/store/commitlog/ | file path for commit log |
|
||||
| storePathConsumerQueue | $HOME/store/consumequeue/ | file path for consume queue |
|
||||
| mapedFileSizeCommitLog | 1024 * 1024 * 1024(1G) | mapped file size for commit log |
|
||||
| deleteWhen | 04 | When to delete the commitlog which is out of the reserve time |
|
||||
| fileReserverdTime | 72 | The number of hours to keep a commitlog before deleting it |
|
||||
| brokerRole | ASYNC_MASTER | SYNC_MASTER/ASYNC_MASTER/SLAVE |
|
||||
| flushDiskType | ASYNC_FLUSH | {SYNC_FLUSH/ASYNC_FLUSH}. Broker of SYNC_FLUSH mode flushes each message onto disk before acknowledging producer. Broker of ASYNC_FLUSH mode, on the other hand, takes advantage of group-committing, achieving better performance. |
|
||||
Reference in New Issue
Block a user