mxsm commented on code in PR #336: URL: https://github.com/apache/rocketmq-site/pull/336#discussion_r996582084
########## i18n/en/docusaurus-plugin-content-docs/version-5.0/06-最佳实践/16dledger.md: ########## @@ -1,83 +1,91 @@ -# Dledger -## Dledger快速搭建 -### 前言 -DLedger是一套基于Raft协议的分布式日志存储组件,部署 RocketMQ 时可以根据需要选择使用DLeger来替换原生的副本存储机制。本文档主要介绍如何快速构建和部署基于 DLedger 的可以自动容灾切换的 RocketMQ 集群。 +# DLedger -### 1. 源码构建 -构建分为两个部分,需要先构建 DLedger,然后 构建 RocketMQ。 +## DLedger Quick Deployment -#### 1.1 构建 DLedger +### Preface +DLedger is a set of distributed log storage components based on Raft protocol. When deploying RocketMQ, you can choose to use DLeger to replace the native replica storage mechanism. This document is mainly introduced for how to build and deploy auto failover RocketMQ cluster based on DLedger. + +### 1. Build from source code +Build phase contains two parts, first, build DLedger, then build RocketMQ. + +#### 1.1 Build DLedger ```shell -git clone https://github.com/openmessaging/openmessaging-storage-dledger.git -cd openmessaging-storage-dledger -mvn clean install -DskipTests +$ git clone https://github.com/openmessaging/dledger.git +$ cd dledger +$ mvn clean install -DskipTests ``` -#### 1.2 构建 RocketMQ +#### 1.2 Build RocketMQ + ```shell -git clone https://github.com/apache/rocketmq.git -cd rocketmq -git checkout -b store_with_dledger origin/store_with_dledger -mvn -Prelease-all -DskipTests clean install -U +$ git clone https://github.com/apache/rocketmq.git +$ cd rocketmq +$ git checkout -b store_with_dledger origin/store_with_dledger +$ mvn -Prelease-all -DskipTests clean install -U ``` -### 2. 快速部署 -在构建成功后 -```shell -cd distribution/target/apache-rocketmq +### 2. Quick Deployment + +after build successful -sh bin/dledger/fast-try.sh start +```shell +#{rocketmq-version} replace with rocketmq actual version. example: 5.0.0-SNAPSHOT +$ cd distribution/target/rocketmq-{rocketmq-version}/rocketmq-{rocketmq-version} +$ sh bin/dledger/fast-try.sh start ``` -如果上面的步骤执行成功,可以通过 mqadmin 运维命令查看集群状态。 +if the above commands executed successfully, then check cluster status by using mqadmin operation commands. + ```shell -sh bin/mqadmin clusterList -n 127.0.0.1:9876 +$ sh bin/mqadmin clusterList -n 127.0.0.1:9876 ``` -顺利的话,会看到如下内容: + +If everything goes well, the following content will appear:  -(BID 为 0 的表示 Master,其余都是 Follower) +(BID is 0 indicate Master, the others are Follower) + +After startup successful, producer can produce message, and then test failover scenario. -启动成功,现在可以向集群收发消息,并进行容灾切换测试了。 +Stop cluster fastly, execute the following command: -关闭快速集群,可以执行: ```shell -sh bin/dledger/fast-try.sh stop +$ sh bin/dledger/fast-try.sh stop ``` -快速部署,默认配置在 conf/dledger 里面,默认的存储路径在 /tmp/rmqstore。 +Quick deployment, default configuration is in directory conf/dledger, default storage path is /tmp/rmqstore. -### 3. 容灾切换 -部署成功,杀掉 Leader 之后(在上面的例子中,杀掉端口 30931 所在的进程),等待约 10s 左右,用 clusterList 命令查看集群,就会发现 Leader 切换到另一个节点了。 +### 3. Failover +After successful deployment, kill Leader process(as the above example, kill process that binds port 30931), about 10 seconds elapses, use clusterList command check cluster's status, Leader switch to another node. Review Comment: @tsunghanjacktsai I will modify and resubmit this PR -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
