rocketmq集群yml配置
时间: 2023-11-01 07:00:20 浏览: 149
下面是一个基本的RocketMQ集群配置文件示例:
```yaml
# 配置Broker
broker:
clusterName: RocketMQCluster
brokerName: broker-a
brokerId: 0
deleteWhen: 04
fileReservedTime: 48
brokerRole: ASYNC_MASTER
flushDiskType: ASYNC_FLUSH
store:
mapedFileSizeCommitLog: 1024
mapedFileSizeConsumeQueue: 300000
flushIntervalConsumeQueue: 1000
flushIntervalCommitLog: 1000
flushCommitLogTimed: false
flushConsumeQueueTimed: false
cleanFileForciblyEnable: false
messageStore:
storePathRootDir: /usr/local/rocketmq/store
storePathCommitLog: /usr/local/rocketmq/store/commitlog
storePathConsumeQueue: /usr/local/rocketmq/store/consumequeue
storePathIndex: /usr/local/rocketmq/store/index
storePathCheckpoint: /usr/local/rocketmq/store/checkpoint
nettyServerConfig:
listenPort: 10911
nettyClientConfig:
clientAsyncSemaphoreValue: 65535
accessConfig:
whiteRemoteAddress:
admin:
accessKey: RocketMQ
secretKey: RocketMQ123
adminPath: /usr/local/rocketmq/acl/admin
default:
adminPath: /usr/local/rocketmq/acl/default
# 配置NameServer
namesrv:
kvConfigPath: /usr/local/rocketmq/conf/namesrv/kvConfig.json
configStorePath: /usr/local/rocketmq/conf/namesrv/namesrv.properties
productEnvName:
listenPort: 9876
brokerId: 0
namesrvAddr: 192.168.0.1:9876;192.168.0.2:9876;192.168.0.3:9876
# 配置客户端
client:
pollNameServerInterval: 30000
heartbeatBrokerInterval: 30000
persistConsumerOffsetInterval: 5000
clientIP: 172.16.3.101
unitName: RocketMQ
vipChannelEnabled: false
instanceName: RocketMQClient
```
上述示例中,配置文件包括了Broker、NameServer和客户端的配置。其中,Broker的配置包括了集群名称、Broker名称、Broker ID、删除策略、文件保留时间、角色、刷盘类型、存储相关配置和网络配置等;NameServer的配置包括了键值对存储配置路径、配置存储路径、产品环境名称、监听端口、Broker ID和NameServer地址等;客户端的配置包括了从NameServer拉取信息的间隔、与Broker保持心跳的间隔、持久化消费进度的间隔、客户端IP地址、单位名称、VIP通道开关和实例名称等。
需要注意的是,以上示例仅供参考,具体配置还需要根据实际需求进行调整。
阅读全文