wlliqipeng commented on a change in pull request #654: [RIP-9]Add the operation part URL: https://github.com/apache/rocketmq/pull/654#discussion_r250059752
########## File path: docs/cn/operation.md ########## @@ -0,0 +1,1408 @@ +## 运维管理(operation) + +### 1 集群搭建 + +#### 1.1 单Master模式 + +这种方式风险较大,一旦Broker重启或者宕机时,会导致整个服务不可用。不建议线上环境使用,可以用于本地测试。 + +##### 1)启动 NameServer + +```bash +### 首先启动Name Server,例如机器IP为:192.161.1:9876 +$ nohup sh mqnamesrv & + +### 验证Name Server 是否启动成功 +$ tail -f ~/logs/rocketmqlogs/namesrv.log +The Name Server boot success... +``` + +##### 2)启动 Broker + +```bash +### 启动Broker,例如机器IP为:192.161.1:9876 +$ nohup sh bin/mqbroker -n localhost:9876 & +### 验证Name Server 是否启动成功 +$ tail -f ~/logs/rocketmqlogs/Broker.log +The broker[%s, 172.30.30.233:10911] boot success... +``` + +#### 1.2 多Master模式 + +一个集群无Slave,全是Master,例如2个Master或者3个Master,这种模式的优缺点如下: + +- 优点:配置简单,单个Master宕机或重启维护对应用无影响,在磁盘配置为RAID10时,即使机器宕机不可恢复情况下,由于RAID10磁盘非常可靠,消息也不会丢(异步刷盘丢失少量消息,同步刷盘一条不丢)。性能最高; + +- 缺点:单台机器宕机期间,这台机器上未被消费的消息在机器恢复之前不可订阅,消息实时性会受到受到影响。 + +##### 1)启动NameServer + +NameServer需要先于Broker启动,生产环境 需要启动多个保证高可用,一般规模的集群启动3个NameServer即可,各节点的启动命令相同,命令如下: + +```bash +### 首先启动Name Server,例如机器IP为:192.161.1:9876 +$ nohup sh mqnamesrv & + +### 验证Name Server 是否启动成功 +$ tail -f ~/logs/rocketmqlogs/namesrv.log +The Name Server boot success... +``` + +##### 2)启动Broker集群 + +```bash +### 在机器A,启动第一个Master +$ nohup sh mqbroker -n 192.161.1:9876 -c $ROCKETMQ_HOME/conf/2m-noslave/broker-a.properties & + +### 在机器B,启动第二个Master +$ nohup sh mqbroker -n 192.161.1:9876 -c $ROCKETMQ_HOME/conf/2m-noslave/broker-b.properties & + +... +``` + +如上启动命令是在单个NameServer情况下使用的。对于多个NameServer的集群,Broker启动命令中 -n后面的地址列表用分号隔开即可,例如 192.161.1:9876;192.161.2:9876。 + +#### 1.3 多Master多Slave模式-异步复制 + +每个Master配置一个Slave,有多对Master-Slave,HA采用异步复制方式,主备有短暂消息延迟,毫秒级,这种模式的优缺点如下: + +- 优点:即使磁盘损坏,消息丢失的非常少,且消息实时性不会受影响,因为Master宕机后,消费者仍然可以从Slave消费,此过程对应用透明。不需要人工干预。性能同多Master模式几乎一样; Review comment: ”不受影响“后面是否可加句号。”此过程对应用透明“后面是否为句号合适?建议本行以句号结尾。 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
