You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/02/29 10:23:01 UTC

[GitHub] [rocketmq] Mrrrrr10 opened a new issue #1810: How to configure Rocketmq master-slave architecture on cloud server

Mrrrrr10 opened a new issue #1810: How to configure Rocketmq master-slave architecture on cloud server
URL: https://github.com/apache/rocketmq/issues/1810
 
 
   怎样在云服务器上配置rocketmq主从架构?如下是我的配置:
   - 主:106.53.xxx.xxx(云服务器)
   - 从:111.229.xxx.xxx(云服务器)
   -  rocketmq版本:服务端4.3.0,客户端:4.3.0
   主的配置:
   ```
   #所属集群名字
   brokerClusterName=rocketmq-cluster
   #broker 名字,注意此处不同的配置文件填写的不一样
   brokerName=broker-a
   #0 表示 Master, >0 表示 Slave
   brokerId=0
   #指定外网ip
   brokerIP1=106.53.xxx.xxx
   brokerIP2=106.53.xxx.xxx
   #nameServer 地址,分号分割,namesrvAddr与/etc/hosts里面配置的名字保持一致
   namesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876
   #在发送消息时,自动创建服务器不存在的 topic,默认创建的队列数
   defaultTopicQueueNums=4
   #是否允许 Broker 自动创建 Topic,建议线下开启,线上关闭
   autoCreateTopicEnable=true
   #是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
   autoCreateSubscriptionGroup=true
   #Broker 对外服务的监听端口
   listenPort=10911
   #删除文件时间点,默认凌晨 4 点
   deleteWhen=04
   #文件保留时间,默认 48 小时
   fileReservedTime=120
   #commitLog 每个文件的大小默认 1G
   mapedFileSizeCommitLog=1073741824
   #ConsumeQueue 每个文件默认存 30W 条,根据业务情况调整
   mapedFileSizeConsumeQueue=300000
   #destroyMapedFileIntervalForcibly=120000
   #redeleteHangedFileInterval=120000
   #检测物理文件磁盘空间
   diskMaxUsedSpaceRatio=88
   #存储路径
   storePathRootDir=/usr/local/rocketmq/store
   #commitLog 存储路径
   storePathCommitLog=/usr/local/rocketmq/store/commitlog
   #消费队列存储路径存储路径
   storePathConsumeQueue=/usr/local/rocketmq/store/consumequeue
   #消息索引存储路径
   storePathIndex=/usr/local/rocketmq/store/index
   #checkpoint 文件存储路径   
   storeCheckpoint=/usr/local/rocketmq/store/checkpoint
   #abort 文件存储路径
   abortFile=/usr/local/rocketmq/store/abort
   #限制的消息大小
   maxMessageSize=4194304
   #flushCommitLogLeastPages=4
   #flushConsumeQueueLeastPages=2第 6 页 共 15 页
   #flushCommitLogThoroughInterval=10000
   #flushConsumeQueueThoroughInterval=60000
   #Broker 的角色 
   #- ASYNC_MASTER 异步复制 Master
   #- SYNC_MASTER 同步双写 Master
   #- SLAVE
   brokerRole=ASYNC_MASTER
   #刷盘方式
   #- ASYNC_FLUSH 异步刷盘
   #- SYNC_FLUSH 同步刷盘
   flushDiskType=ASYNC_FLUSH
   #checkTransactionMessageEnable=false
   #发消息线程池数量
   #sendMessageThreadPoolNums=128
   #拉消息线程池数量
   #pullMessageThreadPoolNums=128
   ```
   从的配置:
   ```
   #所属集群名字
   brokerClusterName=rocketmq-cluster
   #broker 名字,注意此处不同的配置文件填写的不一样
   brokerName=broker-a
   #0 表示 Master, >0 表示 Slave
   brokerId=1
   #指定外网ip
   brokerIP1=111.229.xxx.xxx
   brokerIP2=106.53.xxx.xxx
   #haListenPort
   haListenPort=10912
   #haMasterAddress
   haMasterAddress=106.53.xxx.xxx:10912
   #nameServer 地址,分号分割
   namesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876
   #在发送消息时,自动创建服务器不存在的 topic,默认创建的队列数
   defaultTopicQueueNums=4
   #是否允许 Broker 自动创建 Topic,建议线下开启,线上关闭
   autoCreateTopicEnable=true
   #是否允许 Broker 自动创建订阅组,建议线下开启,线上关闭
   autoCreateSubscriptionGroup=true
   #Broker 对外服务的监听端口
   listenPort=10911
   #删除文件时间点,默认凌晨 4 点
   deleteWhen=04
   #文件保留时间,默认 48 小时
   fileReservedTime=120
   #commitLog 每个文件的大小默认 1G
   mapedFileSizeCommitLog=1073741824
   #ConsumeQueue 每个文件默认存 30W 条,根据业务情况调整
   mapedFileSizeConsumeQueue=300000
   #destroyMapedFileIntervalForcibly=120000
   #redeleteHangedFileInterval=120000
   #检测物理文件磁盘空间
   diskMaxUsedSpaceRatio=88
   #存储路径
   storePathRootDir=/usr/local/rocketmq/store
   #commitLog 存储路径
   storePathCommitLog=/usr/local/rocketmq/store/commitlog
   #消费队列存储路径存储路径
   storePathConsumeQueue=/usr/local/rocketmq/store/consumequeue
   #消息索引存储路径 
   storePathIndex=/usr/local/rocketmq/store/index
   #checkpoint 文件存储路径
   storeCheckpoint=/usr/local/rocketmq/store/checkpoint
   #abort 文件存储路径 
   abortFile=/usr/local/rocketmq/store/abort
   #限制的消息大小
   maxMessageSize=4194304
   #flushCommitLogLeastPages=4
   #flushConsumeQueueLeastPages=2
   #flushCommitLogThoroughInterval=10000 
   #flushConsumeQueueThoroughInterval=60000
   #Broker 的角色
   #- ASYNC_MASTER 异步复制 Master
   #- SYNC_MASTER 同步双写 Master
   #- SLAVE
   brokerRole=SLAVE
   #刷盘方式
   #- ASYNC_FLUSH 异步刷盘
   #- SYNC_FLUSH 同步刷盘
   flushDiskType=ASYNC_FLUSH
   #checkTransactionMessageEnable=false
   #发消息线程池数量
   #sendMessageThreadPoolNums=128
   #拉消息线程池数量
   #pullMessageThreadPoolNums=128
   ```
   存在的问题:
   1、生产消息,主从虽然都有,但是生产一条消息,将主机宕机以后,从机不去消费消息;
   2、生产者发送消息,有时候会出现 No route info of this topic, test_quick_topic
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [rocketmq] xujianhai666 commented on issue #1810: How to configure Rocketmq master-slave architecture on cloud server

Posted by GitBox <gi...@apache.org>.
xujianhai666 commented on issue #1810: How to configure Rocketmq master-slave architecture on cloud server
URL: https://github.com/apache/rocketmq/issues/1810#issuecomment-596173101
 
 
   @Mrrrrr10 生产者只能发送消息到 master broker, 因为 master broker 挂了, 无法发送心跳到 nameserver, nameserver 到期后就会删除 master broker 的路由信息, 这个时候, 客户端请求  nameserver 获取 路由信息就会失败, 如果这个场景下, 客户端继续发送消息, 就会产生 "No route info of this topic"

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [rocketmq] duhenglucky closed issue #1810: How to configure Rocketmq master-slave architecture on cloud server

Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #1810: How to configure Rocketmq master-slave architecture on cloud server
URL: https://github.com/apache/rocketmq/issues/1810
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services