This is an automated email from the ASF dual-hosted git repository.
aloyszhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong-website.git
The following commit(s) were added to refs/heads/master by this push:
new 4fb565620f5 [INLONG-11386][TubeMQ] Use local files to save consumer
group offset information (#11395) (#1066)
4fb565620f5 is described below
commit 4fb565620f536e706e3db7cf5418808e90fc7a69
Author: Goson Zhang <[email protected]>
AuthorDate: Thu Oct 24 09:55:33 2024 +0800
[INLONG-11386][TubeMQ] Use local files to save consumer group offset
information (#11395) (#1066)
---
.../http_access_api_definition_cn.xls | Bin 200704 -> 201728 bytes
docs/modules/tubemq/configure_introduction.md | 75 +++---
docs/modules/tubemq/img/sys_structure.png | Bin 54641 -> 145872 bytes
docs/modules/tubemq/overview.md | 8 +-
docs/modules/tubemq/quick_start.md | 51 ++--
.../http_access_api_definition_cn.xls | Bin 200704 -> 201728 bytes
.../modules/tubemq/configure_introduction.md | 264 ++++++++++-----------
.../current/modules/tubemq/http_access_api.md | 16 +-
.../current/modules/tubemq/img/sys_structure.png | Bin 54641 -> 145872 bytes
.../current/modules/tubemq/overview.md | 64 +++--
.../current/modules/tubemq/quick_start.md | 132 +++++------
11 files changed, 292 insertions(+), 318 deletions(-)
diff --git
a/docs/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
b/docs/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
index e834b49c9b7..5801651cf0e 100644
Binary files
a/docs/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls and
b/docs/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls differ
diff --git a/docs/modules/tubemq/configure_introduction.md
b/docs/modules/tubemq/configure_introduction.md
index 4223ba65840..92764d70182 100644
--- a/docs/modules/tubemq/configure_introduction.md
+++ b/docs/modules/tubemq/configure_introduction.md
@@ -2,14 +2,14 @@
title: Configuration
---
-## 1 TubeMQ configuration item description
+## TubeMQ configuration item description
The TubeMQ server includes two modules for the Master and the Broker. The
Master also includes a Web front-end module for external page access (this part
is stored in the resources). Considering the actual deployment, two modules are
often deployed in the same machine, TubeMQ. The contents of the three parts of
the two modules are packaged and delivered to the operation and maintenance;
the client does not include the lib package of the server part and is delivered
to the user separately.
Master and Broker use the ini configuration file format, and the relevant
configuration files are placed in the master.ini and broker.ini files in the
tubemq-server-x.y.z/conf/ directory:

-Their configuration is defined by a set of configuration units. The Master
configuration consists of four mandatory units: [master], required but optional
in [meta_zookeeper], [meta_bdb], and optional [tlsSetting]. The Broker
configuration is mandatory. Broker], [zookeeper] and optional [tlsSetting]
consist of a total of 3 configuration units; in actual use, you can also
combine the contents of the two configuration files into one ini file.
+Their configuration is defined by a set of configuration units. The Master
configuration consists of four mandatory units: [master], required but optional
in [meta_zookeeper], [meta_bdb], and optional [tlsSetting]. The Broker
configuration is mandatory. [Broker], and optional [tlsSetting] consist of a
total of 2 configuration units; in actual use, you can also combine the
contents of the two configuration files into one ini file.
**Note**:
- Due to the LICENSE problem of the Apache dependency package, the package
released by TubeMQ from version 1.1.0 no longer contains the BDB package;
@@ -20,9 +20,9 @@ In addition to the back-end system configuration file, the
Master also stores th

-## 2 Configuration item details:
+## Configuration item details:
-### 2.1 master.ini file:
+### master.ini file:
[master]
> Master system runs the main configuration unit, required unit, the value is
> fixed to "[master]"
@@ -110,55 +110,48 @@ In addition to the back-end system configuration file,
the Master also stores th
| tlsTrustStorePath | no | string | The absolute storage path of
the TLS TrustStore file + the TrustStore file name. This field is required and
cannot be empty when the TLS function is enabled and mutual authentication is
enabled. |
| tlsTrustStorePassword | no | string | The absolute storage path of
the TLS TrustStorePassword file + the TrustStorePassword file name. This field
is required and cannot be empty when the TLS function is enabled and mutual
authentication is enabled. |
-### 2.2 velocity.properties file:
+### velocity.properties file:
| Name | Required | Type
| Description
|
| ------------------------- | ----------------------------- |
----------------------------- |
------------------------------------------------------------ |
| file.resource.loader.path | yes | string | The absolute path of the
master web template. This part is the absolute path plus /resources/templates
of the project when the master is deployed. The configuration is consistent
with the actual deployment. If the configuration fails, the master front page
access fails. |
-### 2.3 broker.ini file:
+### broker.ini file:
[broker]
>The broker system runs the main configuration unit, required unit, and the
>value is fixed to "[broker]"
-| Name | Required | Type
| Description |
-| --------------------- | ----------------------------- |
----------------------------- |
------------------------------------------------------------ |
-| brokerId | yes | int | Server unique flag, required
field, can be set to 0; when set to 0, the system will default to take the
local IP to int value |
-| hostName | yes | string | The host address of the broker
external service, required, must be configured in the NIC, is enabled,
non-loopback and cannot be IP of 127.0.0.1 |
-| port | no | int | Broker listening port,
optional, default is 8123 |
-| webPort | no | int | Broker's http management access
port, optional, default is 8081 |
-| masterAddressList | yes | string | Master address list of the
cluster to which the broker belongs. Required fields. The format must be
ip1:port1, ip2:port2, ip3:port3. |
-| primaryPath | yes | string | Broker stores the absolute path
of the message, mandatory field |
-| maxSegmentSize | no | int | Broker stores the file size of
the message data content, optional field, default 512M, maximum 1G |
-| maxIndexSegmentSize | no | int | Broker stores the file size of
the message Index content, optional field, default 18M, about 70W messages per
file |
-| transferSize | no | int | Broker allows the maximum
message content size to be transmitted to the client each time, optional field,
default is 512K |
-| consumerRegTimeoutMs | no | long | Consumer heartbeat timeout,
optional, in milliseconds, default 30 seconds |
-| socketRecvBuffer | no | long | Socket receives the size of the
Buffer buffer SO_RCVBUF, the unit byte, the negative number is not set, the
default value is |
-| socketSendBuffer | no | long | Socket sends Buffer buffer
SO_SNDBUF size, unit byte, negative number is not set, the default value is |
-| tcpWriteServiceThread | no | int | Broker supports the number of
socket worker threads for TCP production services, optional fields, and
defaults to 2 times the number of CPUs of the machine. |
-| tcpReadServiceThread | no | int | Broker supports the number of
socket worker threads for TCP consumer services, optional fields, defaults to 2
times the number of CPUs of the machine |
-| logClearupDurationMs | no | long | The aging cleanup period of the
message file, in milliseconds. The default is 3 minutes for a log cleanup
operation. The minimum is 1 minutes. |
-| logFlushDiskDurMs | no | long | Batch check message persistence
to file check cycle, in milliseconds, default is 20 seconds for a full check
and brush |
-| visitTokenCheckInValidTimeMs | no | long | The length of the
delay check for the visitToken check since the Broker is registered, in ms, the
default is 120000, the value range [60000, 300000]. |
-| visitMasterAuth | no | boolean | Whether the authentication of
the master is enabled, the default is false. If true, the user name and
signature information are added to the signaling reported to the master. |
-| visitName | no | string | User name of the access master.
The default is an empty string. This value must exist when visitMasterAuth is
true. The value must be the same as the value of the visitName field in
master.ini. |
+| Name | Required | Type
| Description
|
+| --------------------- | ----------------------------- |
-----------------------------
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| brokerId | yes | int | Server unique flag, required
field, can be set to 0; when set to 0, the system will default to take the
local IP to int value
|
+| hostName | yes | string | The host address of the broker
external service, required, must be configured in the NIC, is enabled,
non-loopback and cannot be IP of 127.0.0.1
|
+| port | no | int | Broker listening port,
optional, default is 8123
|
+| webPort | no | int | Broker's http management access
port, optional, default is 8081
|
+| masterAddressList | yes | string | Master address list of the
cluster to which the broker belongs. Required fields. The format must be
ip1:port1, ip2:port2, ip3:port3.
|
+| primaryPath | yes | string | Broker stores the absolute path
of the message, mandatory field
|
+| maxSegmentSize | no | int | Broker stores the file size of
the message data content, optional field, default 512M, maximum 1G
|
+| maxIndexSegmentSize | no | int | Broker stores the file size of
the message Index content, optional field, default 18M, about 70W messages per
file
|
+| transferSize | no | int | Broker allows the maximum
message content size to be transmitted to the client each time, optional field,
default is 512K
|
+| consumerRegTimeoutMs | no | long | Consumer heartbeat timeout,
optional, in milliseconds, default 30 seconds
|
+| socketRecvBuffer | no | long | Socket receives the size of the
Buffer buffer SO_RCVBUF, the unit byte, the negative number is not set, the
default value is
|
+| socketSendBuffer | no | long | Socket sends Buffer buffer
SO_SNDBUF size, unit byte, negative number is not set, the default value is
|
+| tcpWriteServiceThread | no | int | Broker supports the number of
socket worker threads for TCP production services, optional fields, and
defaults to 2 times the number of CPUs of the machine.
|
+| tcpReadServiceThread | no | int | Broker supports the number of
socket worker threads for TCP consumer services, optional fields, defaults to 2
times the number of CPUs of the machine
|
+| logClearupDurationMs | no | long | The aging cleanup period of the
message file, in milliseconds. The default is 3 minutes for a log cleanup
operation. The minimum is 1 minutes.
|
+| logFlushDiskDurMs | no | long | Batch check message persistence
to file check cycle, in milliseconds, default is 20 seconds for a full check
and brush
|
+| visitTokenCheckInValidTimeMs | no | long | The length of the
delay check for the visitToken check since the Broker is registered, in ms, the
default is 120000, the value range [60000, 300000].
|
+| visitMasterAuth | no | boolean | Whether the authentication of
the master is enabled, the default is false. If true, the user name and
signature information are added to the signaling reported to the master.
|
+| visitName | no | string | User name of the access master.
The default is an empty string. This value must exist when visitMasterAuth is
true. The value must be the same as the value of the visitName field in
master.ini. |
| visitPassword | no | string | The password for accessing the
master. The default is an empty string. This value must exist when
visitMasterAuth is true. The value must be the same as the value of the
visitPassword field in master.ini. |
-| logFlushMemDurMs | no | long | Batch check message memory
persistence to file check cycle, in milliseconds, default is 10 seconds for a
full check and brush |
-
-[zookeeper]
->The Tube MQ cluster corresponding to the Broker stores the information about
the ZooKeeper cluster of the Offset. The required unit has a fixed value of
"[zookeeper]".
+| logFlushMemDurMs | no | long | Batch check message memory
persistence to file check cycle, in milliseconds, default is 10 seconds for a
full check and brush
|
+| enableWriteOffset2Zk | no | boolean | Whether to write the consumer
group Offset record to ZooKeeper at the same time. The default value is false,
which means no record is written.
|
+| offsetStgFilePath | no | String | The file storage path of the
consumer group Offset record, the default is the primaryPath directory
|
+| grpOffsetStgExpMs | no | long | The storage period of the unupdated
consumer group Offset record in the file, in milliseconds, the default value is
20 days (20 * 24 * 60 * 60 * 1000)
|
+| offsetStgCacheFlushMs | no | long | The period for updating the Offset
record of the consumer group to the cache, in ms, with a default value of
5000ms
|
+| offsetStgFileSyncMs | no | long | The consumer group Offset records
the period of synchronizing from the cache to the file, in milliseconds. The
default value is offsetStgCacheFlushMs + 1000ms
|
+| offsetStgSyncDurWarnMs | no | long | The alarm value of the excessive
time taken for the consumer group Offset record to be synchronized from the
cache to the file, in milliseconds, with a default value of 20000ms
|
-| Name | Required | Type
| Description |
-| --------------------- | ----------------------------- |
----------------------------- |
------------------------------------------------------------ |
-| zkServerAddr | no | string | Zk server address, optional
configuration, defaults to "localhost:2181" |
-| zkNodeRoot | no | string | The root path of the node on zk,
optional configuration. The default is "/tube". |
-| zkSessionTimeoutMs | no | long | Zk heartbeat timeout, in
milliseconds, default 30 seconds |
-| zkConnectionTimeoutMs | no | long | Zk connection timeout, in
milliseconds, default 30 seconds |
-| zkSyncTimeMs | no | long | Zk data synchronization time, in
milliseconds, default 5 seconds |
-| zkCommitPeriodMs | no | long | The interval at which the broker
cache data is flushed to zk, in milliseconds, default 5 seconds |
-| zkCommitFailRetries | no | int | The maximum number of
re-brushings after Broker fails to flush cached data to Zk |
-
[tlsSetting]
>The Master uses TLS to encrypt the transport layer data. When TLS is enabled,
>the configuration unit provides related settings. The optional unit has a
>fixed value of "[tlsSetting]".
diff --git a/docs/modules/tubemq/img/sys_structure.png
b/docs/modules/tubemq/img/sys_structure.png
index 70b4dad4ce1..a980561ca7f 100644
Binary files a/docs/modules/tubemq/img/sys_structure.png and
b/docs/modules/tubemq/img/sys_structure.png differ
diff --git a/docs/modules/tubemq/overview.md b/docs/modules/tubemq/overview.md
index 49a092ef198..f1aa795d4a1 100644
--- a/docs/modules/tubemq/overview.md
+++ b/docs/modules/tubemq/overview.md
@@ -3,8 +3,8 @@ title: Overview
sidebar_position: 1
---
-## 1 TubeMQ Architecture:
-After years of evolution, the TubeMQ cluster is divided into the following 5
parts:
+## TubeMQ Architecture:
+After years of evolution, the TubeMQ cluster is divided into the following 4
parts:

- **Portal:** The Portal part responsible for external interaction and
maintenance operations, including API and Web.
@@ -29,9 +29,7 @@ After years of evolution, the TubeMQ cluster is divided into
the following 5 par
service supports resetting the precise offset through the client to support
the business extract-once consumption.
At the same time, the consumer has launched a new cross-cluster switch-free
Consumer client;
-- **ZooKeeper:** Responsible for the ZooKeeper part of the offset storage.
This part of the function has been weakened to only the persistent storage of
the offset. Considering the next multi-node copy function, this module is
temporarily reserved;
-
-## 2 Broker File Storage Scheme Improvement:
+## Broker File Storage Scheme Improvement:
Systems that use disks as data persistence media are faced with various system
performance problems caused by disk problems. The TubeMQ system is no
exception, the performance improvement is largely to solve the problem of how
to read, write and store message data. In this regard TubeMQ has made many
improvements: storage instances is as the smallest Topic data management unit;
each storage instance includes a file storage block and a memory cache block;
each Topic can be assigned multip [...]
1. **File storage block:** The disk storage solution of TubeMQ is similar to
Kafka, but it is not the same, as shown in the following figure: each file
storage block is composed of an index file and a data file; the partiton is a
logical partition in the data file; each Topic maintains and manages the file
storage block separately, the related mechanisms include the aging cycle, the
number of partitions, whether it is readable and writable, etc.
diff --git a/docs/modules/tubemq/quick_start.md
b/docs/modules/tubemq/quick_start.md
index e1916299356..5723150f6ed 100644
--- a/docs/modules/tubemq/quick_start.md
+++ b/docs/modules/tubemq/quick_start.md
@@ -2,22 +2,26 @@
title: Quick Start
sidebar_position: 2
---
-## 1 Deploy and Start
+## Deploy and Start
-### 1.1 Configuration Example
+### Configuration Example
There're two components in the cluster: **Master** and **Broker**. Master and
Broker
can be deployed on the same server or different servers. In this example, we
setup our cluster
like this, and all services run on the same node. Zookeeper should be setup in
your environment also.
-| Role | TCP Port | TLS Port | Web Port | Comment
|
-| ---- | -------- | -------- | --------
|----------------------------------------------------------------------|
-| Master | 8099 | 8199 | 8080 | Meta data is stored in ZooKeeper /tubemq
|
-| Broker | 8123 | 8124 | 8081 | Message is stored at /stage/msg_data
|
-| Zookeeper | 2181 | | | Master metadata or Broker offset information are
stored at /tubemq |
+| Role | TCP Port | TLS Port | Web Port | Comment
|
+| ---- | -------- | -------- | --------
|-------------------------------------------------------------------------------------------------|
+| Master | 8099 | 8199 | 8080 | Meta data is stored in ZooKeeper /tubemq
|
+| Broker | 8123 | 8124 | 8081 | Message is stored at /stage/msg_data
|
+| Zookeeper | 2181 | | | Master metadata is stored at /tubemq, this
component is not required if meta_bdb is configured. |
-### 1.2 Prerequisites
+### Prerequisites
- ZooKeeper Cluster
+ZooKeeper is not mandatory in the TubeMQ environment. If the Master metadata
is stored in BDB, this part of the resource can be omitted.
+
+- TubeMQ installation package deployment
+
After you extract the package file, here's the folder structure.
```
/INSTALL_PATH/inlong-tubemq-server/
@@ -28,7 +32,7 @@ After you extract the package file, here's the folder
structure.
└── resources
```
-### 1.3 Configure Master
+### Configure Master
You can change configurations in `conf/master.ini` according to cluster
information.
- Master IP and Port
```ini
@@ -77,7 +81,7 @@ the introduction of availability level.
- It is necessary to ensure the clock synchronization between all master nodes
-### 1.4 Configure Broker
+### Configure Broker
You can change configurations in `conf/broker.ini` according to cluster
information.
- Broker IP and Port
```ini
@@ -98,14 +102,7 @@ masterAddressList=MASTER_NODE_IP1:8099,MASTER_NODE_IP2:8099
// multi addresses
primaryPath=/stage/msg_data
```
-- ZooKeeper Cluster
-```ini
-[zookeeper] // Master and Broker in the same
cluster must use the same zookeeper environment and have the same configuration
-zkNodeRoot=/tubemq
-zkServerAddr=localhost:2181 // multi zookeeper addresses can
separate with ","
-```
-
-### 1.5 Start Master
+### Start Master
- Please go to the `bin` folder and run this command to start
the master service.
```bash
@@ -116,7 +113,7 @@ the master service.
web GUI now.
-#### 1.5.1 Configure Broker Metadata
+#### Configure Broker Metadata
Before we start a broker service, we need to configure it on master web GUI
first. Go to the `Broker List` page, click `Add Single Broker`, and input the
new broker information.
In this example, we only need to input broker IP and authToken:
1. broker IP: broker server ip
@@ -126,7 +123,7 @@ In this example, we only need to input broker IP and
authToken:
Click the online link to activate the new added broker.
-### 1.6 Start Broker
+### Start Broker
- Please go to the `bin` folder and run this command to start the broker
service
```bash
./tubemq.sh broker start
@@ -137,8 +134,8 @@ Click the online link to activate the new added broker.
- After the sub-state of the broker changed to `idle`, we can add topics to
that broker.
-## 2 Quick Start
-### 3.1 Add Topic
+## Quick Start
+### Add Topic
- 3.1.1 We can add or manage the cluster topics on the web GUI. To add a new
topic, go to the
topic list page and click the add new topic button
@@ -152,10 +149,10 @@ that the topic publish/subscribe state is active now.
- 3.1.5 Now we can use the topic to send messages.
-### 2.2 Run Example
+### Run Example
Now we can use `demo` topic which created before to test our cluster.
-#### 2.2.1 Produce Messages
+#### Produce Messages
Please don't forget replace `YOUR_MASTER_IP:port` with your server ip and
port, and start producer.
@@ -167,7 +164,7 @@ cd
/INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin
From the log, we can see the message is sent out.

-#### 2.2.2 Consume Messages
+#### Consume Messages
Please don't forget replace YOUR_MASTER_IP:port with your server ip and port,
and start consumer.
```bash
@@ -178,10 +175,10 @@ cd
/INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin
From the log, we can see the message received by the consumer.

-## 3 Deploy Manager
+## Deploy Manager
You can refer to [InLong TubeMQ
Manager](modules/tubemq/tubemq-manager/quick_start.md)
-## 4 The End
+## The End
Here, the compilation, deployment, system configuration, startup, production
and consumption of TubeMQ have been completed. If you need to understand more
in-depth content, please check the relevant content in "TubeMQ HTTP API" and
make the corresponding configuration settings.
---
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
index e834b49c9b7..1a7366bb64d 100644
Binary files
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
and
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/appendixfiles/http_access_api_definition_cn.xls
differ
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/configure_introduction.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/configure_introduction.md
index 11eb56dbc86..06c605baae9 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/configure_introduction.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/configure_introduction.md
@@ -2,196 +2,190 @@
title: 配置参数
---
-## 1 TubeMQ服务端配置文件说明:
+## TubeMQ 服务端配置文件说明:
-TubeMQ服务端包括Master和Broker共2个模块,Master又包含供外部页面访问的Web前端模块(该部分存放在resources中),考虑到实际部署时2个模块常常部署在同1台机器中,TubeMQ将2个模块3个部分的内容打包在一起交付给运维使用;客户端则不包含服务端部分的lib包单独交付给业务使用。
+TubeMQ 服务端包括 Master 和 Broker 共 2 个模块,Master 又包含供外部页面访问的 Web 前端模块(该部分存放在
resources 中),考虑到实际部署时 2 个模块常常部署在同 1 台机器中,TubeMQ 将 2 个模块 3
个部分的内容打包在一起交付给运维使用;客户端则不包含服务端部分的 lib 包单独交付给业务使用。
-Master与Broker采用ini配置文件格式,相关配置文件分别放置在tubemq-server-x.y.z/conf/目录的master.ini和broker.ini文件中:
+Master 与 Broker 采用 ini 配置文件格式,相关配置文件分别放置在 tubemq-server-x.y.z/conf/ 目录的
master.ini 和 broker.ini 文件中:

-他们的配置是按照配置单元集合来定义的,Master配置由必选的[master]、可选择的必选[meta_zookeeper]、[meta_bdb]和可选的[tlsSetting]一共4个配置单元组成,Broker配置由必选的[broker]、[zookeeper]和可选的[tlsSetting]一共3个配置单元组成;实际使用时,大家也可将两个配置文件内容合并放置为一个ini文件。
+他们的配置是按照配置单元集合来定义的,Master 配置由必选的 [master]、可选择的必选 [meta_zookeeper]、[meta_bdb]
和可选的 [tlsSetting] 一共 4 个配置单元组成,Broker配置由必选的 [broker] 和可选的 [tlsSetting] 一共 2
个配置单元组成;实际使用时,大家也可将两个配置文件内容合并放置为一个 ini 文件。
**注意**:
-- 由于Apache依赖包的LICENSE问题,从1.1.0版本开始TubeMQ发布的包不再包含BDB包;
--
1.1.0版本开始,元数据缺省采用ZooKeeper存储,可选支持BDB,1.1.0版本需要手工设置master.ini配置文件,增加[meta_bdb]配置单元才能支持BDB存储。
-- 若业务使用BDB组件,需要自行下载com.sleepycat.je-7.3.7.jar包,要不会系统运行时会报“
java.lang.ClassNotFoundException: com.sleepycat.je.ReplicaConsistencyPolicy”错误;
+- 由于 Apache 依赖包的 LICENSE 问题,从 1.1.0 版本开始 TubeMQ 发布的包不再包含 BDB 包;
+- 1.1.0 版本开始,元数据缺省采用 ZooKeeper 存储,可选支持 BDB,1.1.0 版本需要手工设置 master.ini 配置文件,增加
[meta_bdb] 配置单元才能支持 BDB 存储。
+- 若业务使用 BDB 组件,需要自行下载 com.sleepycat.je-7.3.7.jar 包,要不会系统运行时会报“
java.lang.ClassNotFoundException: com.sleepycat.je.ReplicaConsistencyPolicy” 错误;
-Master除了后端系统配置文件外,还在resources里存放了Web前端页面模块,resources的根目录velocity.properties文件为Master的Web前端页面配置文件。
+Master 除了后端系统配置文件外,还在 resources 里存放了 Web 前端页面模块,resources 的根目录
velocity.properties 文件为 Master 的 Web 前端页面配置文件。

-## 2 配置项详情:
+## 配置项详情:
-### 2.1 master.ini文件中关键配置内容说明:
+### master.ini 文件中关键配置内容说明:
[master]
> master 系统运行主要配置单元,必填单元,值固定为 "[master]"
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| hostName | 是 | String |
Master对外服务的主机地址,必填项,必须在网卡中已配置,处于启用状态,非回环且不能为127.0.0.1的IP |
-| port | 否 | int | Master监听的端口,可选项,缺省值为8715 |
-| webPort | 否 | int | Master Web控制台的访问端口,缺省值为8080 |
-| webResourcePath | 是 | String | Master Web
Resource部署绝对路径,必填项,该值设置不正确时Web页面将不能正常显示 |
-| confModAuthToken | 否 | String |
通过Master的Web或API做变更操作(包括增、删、改配置,以及变更Master及管理的Broker状态)时操作者需要提供的授权Token,该值可选,缺省为"ASDFGHJKL"
|
-| firstBalanceDelayAfterStartMs | 否 | long |
Master启动至首次开始Rebalance的时间间隔,可选项,缺省30000毫秒 |
-| consumerBalancePeriodMs | 否 | long |
Master对消费组进行Rebalance的均衡周期,可选项,缺省60000毫秒,当集群规模较大时,请调大该值 |
-| consumerHeartbeatTimeoutMs | 否 | long |
消费者心跳超时周期,可选项,缺省30000毫秒,当集群规模较大时,请调大该值 |
-| producerHeartbeatTimeoutMs | 否 | long |
生产者心跳超时周期,可选项,缺省30000毫秒,当集群规模较大时,请调大该值 |
-| brokerHeartbeatTimeoutMs | 否 | long |
Broker心跳超时周期,可选项,缺省30000毫秒,当集群规模较大时,请调大该值 |
-| rebalanceParallel | 否 | int | Master Rebalance处理并行度,可选项,缺省4,取值范围[1, 20],
当集群规模较大时,请调大该值 |
-| socketRecvBuffer | 否 | long | Socket接收Buffer缓冲区SO\_RCVBUF大小,单位字节,
负数为不做设置以缺省值为准 |
-| socketSendBuffer | 否 | long | Socket发送Buffer缓冲区SO\_SNDBUF大小,单位字节,
负数为不做设置以缺省值为准 |
-| maxAutoForbiddenCnt | 否 | int |
Broker出现IO故障时最大允许Master自动下线Broker个数,可选项,缺省为5,建议该值不超过集群内Broker总数的10% |
-| startOffsetResetCheck | 否 | boolean | 是否启用客户端Offset重置功能的检查功能,可选项,缺省为false |
-| needBrokerVisitAuth | 否 | boolean |
是否启用Broker访问鉴权,缺省为false,如果为true,则Broker上报的消息里必须携带正确的用户名及签名信息 |
-| visitName | 否 | String |
Broker访问鉴权的用户名,缺省为空字符串,在needBrokerVisitAuth为true时该值必须存在,该值必须与broker.ini里的visitName字段值同
|
-| visitPassword | 否 | String |
Broker访问鉴权的密码,缺省为空字符串,在needBrokerVisitAuth为true时该值必须存在,该值必须与broker.ini里的visitPassword字段值同
|
-| startVisitTokenCheck | 否 | boolean | 是否启用客户端visitToken检查,缺省为false |
-| startProduceAuthenticate | 否 | boolean | 是否启用生产端用户认证,缺省为false |
-| startProduceAuthorize | 否 | boolean | 是否启用生产端生产授权认证,缺省为false |
-| startConsumeAuthenticate | 否 | boolean | 是否启用消费端用户认证,缺省为false |
-| startConsumeAuthorize | 否 | boolean | 是否启用消费端消费授权认证,缺省为false |
-| maxGroupBrokerConsumeRate | 否 | int |
集群Broker数与消费组里成员数的最大比值,可选项,缺省为50,50台Broker集群里允许1个消费组最少启动1个客户端消费 |
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----| --- | ---
|-------------------------------------------------------------------------------------------------------------------|
+| hostName | 是 | String | Master 对外服务的主机地址,必填项,必须在网卡中已配置,处于启用状态,非回环且不能为
127.0.0.1 的 IP |
+| port | 否 | int | Master 监听的端口,可选项,缺省值为 8715
|
+| webPort | 否 | int | Master Web 控制台的访问端口,缺省值为 8080
|
+| webResourcePath | 是 | String | Master Web Resource 部署绝对路径,必填项,该值设置不正确时 Web
页面将不能正常显示 |
+| confModAuthToken | 否 | String | 通过 Master 的 Web 或 API 做变更操作(包括增、删、改配置,以及变更
Master 及管理的 Broker 状态)时操作者需要提供的授权 Token,该值可选,缺省为 "ASDFGHJKL" |
+| firstBalanceDelayAfterStartMs | 否 | long | Master 启动至首次开始 Rebalance
的时间间隔,可选项,缺省 30000 毫秒
|
+| consumerBalancePeriodMs | 否 | long | Master 对消费组进行 Rebalance 的均衡周期,可选项,缺省
60000 毫秒,当集群规模较大时,请调大该值 |
+| consumerHeartbeatTimeoutMs | 否 | long | 消费者心跳超时周期,可选项,缺省 30000
毫秒,当集群规模较大时,请调大该值
|
+| producerHeartbeatTimeoutMs | 否 | long | 生产者心跳超时周期,可选项,缺省 30000
毫秒,当集群规模较大时,请调大该值
|
+| brokerHeartbeatTimeoutMs | 否 | long | Broker 心跳超时周期,可选项,缺省 30000
毫秒,当集群规模较大时,请调大该值
|
+| rebalanceParallel | 否 | int | Master Rebalance 处理并行度,可选项,缺省 4,取值范围 [1, 20],
当集群规模较大时,请调大该值 |
+| socketRecvBuffer | 否 | long | Socket 接收 Buffer 缓冲区 SO\_RCVBUF 大小,单位字节,
负数为不做设置以缺省值为准 |
+| socketSendBuffer | 否 | long | Socket 发送 Buffer 缓冲区 SO\_SNDBUF 大小,单位字节,
负数为不做设置以缺省值为准 |
+| maxAutoForbiddenCnt | 否 | int | Broker 出现 IO 故障时最大允许 Master 自动下线 Broker
个数,可选项,缺省为 5,建议该值不超过集群内 Broker 总数的 10% |
+| startOffsetResetCheck | 否 | boolean | 是否启用客户端 Offset 重置功能的检查功能,可选项,缺省为 false
|
+| needBrokerVisitAuth | 否 | boolean | 是否启用 Broker 访问鉴权,缺省为 false,如果为 true,则
Broker 上报的消息里必须携带正确的用户名及签名信息 |
+| visitName | 否 | String | Broker 访问鉴权的用户名,缺省为空字符串,在 needBrokerVisitAuth 为
true 时该值必须存在,该值必须与 broker.ini 里的 visitName 字段值同 |
+| visitPassword | 否 | String | Broker 访问鉴权的密码,缺省为空字符串,在 needBrokerVisitAuth 为
true 时该值必须存在,该值必须与 broker.ini 里的 visitPassword 字段值同 |
+| startVisitTokenCheck | 否 | boolean | 是否启用客户端 visitToken 检查,缺省为 false
|
+| startProduceAuthenticate | 否 | boolean | 是否启用生产端用户认证,缺省为 false
|
+| startProduceAuthorize | 否 | boolean | 是否启用生产端生产授权认证,缺省为 false
|
+| startConsumeAuthenticate | 否 | boolean | 是否启用消费端用户认证,缺省为 false
|
+| startConsumeAuthorize | 否 | boolean | 是否启用消费端消费授权认证,缺省为 false
|
+| maxGroupBrokerConsumeRate | 否 | int | 集群 Broker 数与消费组里成员数的最大比值,可选项,缺省为 50,50
台 Broker 集群里允许 1 个消费组最少启动 1 个客户端消费 |
[meta_zookeeper]
> Master 基于 ZooKeeper 进行元数据存储和多节点热备的配置单元,"[meta_zookeeper]" 这部分和
> "[meta_bdb]" 二选一。
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| zkServerAddr | 否 | String | zk服务器地址,可选配置,缺省为"localhost:2181" |
-| zkNodeRoot | 否 | String | zk上的节点根目录路径,可选配置,缺省为"/tubemq" |
-| zkSessionTimeoutMs | 否 | long | zk心跳超时,单位毫秒,默认30秒 |
-| zkConnectionTimeoutMs | 否 | long | zk连接超时时间,单位毫秒,默认30秒 |
-| zkSyncTimeMs | 否 | long | zk数据同步时间,单位毫秒,默认5秒 |
-| zkCommitPeriodMs | 否 | long | Master缓存数据刷新到zk上的时间间隔,单位毫秒,默认5秒 |
-| zkMasterCheckPeriodMs | 否 | long | 当前节点是否为Master角色的检查周期,单位毫秒,缺省为5秒 |
+| 配置项 | 是否必选 | 值类型 | 配置说明 |
+|-----| --- | --- |----------------------------------------------|
+| zkServerAddr | 否 | String | zk 服务器地址,可选配置,缺省为 "localhost:2181" |
+| zkNodeRoot | 否 | String | zk 上的节点根目录路径,可选配置,缺省为 "/tubemq" |
+| zkSessionTimeoutMs | 否 | long | zk 心跳超时,单位毫秒,默认 30 秒
|
+| zkConnectionTimeoutMs | 否 | long | zk 连接超时时间,单位毫秒,默认 30 秒
|
+| zkSyncTimeMs | 否 | long | zk 数据同步时间,单位毫秒,默认 5 秒 |
+| zkCommitPeriodMs | 否 | long | Master 缓存数据刷新到 zk 上的时间间隔,单位毫秒,默认 5 秒 |
+| zkMasterCheckPeriodMs | 否 | long | 当前节点是否为 Master 角色的检查周期,单位毫秒,缺省为 5 秒
|
[meta_bdb]
> Master 基于 BDB 存储元数据及进行多节点热备保活的配置单元,"[meta_bdb]" 这部分和
> "[meta_zookeeper]" 二选一。
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| repGroupName | 否 | String |
集群名,所属主备Master节点值必须相同,可选字段,缺省为"tubemqMasterGroup" |
-| repNodeName | 是 | String | 所属Master在集群中的节点名,该值各个节点必须不重复,必填字段 |
-| metaDataPath | 否 | String |
Metadata存储路径,可以是绝对路径、或者相对TubeMQ安装目录("$BASE_DIR")的相对路径。缺省为"var/meta_data"
|
-| repNodePort | 否 | int | 节点复制通讯端口,可选字段,缺省为9001 |
-| repHelperHost | 否 | String | 集群启动时的主节点,可选字段,缺省为"127.0.0.1:9001" |
-| metaLocalSyncPolicy | 否 | int |
数据节点本地保存方式,该字段取值范围[1,2,3],缺省为1:其中1为数据保存到磁盘,2为数据只保存到内存,3为只将数据写文件系统buffer,但不刷盘 |
-| metaReplicaSyncPolicy | 否 | int |
数据节点同步保存方式,该字段取值范围[1,2,3],缺省为1:其中1为数据保存到磁盘,2为数据只保存到内存,3为只将数据写文件系统buffer,但不刷盘 |
-| repReplicaAckPolicy | 否 | int |
节点数据同步时的应答策略,该字段取值范围为[1,2,3],缺省为1:其中1为超过1/2多数为有效,2为所有节点应答才有效;3为不需要节点应答 |
-| repStatusCheckTimeoutMs | 否 | long | 节点状态检查间隔,可选字段,单位毫秒,缺省为10秒 |
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----| --- | ---
|--------------------------------------------------------------------------------------------------|
+| repGroupName | 否 | String | 集群名,所属主备 Master 节点值必须相同,可选字段,缺省为
"tubemqMasterGroup" |
+| repNodeName | 是 | String | 所属 Master 在集群中的节点名,该值各个节点必须不重复,必填字段
|
+| metaDataPath | 否 | String | Metadata 存储路径,可以是绝对路径、或者相对 TubeMQ
安装目录("$BASE_DIR")的相对路径。缺省为 "var/meta_data" |
+| repNodePort | 否 | int | 节点复制通讯端口,可选字段,缺省为 9001
|
+| repHelperHost | 否 | String | 集群启动时的主节点,可选字段,缺省为 "127.0.0.1:9001"
|
+| metaLocalSyncPolicy | 否 | int | 数据节点本地保存方式,该字段取值范围 [1,2,3],缺省为 1:其中 1
为数据保存到磁盘,2 为数据只保存到内存,3 为只将数据写文件系统 buffer,但不刷盘 |
+| metaReplicaSyncPolicy | 否 | int | 数据节点同步保存方式,该字段取值范围 [1,2,3],缺省为 1:其中 1
为数据保存到磁盘,2 为数据只保存到内存,3 为只将数据写文件系统 buffer,但不刷盘 |
+| repReplicaAckPolicy | 否 | int | 节点数据同步时的应答策略,该字段取值范围为 [1,2,3],缺省为 1:其中 1 为超过
1/2 多数为有效,2 为所有节点应答才有效;3 为不需要节点应答 |
+| repStatusCheckTimeoutMs | 否 | long | 节点状态检查间隔,可选字段,单位毫秒,缺省为 10 秒
|
[tlsSetting]
> Master 启用 TLS 进行传输层数据加密通的相关设置,可选单元,值固定为 "[tlsSetting]"
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| tlsEnable | 否 | boolean | 是否启用TLS功能,可选配置,缺省为false |
-| tlsPort | 否 | int | Master的TLS端口号,可选配置,缺省为8716 |
-| tlsKeyStorePath | 否 | String |
TLS的keyStore文件的绝对存储路径+keyStore文件名,在启动TLS功能时,该字段必填且不能为空 |
-| tlsKeyStorePassword | 否 | String |
TLS的keyStorePassword文件的绝对存储路径+keyStorePassword文件名,在启动TLS功能时,该字段必填且不能为空 |
-| tlsTwoWayAuthEnable | 否 | boolean | 是否启用TLS双向认证功能,可选配置,缺省为false |
-| tlsTrustStorePath | 否 | String |
TLS的TrustStore文件的绝对存储路径+TrustStore文件名,在启动TLS功能且启用双向认证时,该字段必填且不能为空 |
-| tlsTrustStorePassword | 否 | String |
TLS的TrustStorePassword文件的绝对存储路径+TrustStorePassword文件名,在启动TLS功能且启用双向认证时,该字段必填且不能为空
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----| --- | ---
|-------------------------------------------------------------------------------------------|
+| tlsEnable | 否 | boolean | 是否启用 TLS 功能,可选配置,缺省为 false
|
+| tlsPort | 否 | int | Master 的 TLS 端口号,可选配置,缺省为 8716
|
+| tlsKeyStorePath | 否 | String | TLS 的 keyStore 文件的绝对存储路径 + keyStore 文件名,在启动
TLS 功能时,该字段必填且不能为空 |
+| tlsKeyStorePassword | 否 | String | TLS 的 keyStorePassword 文件的绝对存储路径 +
keyStorePassword 文件名,在启动 TLS 功能时,该字段必填且不能为空 |
+| tlsTwoWayAuthEnable | 否 | boolean | 是否启用 TLS 双向认证功能,可选配置,缺省为 false
|
+| tlsTrustStorePath | 否 | String | TLS 的 TrustStore 文件的绝对存储路径 + TrustStore
文件名,在启动 TLS 功能且启用双向认证时,该字段必填且不能为空 |
+| tlsTrustStorePassword | 否 | String | TLS 的 TrustStorePassword 文件的绝对存储路径 +
TrustStorePassword 文件名,在启动 TLS 功能且启用双向认证时,该字段必填且不能为空 |
[prometheus]
> Master 使用 prometheus 提供指标数据查询时的相关配置单元设置,可选配置单元集合 " [prometheus] "
-| 配置项 | 是否必选 | 值类型 | 配置说明
|
-|-----|------|---------|---------------------------------------------------------------------------------|
-| promEnable | 否 | boolean | 是否启用 prometheus服务,可选配置,缺省为false
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----|------|---------|---------------------------------------------------------|
+| promEnable | 否 | boolean | 是否启用 prometheus 服务,可选配置,缺省为 false
|
| promClusterName | 否 | String | 启用 prometheus 服务时 服务节点所属于的集群名,缺省值为 "
InLong " |
-| promHttpPort | 否 | int | 启用 prometheus 服务时的侦听端口,可选配置,缺省值为 9081
|
+| promHttpPort | 否 | int | 启用 prometheus 服务时的侦听端口,可选配置,缺省值为 9081
|
**注意**:
--
基于Docker容器化的需要,master.ini文件里对[meta_bdb]如上3个参数部分都是使用的缺省设置,在实际组网使用时需要以Master节点真实信息配置
-- Master所有节点的IP信息要在hosts配置文件里构造IP与hostName映射关系,如类似“10.10.11.205 10-10-11-205”
-- 需保证Master所有节点之间的时钟同步
+- 基于 Docker 容器化的需要,master.ini 文件里对 [meta_bdb] 如上 3 个参数部分都是使用的缺省设置,在实际组网使用时需要以
Master 节点真实信息配置
+- Master 所有节点的 IP 信息要在 hosts 配置文件里构造 IP 与 hostName 映射关系,如类似 “10.10.11.205
10-10-11-205”
+- 需保证 Master 所有节点之间的时钟同步
-### 2.2 Master的前台配置文件velocity.properties中关键配置内容说明:
+### Master 的前台配置文件 velocity.properties 中关键配置内容说明:
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-| --- | --- | --- | --- |
-| file.resource.loader.path | 是 | String |
Master的Web的模板绝对路径,该部分为实际部署Master时的工程绝对路径+/resources/templates,该配置要与实际部署相吻合,配置失败会导致Master前端页面访问失败。
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+| --- | --- | ---
|------------------------------------------------------------------------------------------------------------|
+| file.resource.loader.path | 是 | String | Master 的 Web 的模板绝对路径,该部分为实际部署
Master 时的工程绝对路径 + /resources/templates,该配置要与实际部署相吻合,配置失败会导致 Master 前端页面访问失败。 |
-### 2.3 broker.ini文件中关键配置内容说明:
+### broker.ini 文件中关键配置内容说明:
[broker]
> Broker 系统运行主配置单元,必填单元,值固定为 "[broker]"
-| 配置项 | 是否必选 | 值类型 | 配置说明
|
-| ---
|------|---------|------------------------------------------------------------------------------------------------------------------|
-| brokerId | 是 | int |
服务器唯一标志,必填字段,可设为0;设为0时系统将默认取本机IP转化为int值再取abs绝对值,避免brokerId为负数,如果使用环境的IP比较复杂存在生成的brokerId值冲突时,则需要指定brokerId值进行设置。
|
-| hostName | 是 | String |
Broker对外服务的主机地址,必填项,必须在网卡中已配置,处于启用状态,非回环且不能为127.0.0.1的IP
|
-| port | 否 | int | Broker监听的端口,可选项,缺省值为8123
|
-| webPort | 否 | int | Broker的http管理访问端口,可选项,缺省为8081
|
-| masterAddressList | 是 | String |
Broker所属集群的Master地址列表,必填字段,格式必须是ip1:port1,ip2:port2,ip3:port3
|
-| primaryPath | 是 | String | Broker存储消息的绝对路径,必选字段
|
-| maxSegmentSize | 否 | int | Broker存储消息Data内容的文件大小,可选字段,缺省512M,最大1G
|
-| maxIndexSegmentSize | 否 | int |
Broker存储消息Index内容的文件大小,可选字段,缺省18M,约70W条消息每文件
|
-| transferSize | 否 | int | Broker允许每次传输给客户端的最大消息内容大小,可选字段,缺省为512K
|
-| consumerRegTimeoutMs | 否 | long | consumer心跳超时时间,可选项,单位毫秒,默认30秒
|
-| socketRecvBuffer | 否 | long |
Socket接收Buffer缓冲区SO\_RCVBUF大小,单位字节,负数为不做设置以缺省值为准
|
-| socketSendBuffer | 否 | long |
Socket发送Buffer缓冲区SO\_SNDBUF大小,单位字节,负数为不做设置以缺省值为准
|
-| tcpWriteServiceThread | 否 | int | Broker支持TCP生产服务的socket
worker线程数,可选字段,缺省为所在机器的2倍CPU个数
|
-| tcpReadServiceThread | 否 | int | Broker支持TCP消费服务的socket
worker线程数,可选字段,缺省为所在机器的2倍CPU个数
|
-| logClearupDurationMs | 否 | long | 消息文件的老化清理周期, 单位为毫秒,
缺省为3分钟进行一次日志清理操作,最低1分钟
|
-| logFlushDiskDurMs | 否 | long | 批量检查消息持久化到文件的检查周期,单位为毫秒,
缺省为20秒进行一次全量的检查及刷盘
|
-| visitTokenCheckInValidTimeMs | 否 | long |
visitToken检查时允许Broker注册后延迟检查的时长,单位ms,缺省120000,取值范围[60000,300000]
|
-| visitMasterAuth | 否 | boolean |
是否启用上报Master鉴权,缺省为false,如果为true,则会在上报Master的信令里加入用户名及签名信息
|
-| visitName | 否 | String |
访问Master的用户名,缺省为空字符串,在visitMasterAuth为true时该值必须存在,该值必须与master.ini里的visitName字段值同
|
-| visitPassword | 否 | String |
访问Master的密码,缺省为空字符串,在visitMasterAuth为true时该值必须存在,该值必须与master.ini里的visitPassword字段值同
|
-| logFlushMemDurMs | 否 | long | 批量检查消息内存持久化到文件的检查周期,单位为毫秒,
缺省为10秒进行一次全量的检查及刷盘
|
-
-[zookeeper]
-> Broker 对应的 Tube MQ 集群存储 Offset 的 ZooKeeper
集群相关信息,必填单元,值固定为"[zookeeper]"
-
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| zkServerAddr | 否 | String | zk服务器地址,可选配置,缺省为"localhost:2181"
|
-| zkNodeRoot | 否 | String | zk上的节点根目录路径,可选配置,缺省为"/tubemq"
|
-| zkSessionTimeoutMs | 否 | long | zk心跳超时,单位毫秒,默认30秒
|
-| zkConnectionTimeoutMs | 否 | long | zk连接超时时间,单位毫秒,默认30秒
|
-| zkSyncTimeMs | 否 | long | zk数据同步时间,单位毫秒,默认5秒
|
-| zkCommitPeriodMs | 否 | long | Broker缓存数据刷新到zk上的时间间隔,单位毫秒,默认5秒
|
-| zkCommitFailRetries | 否 | int | Broker刷新缓存数据到Zk失败后的最大重刷次数
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+| ---
|------|---------|-----------------------------------------------------------------------------------------------------------------------------------|
+| brokerId | 是 | int | 服务器唯一标志,必填字段,可设为 0;设为 0 时系统将默认取本机 IP 转化为 int 值再取
abs 绝对值,避免 brokerId 为负数,如果使用环境的 IP 比较复杂存在生成的 brokerId 值冲突时,则需要指定 brokerId
值进行设置。 |
+| hostName | 是 | String | Broker 对外服务的主机地址,必填项,必须在网卡中已配置,处于启用状态,非回环且不能为
127.0.0.1 的 IP
|
+| port | 否 | int | Broker 监听的端口,可选项,缺省值为 8123
|
+| webPort | 否 | int | Broker 的 http 管理访问端口,可选项,缺省为 8081
|
+| masterAddressList | 是 | String | Broker 所属集群的 Master 地址列表,必填字段,格式必须是
ip1:port1,ip2:port2,ip3:port3
|
+| primaryPath | 是 | String | Broker 存储消息的绝对路径,必选字段
|
+| maxSegmentSize | 否 | int | Broker 存储消息 Data 内容的文件大小,可选字段,缺省 512M,最大
1G
|
+| maxIndexSegmentSize | 否 | int | Broker 存储消息 Index 内容的文件大小,可选字段,缺省
18M,约 70W 条消息每文件
|
+| transferSize | 否 | int | Broker 允许每次传输给客户端的最大消息内容大小,可选字段,缺省为 512K
|
+| consumerRegTimeoutMs | 否 | long | consumer 心跳超时时间,可选项,单位毫秒,默认 30 秒
|
+| socketRecvBuffer | 否 | long | Socket 接收 Buffer 缓冲区 SO\_RCVBUF
大小,单位字节,负数为不做设置以缺省值为准
|
+| socketSendBuffer | 否 | long | Socket 发送 Buffer 缓冲区 SO\_SNDBUF
大小,单位字节,负数为不做设置以缺省值为准
|
+| tcpWriteServiceThread | 否 | int | Broker 支持 TCP 生产服务的 socket worker
线程数,可选字段,缺省为所在机器的 2 倍 CPU 个数
|
+| tcpReadServiceThread | 否 | int | Broker 支持 TCP 消费服务的 socket worker
线程数,可选字段,缺省为所在机器的 2 倍 CPU 个数
|
+| logClearupDurationMs | 否 | long | 消息文件的老化清理周期, 单位为毫秒, 缺省为 3
分钟进行一次日志清理操作,最低 1 分钟
|
+| logFlushDiskDurMs | 否 | long | 批量检查消息持久化到文件的检查周期,单位为毫秒, 缺省为 20
秒进行一次全量的检查及刷盘
|
+| visitTokenCheckInValidTimeMs | 否 | long | visitToken 检查时允许 Broker
注册后延迟检查的时长,单位 ms,缺省 120000,取值范围 [60000,300000]
|
+| visitMasterAuth | 否 | boolean | 是否启用上报 Master 鉴权,缺省为 false,如果为 true,则会在上报
Master 的信令里加入用户名及签名信息
|
+| visitName | 否 | String | 访问 Master 的用户名,缺省为空字符串,在 visitMasterAuth 为 true
时该值必须存在,该值必须与 master.ini 里的 visitName 字段值同
|
+| visitPassword | 否 | String | 访问 Master 的密码,缺省为空字符串,在 visitMasterAuth 为
true 时该值必须存在,该值必须与 master.ini 里的 visitPassword 字段值同
|
+| logFlushMemDurMs | 否 | long | 批量检查消息内存持久化到文件的检查周期,单位为毫秒, 缺省为 10
秒进行一次全量的检查及刷盘
|
+| enableWriteOffset2Zk | 否 | boolean | 是否将消费组 Offset 记录同时写 ZooKeeper,缺省
false,不写入
|
+| offsetStgFilePath | 否 | String | 消费组 Offset 记录的文件保存路径,缺省为 primaryPath
目录下
|
+| grpOffsetStgExpMs | 否 | long | 未更新的消费组 Offset 记录在文件里的保存周期,单位 ms, 缺省值为
20 天(20 * 24 * 60 * 60 * 1000)
|
+| offsetStgCacheFlushMs | 否 | long | 消费组 Offset 记录更新到缓存的周期,单位 ms, 缺省值为
5000ms
|
+| offsetStgFileSyncMs | 否 | long | 消费组 Offset 记录从缓存同步到文件的周期,单位 ms, 缺省值为
offsetStgCacheFlushMs + 1000ms
|
+| offsetStgSyncDurWarnMs | 否 | long | 消费组 Offset 记录从缓存同步到文件时间超长告警值,单位
ms, 缺省值为 20000ms
|
+
[tlsSetting]
-> Broker启用TLS时通过该配置单元提供相关的设置,可选单元,值固定为"[tlsSetting]"
-
-| 配置项 | 是否必选 | 值类型 | 配置说明 |
-|-----| --- | --- |---------------------------------------------------------|
-| tlsEnable | 否 | boolean | 是否启用TLS功能,可选配置,缺省为false
|
-| tlsPort | 否 | int | Broker的TLS端口号,可选配置,缺省为8124
|
-| tlsKeyStorePath | 否 | String |
TLS的keyStore文件的绝对存储路径+keyStore文件名,在启动TLS功能时,该字段必填且不能为空
|
-| tlsKeyStorePassword | 否 | String |
TLS的keyStorePassword文件的绝对存储路径+keyStorePassword文件名,在启动TLS功能时,该字段必填且不能为空
|
-| tlsTwoWayAuthEnable | 否 | boolean | 是否启用TLS双向认证功能,可选配置,缺省为false
|
-| tlsTrustStorePath | 否 | String |
TLS的TrustStore文件的绝对存储路径+TrustStore文件名,在启动TLS功能且启用双向认证时,该字段必填且不能为空
|
-| tlsTrustStorePassword | 否 | String |
TLS的TrustStorePassword文件的绝对存储路径+TrustStorePassword文件名,在启动TLS功能且启用双向认证时,该字段必填且不能为空
|
+> Broker 启用 TLS 时通过该配置单元提供相关的设置,可选单元,值固定为 "[tlsSetting]"
+
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----| --- | ---
|-------------------------------------------------------------------------------------------|
+| tlsEnable | 否 | boolean | 是否启用 TLS 功能,可选配置,缺省为 false
|
+| tlsPort | 否 | int | Broker 的 TLS 端口号,可选配置,缺省为 8124
|
+| tlsKeyStorePath | 否 | String | TLS 的 keyStore 文件的绝对存储路径 + keyStore
文件名,在启动 TLS 功能时,该字段必填且不能为空 |
+| tlsKeyStorePassword | 否 | String | TLS 的 keyStorePassword 文件的绝对存储路径 +
keyStorePassword 文件名,在启动 TLS 功能时,该字段必填且不能为空 |
+| tlsTwoWayAuthEnable | 否 | boolean | 是否启用 TLS 双向认证功能,可选配置,缺省为 false
|
+| tlsTrustStorePath | 否 | String | TLS 的 TrustStore 文件的绝对存储路径 + TrustStore
文件名,在启动 TLS 功能且启用双向认证时,该字段必填且不能为空 |
+| tlsTrustStorePassword | 否 | String | TLS 的 TrustStorePassword 文件的绝对存储路径
+ TrustStorePassword 文件名,在启动 TLS 功能且启用双向认证时,该字段必填且不能为空 |
[audit]
> Broker 使用审计模块来报告数据设置单元,启用审计时,配置单元提供相关设置,该可选配置单位有一个固定值 " [audit] "
-| 配置项 | 是否必选 | 值类型 | 配置说明
|
-|-----|------| ---
|---------------------------------------------------------------------------------|
-| auditEnable | 否 | boolean | 是否启用审计上报功能,可选配置,缺省为false
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----|------| ---
|--------------------------------------------------------------------------------|
+| auditEnable | 否 | boolean | 是否启用审计上报功能,可选配置,缺省为 false
|
| auditProxyAddr | 否 | String | 审计上报地址,格式必须是 "
ip1:port1,ip2:port2,ip3:port3 ", 缺省值为 127.0.0.1:10081 |
-| auditCacheFilePath | 否 | String | 审计上报数据的缓存文件路径,缺省为 "
/data/inlong/audit " |
-| auditCacheMaxRows | 否 | int | 最大审计缓存的数据条数,缺省为2000000条
|
-| auditIdProduce | 否 | int | 上报生产数据的审计ID,缺省值为9
|
-| auditIdConsume | 否 | int | 上报消费数据的审计ID,缺省值为10
|
+| auditCacheFilePath | 否 | String | 审计上报数据的缓存文件路径,缺省为 "
/data/inlong/audit " |
+| auditCacheMaxRows | 否 | int | 最大审计缓存的数据条数,缺省为 2000000 条
|
+| auditIdProduce | 否 | int | 上报生产数据的审计 ID,缺省值为 9
|
+| auditIdConsume | 否 | int | 上报消费数据的审计 ID,缺省值为 10
|
[prometheus]
> Broker 使用 prometheus 提供指标数据查询时的相关配置单元设置,可选配置单元集合 " [prometheus] "
-| 配置项 | 是否必选 | 值类型 | 配置说明
|
-|-----|------|---------|---------------------------------------------------------------------------------|
-| promEnable | 否 | boolean | 是否启用 prometheus服务,可选配置,缺省为false
|
+| 配置项 | 是否必选 | 值类型 | 配置说明
|
+|-----|------|---------|---------------------------------------------------------|
+| promEnable | 否 | boolean | 是否启用 prometheus 服务,可选配置,缺省为 false
|
| promClusterName | 否 | String | 启用 prometheus 服务时 服务节点所属于的集群名,缺省值为 "
InLong " |
-| promHttpPort | 否 | int | 启用 prometheus 服务时的侦听端口,可选配置,缺省值为 9081
|
+| promHttpPort | 否 | int | 启用 prometheus 服务时的侦听端口,可选配置,缺省值为 9081
|
---
<a href="#top">Back to top</a>
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/http_access_api.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/http_access_api.md
index bbc38d86e5d..accefcf7c22 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/http_access_api.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/http_access_api.md
@@ -1,19 +1,19 @@
---
-title: HTTP API介绍
+title: HTTP API 介绍
---
-HTTP
API是Master或者Broker对外功能暴露的接口,管控台的各项操作都是基于这些API进行;如果有最新的功能,或者管控台没有涵盖的功能,业务都可以直接通过调用HTTP
API接口完成。
+HTTP API 是 Master 或者 Broker 对外功能暴露的接口,管控台的各项操作都是基于这些 API
进行;如果有最新的功能,或者管控台没有涵盖的功能,业务都可以直接通过调用 HTTP API 接口完成。
-该部分接口一共有4个部分:
+该部分接口一共有 4 个部分:
-- Master元数据配置相关的操作接口,接口数量 24个
-- Master消费权限操作接口,接口数量 33个
-- Master订阅关系接口,接口数量 2个
-- Broker相关操作接口定义,接口数量 6个
+- Master 元数据配置相关的操作接口,接口数量 24 个
+- Master 消费权限操作接口,接口数量 33 个
+- Master 订阅关系接口,接口数量 2 个
+- Broker 相关操作接口定义,接口数量 6 个

-由于接口众多且参数繁杂,md格式不能比较好的表达,因而以excel附件形式提供给到大家:
+由于接口众多且参数繁杂,md 格式不能比较好的表达,因而以 excel 附件形式提供给到大家:
<a target="_blank"
href="/appendixfiles/http_access_api_definition_cn.xls">TubeMQ HTTP API</a>
---
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/img/sys_structure.png
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/img/sys_structure.png
index 70b4dad4ce1..a980561ca7f 100644
Binary files
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/img/sys_structure.png
and
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/img/sys_structure.png
differ
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/overview.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/overview.md
index 40f5321ea3d..dc8eb851ef9 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/overview.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/overview.md
@@ -3,39 +3,37 @@ title: 总览
sidebar_position: 1
---
-## 1 Apache InLong TubeMQ模块的架构
-经过多年演变,TubeMQ集群分为如下5个部分:
+## TubeMQ 模块的架构
+经过多年演变,TubeMQ 集群分为如下 4 个部分:

-- **Portal**:
负责对外交互和运维操作的Portal部分,包括API和Web两块,API对接集群之外的管理系统,Web是在API基础上对日常运维功能做的页面封装;
+- **Portal**: 负责对外交互和运维操作的 Portal 部分,包括 API 和 Web 两块,API 对接集群之外的管理系统,Web 是在
API 基础上对日常运维功能做的页面封装;
-- **Master**: 负责集群控制的Control部分,该部分由1个或多个Master节点组成,Master
HA通过Master节点间心跳保活、实时热备切换完成(这是大家使用TubeMQ的Lib时需要填写对应集群所有Master节点地址的原因),主Master负责管理整个集群的状态、资源调度、权限检查、元数据查询等;
+- **Master**: 负责集群控制的 Control 部分,该部分由 1 个或多个 Master 节点组成,Master HA 通过 Master
节点间心跳保活、实时热备切换完成(这是大家使用 TubeMQ 的 Lib 时需要填写对应集群所有 Master 节点地址的原因),主 Master
负责管理整个集群的状态、资源调度、权限检查、元数据查询等;
-- **Broker**:
负责实际数据存储的Store部分,该部分由相互之间独立的Broker节点组成,每个Broker节点对本节点内的Topic集合进行管理,包括Topic的增、删、改、查,Topic内的消息存储、消费、老化、分区扩容、数据消费的offset记录等,集群对外能力,包括Topic数目、吞吐量、容量等,通过水平扩展Broker节点来完成;
+- **Broker**: 负责实际数据存储的 Store 部分,该部分由相互之间独立的 Broker 节点组成,每个 Broker 节点对本节点内的
Topic 集合进行管理,包括 Topic 的增、删、改、查,Topic 内的消息存储、消费、老化、分区扩容、数据消费的 offset
记录等,集群对外能力,包括 Topic 数目、吞吐量、容量等,通过水平扩展 Broker 节点来完成;
-- **Client**:
负责数据生产和消费的Client部分,该部分我们以Lib形式对外提供,大家用得最多的是消费端,相比之前,消费端现支持Push、Pull两种数据拉取模式,数据消费行为支持顺序和过滤消费两种。对于Pull消费模式,支持业务通过客户端重置精确offset以支持业务exactly-once消费,同时,消费端新推出跨集群切换免重启的Consumer客户端;
+- **Client**: 负责数据生产和消费的 Client 部分,该部分我们以 Lib 形式对外提供,大家用得最多的是消费端,相比之前,消费端现支持
Push、Pull 两种数据拉取模式,数据消费行为支持顺序和过滤消费两种。对于 Pull 消费模式,支持业务通过客户端重置精确 offset 以支持业务
exactly-once 消费,同时,消费端新推出跨集群切换免重启的 Consumer 客户端;
-- **ZooKeeper**:
负责offset存储的ZooKeeper部分,该部分功能已弱化到仅做offset的持久化存储,考虑到接下来的多节点副本功能该模块暂时保留。
-
-## 2 Apache InLong TubeMQ模块的系统特点
-- **纯Java实现语言**:
-TubeMQ采用纯Java语言开发,便于开发人员快速熟悉项目及问题处理;
+## TubeMQ 模块的系统特点
+- **纯 Java 实现语言**:
+TubeMQ 采用纯 Java 语言开发,便于开发人员快速熟悉项目及问题处理;
- **引入协调节点**:
-TubeMQ系统采用自管理的元数据仲裁机制方式进行,Master节点通过采用内嵌数据库BDB完成集群内元数据的存储、更新以及HA热切功能,负责TubeMQ集群的运行管控和配置管理操作,对外提供接口等;通过Master节点,TubeMQ集群里的Broker配置设置、变更及查询实现了完整的自动化闭环管理,减轻了系统维护的复杂度;
+TubeMQ 系统采用自管理的元数据仲裁机制方式进行,Master 节点通过采用内嵌数据库 BDB 完成集群内元数据的存储、更新以及 HA 热切功能,负责
TubeMQ 集群的运行管控和配置管理操作,对外提供接口等;通过 Master 节点,TubeMQ 集群里的 Broker
配置设置、变更及查询实现了完整的自动化闭环管理,减轻了系统维护的复杂度;
- **服务器侧消费负载均衡**:
-TubeMQ采用的是服务侧负载均衡的方案,而不是客户端侧操作,提升系统的管控能力同时简化客户端实现,更便于均衡算法升级;
+TubeMQ 采用的是服务侧负载均衡的方案,而不是客户端侧操作,提升系统的管控能力同时简化客户端实现,更便于均衡算法升级;
- **系统行级锁操作**:
-对于Broker消息读写中存在中间状态的并发操作采用行级锁,避免重复问题;
+对于 Broker 消息读写中存在中间状态的并发操作采用行级锁,避免重复问题;
-- **Offset管理调整**:
-Offset由各个Broker独自管理,ZK只作数据持久化存储用(最初考虑完全去掉ZK依赖,考虑到后续的功能扩展就暂时保留);
+- ** Offset 管理调整**:
+Offset 由各个 Broker 独自管理,以文件形式持久化存储;
- **消息读取机制的改进**:
-TubeMQ采用消息随机读取模式,同时为了降低消息时延又增加了内存缓存读写,使其满足业务快速生产消费的需求(后面章节详细介绍);
+TubeMQ 采用消息随机读取模式,同时为了降低消息时延又增加了内存缓存读写,使其满足业务快速生产消费的需求(后面章节详细介绍);
- **消费者行为管控**:
支持通过策略实时动态地控制系统接入的消费者行为,包括系统负载高时对特定业务的限流、暂停消费,动态调整数据拉取的频率等;
@@ -44,40 +42,40 @@ TubeMQ采用消息随机读取模式,同时为了降低消息时延又增加了
针对系统运维、业务特点、机器负载状态的不同需求,系统支持运维通过策略来动态控制不同消费者的消费行为,比如是否有权限消费、消费时延分级保证、消费限流控制,以及数据拉取频率控制等;
- **系统安全管控**:
-根据业务不同的数据服务需要,以及系统运维安全的考虑,TubeMQ系统增加了TLS传输层加密管道,生产和消费服务的认证、授权,以及针对分布式访问控制的访问令牌管理,满足业务和系统运维在系统安全方面的需求;
+根据业务不同的数据服务需要,以及系统运维安全的考虑,TubeMQ 系统增加了 TLS
传输层加密管道,生产和消费服务的认证、授权,以及针对分布式访问控制的访问令牌管理,满足业务和系统运维在系统安全方面的需求;
- **资源利用率提升改进**:
-TubeMQ采用连接复用模式,减少连接资源消耗;通过逻辑分区构造,减少系统对文件句柄数的占用,通过服务器端过滤模式,减少网络带宽资源使用率;通过剥离对Zookeeper的使用,减少Zookeeper的强依赖及瓶颈限制;
+TubeMQ 采用连接复用模式,减少连接资源消耗;通过逻辑分区构造,减少系统对文件句柄数的占用,通过服务器端过滤模式,减少网络带宽资源使用率;通过剥离对
Zookeeper 的使用,解决 Zookeeper 的强依赖及瓶颈限制;
- **客户端改进**:
-基于业务使用上的便利性以,我们简化了客户端逻辑,使其做到最小的功能集合,我们采用基于响应消息的接收质量统计算法来自动剔出坏的Broker节点,基于首次使用时作连接尝试来避免大数据量发送时发送受阻(具体内容见后面章节介绍)。
+基于业务使用上的便利性以,我们简化了客户端逻辑,使其做到最小的功能集合,我们采用基于响应消息的接收质量统计算法来自动剔出坏的 Broker
节点,基于首次使用时作连接尝试来避免大数据量发送时发送受阻(具体内容见后面章节介绍)。
-## 3 Broker文件存储方案改进
-以磁盘为数据持久化媒介的系统都面临各种因磁盘问题导致的系统性能问题,TubeMQ系统也不例外,性能提升很大程度上是在解决消息数据如何读写及存储的问题。在这个方面TubeMQ进行了比较多的改进,我们采用存储实例来作为最小的Topic数据管理单元,每个存储实例包括一个文件存储块和一个内存缓存块,每个Topic可以分配多个存储实例:
+## Broker 文件存储方案改进
+以磁盘为数据持久化媒介的系统都面临各种因磁盘问题导致的系统性能问题,TubeMQ
系统也不例外,性能提升很大程度上是在解决消息数据如何读写及存储的问题。在这个方面 TubeMQ 进行了比较多的改进,我们采用存储实例来作为最小的 Topic
数据管理单元,每个存储实例包括一个文件存储块和一个内存缓存块,每个 Topic 可以分配多个存储实例:
-### 3.1 文件存储块
-
TubeMQ的磁盘存储方案类似Kafka,但又不尽相同,如下图示,每个文件存储块由一个索引文件和一个数据文件组成,partiton为数据文件里的逻辑分区,每个Topic单独维护管理文件存储块的相关机制,包括老化周期,partition个数,是否可读可写等。
+### 文件存储块
+ TubeMQ 的磁盘存储方案类似 Kafka,但又不尽相同,如下图示,每个文件存储块由一个索引文件和一个数据文件组成,partiton
为数据文件里的逻辑分区,每个 Topic 单独维护管理文件存储块的相关机制,包括老化周期,partition 个数,是否可读可写等。

-### 3.2 内存缓存块
+### 内存缓存块
在文件存储块基础上,我们额外增加了一个单独的内存缓存块,即在原有写磁盘基础上增加一块内存,隔离硬盘的慢速影响,数据先刷到内存缓存块,然后由内存缓存块批量地将数据刷到磁盘文件。

-## 4 Apache InLong TubeMQ模块的客户端演进:
-业务与TubeMQ接触得最多的是消费侧,怎样更适应业务特点、更方便业务使用我们在这块做了比较多的改进:
+## TubeMQ 模块的客户端演进:
+业务与 TubeMQ 接触得最多的是消费侧,怎样更适应业务特点、更方便业务使用我们在这块做了比较多的改进:
-- **数据拉取模式支持Push、Pull:**
- - **Push客户端:**
TubeMQ最初消费端版本只提供Push模式的消费,这种模式能比较快速地消费数据,减轻服务端压力,但同时也带来一个问题,业务使用的时候因为无法控制拉取频率,从而容易形成数据积压数据处理不过来;
+- **数据拉取模式支持 Push、Pull:**
+ - **Push 客户端:** TubeMQ 最初消费端版本只提供 Push
模式的消费,这种模式能比较快速地消费数据,减轻服务端压力,但同时也带来一个问题,业务使用的时候因为无法控制拉取频率,从而容易形成数据积压数据处理不过来;
- - **带消费中止/继续的Push客户端:**
在收到业务反馈能否控制Push拉取动作的需求后,我们增加了resumeConsume()/pauseConsume()函数对,让业务可以模拟水位线控制机制,状态比较繁忙时调用pauseConsume()函数来中止Lib后台的数据拉取,在状态恢复后,再调用resumeConsume()通知Lib后台继续拉取数据;
+ - **带消费中止/继续的 Push 客户端:** 在收到业务反馈能否控制Push拉取动作的需求后,我们增加了
resumeConsume()/pauseConsume() 函数对,让业务可以模拟水位线控制机制,状态比较繁忙时调用 pauseConsume()
函数来中止 Lib 后台的数据拉取,在状态恢复后,再调用 resumeConsume() 通知 Lib 后台继续拉取数据;
- - **Pull客户端:**
我们后来版本里增加了Pull客户端,该客户端有别于Push客户端,是由业务而非Lib主动的拉取消息并对数据处理的结果进行成功与否的确认,将数据处理的主动权留给业务。这样处理后,虽然服务端压力有所提升,但业务消费时积压情况可大大缓解。
+ - **Pull 客户端:** 我们后来版本里增加了 Pull 客户端,该客户端有别于 Push 客户端,是由业务而非 Lib
主动的拉取消息并对数据处理的结果进行成功与否的确认,将数据处理的主动权留给业务。这样处理后,虽然服务端压力有所提升,但业务消费时积压情况可大大缓解。
-- **数据消费行为支持顺序和过滤消费:**
在TubeMQ设计初我们考虑是不同业务使用不同的Topic,实际运营中我们发现不少业务实际上是通过代理模式上报的数据,数据通过Topic下的文件ID或者表ID属性来区分,业务为了消费自己的一份数据是需要全量消费该Topic下的所有数据。我们通过tid字段支持指定属性的过滤消费模式,将数据过滤放到服务端来做,减少出流量以及客户端的数据处理压力。
+- **数据消费行为支持顺序和过滤消费:** 在 TubeMQ 设计初我们考虑是不同业务使用不同的
Topic,实际运营中我们发现不少业务实际上是通过代理模式上报的数据,数据通过 Topic 下的文件 ID 或者表 ID
属性来区分,业务为了消费自己的一份数据是需要全量消费该 Topic 下的所有数据。我们通过 tid
字段支持指定属性的过滤消费模式,将数据过滤放到服务端来做,减少出流量以及客户端的数据处理压力。
-- **支持业务exactly-once消费:**
为了解决业务处理数据时需要精确回档的需求,在客户端版本里提供了通过客户端重置精确offset功能,业务重启系统时,只需通过客户端提供待回拨时间点的消费上下文,TubeMQ即可按照指定的精确位置接续消费。该特性目前已在Flink这类实时计算框架使用,依托Flink基于checkpoint机制进行exactly-once数据处理。
+- **支持业务 exactly-once 消费:** 为了解决业务处理数据时需要精确回档的需求,在客户端版本里提供了通过客户端重置精确 offset
功能,业务重启系统时,只需通过客户端提供待回拨时间点的消费上下文,TubeMQ 即可按照指定的精确位置接续消费。该特性目前已在 Flink
这类实时计算框架使用,依托 Flink 基于 checkpoint 机制进行 exactly-once 数据处理。
---
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/quick_start.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/quick_start.md
index c5732c8fe30..82c684a3555 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/quick_start.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/modules/tubemq/quick_start.md
@@ -2,20 +2,24 @@
title: 快速开始
sidebar_position: 1
---
-## 1 部署运行
+## 部署运行
-### 1.1 配置示例
-TubeMQ 集群包含有两个组件: **Master** 和 **Broker**. Master 和 Broker
可以部署在相同或者不同的节点上,依照业务对机器的规划进行处理。我们通过如下3台机器搭建有2台Master的生产、消费的集群进行配置示例:
+### 配置示例
+TubeMQ 集群包含有两个组件: **Master** 和 **Broker**. Master 和 Broker
可以部署在相同或者不同的节点上,依照业务对机器的规划进行处理。我们通过如下 3 台机器搭建有 2 台 Master 的生产、消费的集群进行配置示例:
-| 所属角色 | TCP端口 | TLS端口 | WEB端口 | 备注 |
-| --- | --- | --- | --- |------------------------------------------|
-| Master | 8099 | 8199 | 8080 | 元数据存储在ZooKeeper的`/tubemq`目录 |
-| Broker | 8123 | 8124 | 8081 | 消息储存在`/stage/msg_data` |
-| ZooKeeper | 2181 | | | 存储Master元数据及Broker的Offset内容,根目录`/tubemq` |
+| 所属角色 | TCP 端口 | TLS 端口 | WEB 端口 | 备注
|
+| ---
|--------|--------|--------|---------------------------------------------------|
+| Master | 8099 | 8199 | 8080 | 元数据存储在 ZooKeeper 的 `/tubemq` 目录
|
+| Broker | 8123 | 8124 | 8081 | 消息储存在 `/stage/msg_data`
|
+| ZooKeeper | 2181 | | | 存储 Master 元数据,如果配置 meta_bdb
则该组件不需要,根目录 `/tubemq` |
-### 1.2 准备工作
+### 准备工作
- ZooKeeper集群
+ZooKeeper 在 TubeMQ 环境里不是必选,如果 Master 元数据采用 BDB 存储,则该部分资源可以省略
+
+- TubeMQ 安装包部署
+
选择安装路径后,安装包解压后的目录结构如下:
```
/INSTALL_PATH/inlong-tubemq-server/
@@ -26,68 +30,68 @@ TubeMQ 集群包含有两个组件: **Master** 和 **Broker**. Master 和 Broker
└── resources
```
-### 1.3 配置Master
-编辑`conf/master.ini`,根据集群信息变更以下配置项
+### 配置 Master
+编辑 `conf/master.ini`,根据集群信息变更以下配置项
-- Master IP和端口
+- Master IP 和端口
```ini
[master]
-hostName=YOUR_SERVER_IP // 替换为当前主机IP
+hostName=YOUR_SERVER_IP // 替换为当前主机 IP
port=8099
webPort=8080
```
-- 访问授权Token
+- 访问授权 Token
```ini
-confModAuthToken=abc // 该token用于页面配置、API调用等
+confModAuthToken=abc // 该 token 用于页面配置、API 调用等
```
-- 配置meta_zookeeper策略
+- 配置 meta_zookeeper 策略
```ini
-[meta_zookeeper] //
同一个集群里Master必须使用同一套zookeeper环境,且配置一致
+[meta_zookeeper] // 同一个集群里 Master 必须使用同一套
zookeeper 环境,且配置一致
zkNodeRoot=/tubemq
-zkServerAddr=localhost:2181 // 指向zookeeper集群,多个地址逗号分开
+zkServerAddr=localhost:2181 // 指向 zookeeper 集群,多个地址逗号分开
```
-- 配置meta_bdb策略(可选)
-
**注意**:由于Apache依赖包的LICENSE问题,从1.1.0版本开始TubeMQ发布的包不再包含BDB包,如果需要BDB存储元数据,业务需要自行下载com.sleepycat.je-7.3.7.jar包,要不系统运行时会报“
java.lang.ClassNotFoundException: com.sleepycat.je.ReplicaConsistencyPolicy”错误。
+- 配置 meta_bdb 策略(可选)
+ **注意**:由于 Apache 依赖包的 LICENSE 问题,从 1.1.0 版本开始 TubeMQ 发布的包不再包含 BDB 包,如果需要 BDB
存储元数据,业务需要自行下载 com.sleepycat.je-7.3.7.jar 包,要不系统运行时会报 “
java.lang.ClassNotFoundException: com.sleepycat.je.ReplicaConsistencyPolicy” 错误。
```ini
[meta_bdb]
-repGroupName=tubemqGroup1 // 同一个集群的Master必须要用同一个组名,且不同集群的组名必须不同
-repNodeName=tubemqGroupNode1 // 同一个集群的master节点名必须是不同的名称
+repGroupName=tubemqGroup1 // 同一个集群的 Master
必须要用同一个组名,且不同集群的组名必须不同
+repNodeName=tubemqGroupNode1 // 同一个集群的 master 节点名必须是不同的名称
metaDataPath=/stage/meta_data
-repHelperHost=FIRST_MASTER_NODE_IP:9001 //
helperHost用于创建master集群,一般配置第一个master节点ip
+repHelperHost=FIRST_MASTER_NODE_IP:9001 // helperHost 用于创建 master 集群,一般配置第一个
master 节点 ip
```
-- (可选)生产环境,多master HA级别
+- (可选)生产环境,多 master HA 级别
-| HA级别 | Master数量 | 描述 |
-| -------- | ------------- | ----------- |
-| 高 | 3 masters | 任何主节点崩溃后,集群元数据仍处于读/写状态,可以接受新的生产者/消费者。 |
-| 中 | 2 masters | 一个主节点崩溃后,集群元数据处于只读状态。对现有的生产者和消费者没有任何影响。 |
-| 低 | 1 master | 主节点崩溃后,对现有的生产者和消费者没有影响。 |
+| HA 级别 | Master 数量 | 描述 |
+|-------|-----------| ----------- |
+| 高 | 3 masters | 任何主节点崩溃后,集群元数据仍处于读/写状态,可以接受新的生产者/消费者。 |
+| 中 | 2 masters | 一个主节点崩溃后,集群元数据处于只读状态。对现有的生产者和消费者没有任何影响。 |
+| 低 | 1 master | 主节点崩溃后,对现有的生产者和消费者没有影响。 |
**注意**:
-- 基于Docker容器化的需要,master.ini文件里对[meta_zookeeper] 或 [meta_bdb]
如上3个参数部分都是使用的缺省设置,在实际组网使用时需要以Master节点真实信息配置
-- Master所有节点的IP信息要在hosts配置文件里构造IP与hostName映射关系,如类似“192.168.0.1 192-168-0-1”
-- 需保证Master所有节点之间的时钟同步
+- 基于 Docker 容器化的需要,master.ini 文件里对 [meta_zookeeper] 或 [meta_bdb] 如上 3
个参数部分都是使用的缺省设置,在实际组网使用时需要以 Master 节点真实信息配置
+- Master 所有节点的 IP 信息要在 hosts 配置文件里构造 IP 与 hostName 映射关系,如类似 “192.168.0.1
192-168-0-1”
+- 需保证 Master 所有节点之间的时钟同步
-### 1.4 配置Broker
-编辑`conf/broker.ini`,根据集群信息变更以下配置项
-- Broker IP和端口
+### 配置Broker
+编辑 `conf/broker.ini`,根据集群信息变更以下配置项
+- Broker IP 和端口
```ini
[broker]
brokerId=0
-hostName=YOUR_SERVER_IP // 替换为当前主机IP,broker目前只支持IP
+hostName=YOUR_SERVER_IP // 替换为当前主机 IP,broker 目前只支持 IP
port=8123
webPort=8081
defEthName=eth1 // 获取真实 IP 的网卡
```
-- Master地址
+- Master 地址
```ini
-masterAddressList=YOUR_MASTER_IP1:8099,YOUR_MASTER_IP2:8099 //多个master以逗号分隔
+masterAddressList=YOUR_MASTER_IP1:8099,YOUR_MASTER_IP2:8099 //多个 master 以逗号分隔
```
- 数据目录
@@ -95,24 +99,17 @@ masterAddressList=YOUR_MASTER_IP1:8099,YOUR_MASTER_IP2:8099
//多个master以
primaryPath=/stage/msg_data
```
-- ZooKeeper集群地址
-```ini
-[zookeeper] //
同一个集群里Master和Broker必须使用同一套zookeeper环境,且配置一致
-zkNodeRoot=/tubemq
-zkServerAddr=localhost:2181 // 指向zookeeper集群,多个地址逗号分开
-```
-
-### 1.5 启动Master
-进入Master节点的 `bin` 目录下,启动服务:
+### 启动 Master
+进入 Master 节点的 `bin` 目录下,启动服务:
```bash
./tubemq.sh master start
```
-访问Master的管控台 `http://YOUR_MASTER_IP:8080` ,页面可查则表示master已成功启动:
+访问Master的管控台 `http://YOUR_MASTER_IP:8080` ,页面可查则表示 master 已成功启动:

-#### 1.5.1 配置Broker元数据
-Broker启动前,首先要在Master上配置Broker元数据,增加Broker相关的管理信息。在`Broker List` 页面, `Add
Single Broker`,然后填写相关信息:
+#### 配置 Broker 元数据
+Broker 启动前,首先要在 Master 上配置 Broker 元数据,增加 Broker 相关的管理信息。在 `Broker List` 页面,
`Add Single Broker`,然后填写相关信息:

@@ -123,43 +120,43 @@ Broker启动前,首先要在Master上配置Broker元数据,增加Broker相
然后上线Broker:

-### 1.6 启动Broker
-进入broker节点的 `bin` 目录下,执行以下命令启动Broker服务:
+### 启动 Broker
+进入 broker 节点的 `bin` 目录下,执行以下命令启动 Broker 服务:
```bash
./tubemq.sh broker start
```
-刷新页面可以看到 Broker 已经注册,当 `当前运行子状态` 为 `idle` 时, 可以增加topic:
+刷新页面可以看到 Broker 已经注册,当 `当前运行子状态` 为 `idle` 时, 可以增加 topic:

-## 2 快速使用
-### 2.1 新增 Topic
+## 快速使用
+### 新增 Topic
-可以通过 web GUI 添加 Topic, 在 `Topic列表`页面添加,需要填写相关信息,比如增加`demo` topic:
+可以通过 web GUI 添加 Topic, 在 `Topic列表` 页面添加,需要填写相关信息,比如增加 `demo` topic:

然后选择部署 Topic 的 Broker

-此时 Broker的 `可发布` 和 `可订阅` 依旧是灰色的
+此时 Broker 的 `可发布` 和 `可订阅` 依旧是灰色的

-需要在 `Broker列表`页面重载Broker 配置
+需要在 `Broker列表` 页面重载 Broker 配置


-之后就可以在页面查看Topic信息。
+之后就可以在页面查看 Topic 信息。

-### 2.2 运行Example
-可以通过上面创建的`demo` topic来测试集群。
+### 运行 Example
+可以通过上面创建的 `demo` topic 来测试集群。
-#### 2.2.1 生产消息
-将 `YOUR_MASTER_IP:port` 替换为实际的IP和端口,然后运行producer:
+#### 生产消息
+将 `YOUR_MASTER_IP:port` 替换为实际的 IP 和端口,然后运行 producer:
```bash
cd /INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin
./bin/tubemq-producer-test.sh --master-servers
YOUR_MASTER_IP1:port,YOUR_MASTER_IP2:port --topicName demo
@@ -168,8 +165,8 @@ cd
/INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin
如果能观察下如下日志,则表示数据发送成功:

-#### 2.2.2 消费消息
-将 `YOUR_MASTER_IP:port` 替换为实际的IP和端口,然后运行Consumer:
+#### 消费消息
+将 `YOUR_MASTER_IP:port` 替换为实际的 IP 和端口,然后运行 Consumer:
```bash
cd /INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin
./bin/tubemq-consumer-test.sh --master-servers
YOUR_MASTER_IP1:port,YOUR_MASTER_IP2:port --topicName demo --groupName
test_consume
@@ -179,12 +176,9 @@ cd
/INSTALL_PATH/apache-inlong-tubemq-server-[TUBEMQ-VERSION]-bin

-## 3 部署 Manager
+## 部署 Manager
参考 [InLong TubeMQ Manager](modules/tubemq/tubemq-manager/quick_start.md)
-## 4 结束
-在这里,已经完成了TubeMQ的编译,部署,系统配置,启动,生产和消费。如果需要了解更深入的内容,请查看《TubeMQ HTTP
API》里的相关内容,进行相应的配置设置。
-
---
<a href="#top">Back to top</a>