You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2021/07/22 06:08:04 UTC
[incubator-inlong-website] branch master updated: [INLONG-779]
update doc for tubemq manager (#100)
This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git
The following commit(s) were added to refs/heads/master by this push:
new b6bf742 [INLONG-779] update doc for tubemq manager (#100)
b6bf742 is described below
commit b6bf7426618b7190ad36a2865304fdad8ce120a3
Author: dockerzhang <do...@apache.org>
AuthorDate: Thu Jul 22 14:07:58 2021 +0800
[INLONG-779] update doc for tubemq manager (#100)
Co-authored-by: dockerzhang <do...@tencent.com>
---
.../modules/tubemq/tubemq-manager/quick_start.md | 74 ++++++---------------
.../modules/tubemq/tubemq-manager/quick_start.md | 76 ++++++----------------
2 files changed, 42 insertions(+), 108 deletions(-)
diff --git a/docs/en-us/modules/tubemq/tubemq-manager/quick_start.md b/docs/en-us/modules/tubemq/tubemq-manager/quick_start.md
index 1a276e2..d8d4e6e 100644
--- a/docs/en-us/modules/tubemq/tubemq-manager/quick_start.md
+++ b/docs/en-us/modules/tubemq/tubemq-manager/quick_start.md
@@ -1,54 +1,39 @@
-## deploy
+## Deploy TubeMQ Manager
All deploying files at `inlong-tubemq-manager` directory.
### configuration
-Add mysql information in conf/application.properties:
+- create `tubemanager` and account in MySQL.
+- Add mysql information in conf/application.properties:
```ini
-spring.jpa.hibernate.ddl-auto=update
-# configuration for manager
-spring.datasource.url=jdbc:mysql://[replace_by_mysql_address]:3306/tubemanager
-spring.datasource.username=[replace_by_usename]
-spring.datasource.password=[replace_by_password]
-# server port
-server.port=8089
+# mysql configuration for manager
+spring.datasource.url=jdbc:mysql://mysql_ip:mysql_port/tubemanager
+spring.datasource.username=mysql_username
+spring.datasource.password=mysql_password
```
### start service
-Add the database tubemanager and start:
``` bash
-$ bin/start-admin.sh
+$ bin/start-manager.sh
```
-## usage
-
-### create cluster
-
-Before using tubeAdmin to operate the cluster, you first need to register the cluster information, and use the following interface to add a cluster:
-/v1/cluster?method=add
-
- POST
-
-parameter:
-
- {
- "masterIp": "127.0.0.1", (tubemq master ip)
- "clusterName": "test",
- "masterPort": "8000", (tubemq master port)
- "masterWebPort": "8080", (tubemq master web port)
- "createUser": "test",
- "token": "abc" (tubemq token)
- }
+### register TubeMQ cluster
+replace `master_ip` and other parameters of TubeMQ Clusters, .
+```
+curl --header "Content-Type: application/json" --request POST --data \
+'{"masterIp":"master_ip","clusterName":"inlong","masterPort":"8715","masterWebPort":"8080","createUser":"manager","token":"abc"}' \
+http://127.0.0.1:8089/v1/cluster?method=add
+```
-### Operation interface
+### Appendix: Other Operation interface
#### cluster
Query full data of clusterId and clusterName (get)
Example
-GET
-/v1/cluster
+
+【GET】 /v1/cluster
return value
@@ -81,8 +66,7 @@ AddTopicTasks is a list of the following objects, which can carry multiple creat
Example
-POST
-/v1/task?method=addTopicTask
+【POST】 /v1/task?method=addTopicTask
{
"clusterId": "1",
@@ -110,7 +94,7 @@ If result is false, the writing task failed
example
-POST
+【POST】 /v1/topic?method=queryCanWrite
{
"clusterId": "1",
@@ -124,20 +108,4 @@ return json
{ "result":false, "errCode": 100, "errMsg":"topic test is not writable"}
{ "result":false, "errCode": 101, "errMsg":"no such topic in master"}
-result is false as not writable
-
-
-
-### curls for operations
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"masterIp":"masterip","clusterName":"test","masterPort":"8099","masterWebPort":"8080","createUser":"test","token":"abc"}' \
- http://tubemanagerip:tubemanagerport/v1/cluster?method=add
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"clusterId":"1","addTopicTasks":[{"topicName": "testfordocker"}],"user":"test"}' \
- http://tubemanagerip:tubemanagerport/v1/task?method=addTopicTask
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"clusterId":"1","topicName":"testfordocker","user":"test"}' \
- http://tubemanagerip:tubemanagerport/v1/topic?method=queryCanWrite
\ No newline at end of file
+result is false as not writable
\ No newline at end of file
diff --git a/docs/zh-cn/modules/tubemq/tubemq-manager/quick_start.md b/docs/zh-cn/modules/tubemq/tubemq-manager/quick_start.md
index b610cb7..d40cce6 100644
--- a/docs/zh-cn/modules/tubemq/tubemq-manager/quick_start.md
+++ b/docs/zh-cn/modules/tubemq/tubemq-manager/quick_start.md
@@ -1,55 +1,39 @@
-## 部署
+## 部署TubeMQ Manager
安装文件在inlong-tubemq-manager目录.
### 配置
-在conf/application.properties中添加mysql信息:
+- 在mysql中创建`tubemanager`数据和相应用户.
+- 在conf/application.properties中添加mysql信息:
```ini
-spring.jpa.hibernate.ddl-auto=update
-# configuration for manager
-spring.datasource.url=jdbc:mysql://[replace_by_mysql_address]:3306/tubemanager
-spring.datasource.username=[replace_by_usename]
-spring.datasource.password=[replace_by_password]
-# server port
-server.port=8089
+# mysql configuration for manager
+spring.datasource.url=jdbc:mysql://mysql_ip:mysql_port/tubemanager
+spring.datasource.username=mysql_username
+spring.datasource.password=mysql_password
```
### 启动服务
-添加数据库tubemanager,并启动:
``` bash
-$ bin/start-admin.sh
+$ bin/start-manager.sh
```
-## 使用
-
-### 新建集群
-
-在使用tubeAdmin操作集群之前,首先需要注册集群信息,使用如下接口添加一个集群:
-
- /v1/cluster?method=add
-
- POST
-
-参数:
-
- {
- "masterIp": "127.0.0.1", (tubemq master ip)
- "clusterName": "test",
- "masterPort": "8000", (tubemq master port)
- "masterWebPort": "8080", (tubemq master web port)
- "createUser": "test",
- "token": "abc" (tubemq token)
- }
+### 注册TubeMQ集群
+替换`master_ip`等TubeMQ集群参数,然后执行以下命令:
+```
+curl --header "Content-Type: application/json" --request POST --data \
+'{"masterIp":"master_ip","clusterName":"inlong","masterPort":"8715","masterWebPort":"8080","createUser":"manager","token":"abc"}' \
+http://127.0.0.1:8089/v1/cluster?method=add
+```
-### 操作接口
+### 附录:其它操作接口
#### cluster
查询clusterId以及clusterName全量数据 (get)
示例
-GET
-/v1/cluster
+
+【GET】 /v1/cluster
返回值
@@ -80,8 +64,7 @@ AddTopicTasks 为以下对象的List,可携带多个创建topic请求
示例
-POST
-/v1/task?method=addTopicTask
+【POST】 /v1/task?method=addTopicTask
{
"clusterId": "1",
@@ -110,9 +93,7 @@ result为false为写入task失败
示例
-POST
-
- /v1/topic?method=queryCanWrite
+【POST】 /v1/topic?method=queryCanWrite
{
"clusterId": "1",
@@ -127,19 +108,4 @@ POST
{ "result":false, "errCode": 100, "errMsg":"topic test is not writable"}
{ "result":false, "errCode": 101, "errMsg":"no such topic in master"}
-result为false为不可写
-
-
-### 附录:以上操作的curl
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"masterIp":"masterip","clusterName":"test","masterPort":"8099","masterWebPort":"8080","createUser":"test","token":"abc"}' \
- http://tubemanagerip:tubemanagerport/v1/cluster?method=add
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"clusterId":"1","addTopicTasks":[{"topicName": "testfordocker"}],"user":"test"}' \
- http://tubemanagerip:tubemanagerport/v1/task?method=addTopicTask
-
- curl --header "Content-Type: application/json" --request POST --data \
- '{"clusterId":"1","topicName":"testfordocker","user":"test"}' \
- http://tubemanagerip:tubemanagerport/v1/topic?method=queryCanWrite
\ No newline at end of file
+result为false为不可写
\ No newline at end of file