Project: Apache RocketMQ (App Definition and Development / Streaming & Messaging)
File: deploy_guide.md

RocketMQ Proxy supports two deployment modes: `Local` and `Cluster`. The configuration file applies to both `Cluster` and `Local` mode, whose default path is distribution/conf/rmq-proxy.json. Set configuration field `nameSrvAddr`. Set configuration field `proxyMode` to `cluster` (case insensitive). Run the command below. ```shell nohup sh mqproxy & ``` The command will only launch the `Proxy` component itself. It assumes that `Namesrv` nodes are already running at the address specified `nameSrvAddr`, and broker nodes, registering themselves with `nameSrvAddr`, are running too. Set configuration field `nameSrvAddr`. Set configuration field `proxyMode` to `local` (case insensitive). Run the command below. ```shell nohup sh mqproxy & ``` The previous command will launch the `Proxy`, with `Broker` in the same process. It assumes `Namesrv` nodes are running at the address specified by `nameSrvAddr`. aintain consistent to brokerName | RaftNode00 | | dLegerPeers | DLedger Group's nodes port infos, each node's configuration stay consistent in the same group.| n0-127.0.0.1:40911;n1-127.0.0.1:40912;n2-127.0.0.1:40913 | | dLegerSelfId | node id, must belongs to dLegerPeers; each node is unique in the same group. | n0 | | sendMessageThreadPoolNums | the count of sending thread, advising set equal to the cpu cores. | 16 | the following presents an example configuration conf/dledger/broker-n0.conf. ``` brokerClusterName = RaftCluster brokerName=RaftNode00 listenPort=30911 namesrvAddr=127.0.0.1:9876 storePathRootDir=/tmp/rmqstore/node00 storePathCommitLog=/tmp/rmqstore/node00/commitlog enableDLegerCommitLog=true dLegerGroup=RaftNode00 dLegerPeers=n0-127.0.0.1:40911;n1-127.0.0.1:40912;n2-127.0.0.1:40913 dLegerSelfId=n0 sendMessageThreadPoolNums=16 ``` Startup stays consistent with the old version. `nohup sh bin/mqbroker -c conf/dledger/xxx-n0.conf & ` `nohup sh bin/mqbroker -c conf/dledger/xxx-n1.conf & ` `nohup sh bin/mqbroker -c conf/dledger/xxx-n2.conf & ` If old cluster deployed in Master mode, then each Master needs to be transformed into a RocketMQ-on-DLedger Group. If old cluster deployed in Master-Slave mode, then each Master-Slave group needs to be transformed into a RocketMQ-on-DLedger Group. execute kill command, or call `bin/mqshutdown broker`. Each node in RocketMQ-on-DLedger group is compatible with old Commitlog, but Raft replicating process works on the adding message only. So, to avoid occurring exceptions, old Commitlog must be consistent. If old cluster deployed in Master-Slave mode, it maybe inconsistent after shutdown. Advising use md5sum to check at least 2 recently Commitlog file, if occur inconsistent, maintain consistent by copy. Although RocketMQ-on-DLedger Group can deployed with 2 nodes, it lacks failover ability(at least 3 nodes can tolerate one node fail). Make sure that both Master and Slave's Commitlog is consistent, then prepare 3 machines, copy old Commitlog from Master to this 3 machines(BTW, copy the config directory). Then, go ahead to set configurations. Refer to New cluster deployment. Refer to New cluster deployment.