Skip to content

Commit 0ed8ba8

Browse files
author
zengqiao
committed
补充KCM使用文档
1 parent 4f3c1ad commit 0ed8ba8

File tree

3 files changed

+178
-0
lines changed

3 files changed

+178
-0
lines changed
69.4 KB
Loading
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<mxfile host="65bd71144e">
2+
<diagram id="bhaMuW99Q1BzDTtcfRXp" name="Page-1">
3+
<mxGraphModel dx="1138" dy="830" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0"/>
6+
<mxCell id="1" parent="0"/>
7+
<mxCell id="11" value="待部署Kafka-Broker的机器" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;dashed=1;" vertex="1" parent="1">
8+
<mxGeometry x="380" y="240" width="320" height="240" as="geometry"/>
9+
</mxCell>
10+
<mxCell id="24" value="" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;labelPosition=center;verticalLabelPosition=bottom;align=center;verticalAlign=top;dashed=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
11+
<mxGeometry x="410" y="310" width="260" height="160" as="geometry"/>
12+
</mxCell>
13+
<mxCell id="6" style="edgeStyle=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="3">
14+
<mxGeometry relative="1" as="geometry"/>
15+
</mxCell>
16+
<mxCell id="7" value="调用夜莺接口,&lt;br&gt;创建集群安装部署任务" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="6">
17+
<mxGeometry x="-0.0875" y="1" relative="1" as="geometry">
18+
<mxPoint x="9" y="1" as="offset"/>
19+
</mxGeometry>
20+
</mxCell>
21+
<mxCell id="9" style="edgeStyle=none;html=1;" edge="1" parent="1" source="2" target="4">
22+
<mxGeometry relative="1" as="geometry"/>
23+
</mxCell>
24+
<mxCell id="10" value="通过版本管理,将Kafka的安装包,&lt;br&gt;server配置上传到s3中" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="9">
25+
<mxGeometry x="0.0125" y="2" relative="1" as="geometry">
26+
<mxPoint as="offset"/>
27+
</mxGeometry>
28+
</mxCell>
29+
<mxCell id="2" value="LogiKM" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
30+
<mxGeometry x="40" y="100" width="120" height="40" as="geometry"/>
31+
</mxCell>
32+
<mxCell id="12" style="edgeStyle=none;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="5">
33+
<mxGeometry relative="1" as="geometry"/>
34+
</mxCell>
35+
<mxCell id="13" value="1、下发任务脚本(kcm_script.sh);&lt;br&gt;2、下发任务操作命令;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="12">
36+
<mxGeometry x="-0.0731" y="2" relative="1" as="geometry">
37+
<mxPoint x="-2" y="-16" as="offset"/>
38+
</mxGeometry>
39+
</mxCell>
40+
<mxCell id="3" value="夜莺——任务中心" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#cdeb8b;strokeColor=#36393d;" vertex="1" parent="1">
41+
<mxGeometry x="480" y="100" width="120" height="40" as="geometry"/>
42+
</mxCell>
43+
<mxCell id="4" value="S3" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
44+
<mxGeometry x="40" y="310" width="120" height="40" as="geometry"/>
45+
</mxCell>
46+
<mxCell id="5" value="夜莺——Agent(&lt;font color=&quot;#ff3333&quot;&gt;代理执行kcm_script.sh脚本&lt;/font&gt;)" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
47+
<mxGeometry x="400" y="260" width="280" height="40" as="geometry"/>
48+
</mxCell>
49+
<mxCell id="22" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fontColor=#FF3333;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="14" target="4">
50+
<mxGeometry relative="1" as="geometry"/>
51+
</mxCell>
52+
<mxCell id="25" value="下载安装包" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontColor=#000000;" vertex="1" connectable="0" parent="22">
53+
<mxGeometry x="0.2226" y="-2" relative="1" as="geometry">
54+
<mxPoint x="27" y="2" as="offset"/>
55+
</mxGeometry>
56+
</mxCell>
57+
<mxCell id="14" value="执行kcm_script.sh脚本:下载安装包" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
58+
<mxGeometry x="425" y="320" width="235" height="20" as="geometry"/>
59+
</mxCell>
60+
<mxCell id="18" value="执行kcm_script.sh脚本:安装" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
61+
<mxGeometry x="425" y="350" width="235" height="20" as="geometry"/>
62+
</mxCell>
63+
<mxCell id="19" value="执行kcm_script.sh脚本:检查安装结果" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
64+
<mxGeometry x="425" y="380" width="235" height="20" as="geometry"/>
65+
</mxCell>
66+
<mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontColor=#FF3333;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="20" target="2">
67+
<mxGeometry relative="1" as="geometry">
68+
<Array as="points">
69+
<mxPoint x="770" y="420"/>
70+
<mxPoint x="770" y="40"/>
71+
<mxPoint x="100" y="40"/>
72+
</Array>
73+
</mxGeometry>
74+
</mxCell>
75+
<mxCell id="26" value="检查副本同步状态" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontColor=#000000;" vertex="1" connectable="0" parent="23">
76+
<mxGeometry x="-0.3344" relative="1" as="geometry">
77+
<mxPoint as="offset"/>
78+
</mxGeometry>
79+
</mxCell>
80+
<mxCell id="20" value="执行kcm_script.sh脚本:检查副本同步" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
81+
<mxGeometry x="425" y="410" width="235" height="20" as="geometry"/>
82+
</mxCell>
83+
<mxCell id="21" value="执行kcm_script.sh脚本:结束" style="rounded=0;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=14;strokeWidth=1;fillColor=#eeeeee;strokeColor=#36393d;" vertex="1" parent="1">
84+
<mxGeometry x="425" y="440" width="235" height="20" as="geometry"/>
85+
</mxCell>
86+
</root>
87+
</mxGraphModel>
88+
</diagram>
89+
</mxfile>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
---
3+
4+
![kafka-manager-logo](../assets/images/common/logo_name.png)
5+
6+
**一站式`Apache Kafka`集群指标监控与运维管控平台**
7+
8+
---
9+
10+
# 如何使用集群安装部署功能?
11+
12+
[TOC]
13+
14+
## 1、实现原理
15+
16+
![KCM实现原理](./assets/kcm/kcm_principle.png)
17+
18+
- LogiKM上传安装包到S3服务;
19+
- LogiKM调用夜莺-Job服务接口,创建执行[kcm_script.sh](https://github.com/didi/LogiKM/blob/master/kafka-manager-extends/kafka-manager-kcm/src/main/resources/kcm_script.sh)脚本的任务,kcm_script.sh脚本是安装部署Kafka集群的脚本;
20+
- 夜莺将任务脚本下发到具体的机器上,通过夜莺Agent执行该脚本;
21+
- kcm_script.sh脚本会进行Kafka-Broker的安装部署;
22+
23+
24+
---
25+
26+
## 2、使用方式
27+
28+
### 2.1、第一步:修改配置
29+
30+
**配置application.yml文件**
31+
```yaml
32+
#
33+
kcm:
34+
enabled: false # 是否开启,将其修改为true
35+
s3: # s3 存储服务
36+
endpoint: s3.didiyunapi.com
37+
access-key: 1234567890
38+
secret-key: 0987654321
39+
bucket: logi-kafka
40+
n9e: # 夜莺
41+
base-url: http://127.0.0.1:8004 # 夜莺job服务地址
42+
user-token: 12345678 # 用户的token
43+
timeout: 300 # 单台操作的超时时间
44+
account: root # 操作时使用的账号
45+
script-file: kcm_script.sh # 脚本,已内置好,在源码的kcm模块内,此处配置无需修改
46+
logikm-url: http://127.0.0.1:8080 # logikm部署地址,部署时kcm_script.sh会调用logikm检查部署中的一些状态,这里只需要填写 http://IP:PORT 就可以了
47+
48+
49+
account:
50+
jump-login:
51+
gateway-api: false # 网关接口
52+
third-part-api: false # 第三方接口,将其修改为true,即允许未登录情况下调用开放的第三方接口
53+
```
54+
55+
### 2.2、第二步:检查服务
56+
57+
**检查s3服务**
58+
- 测试 "运维管控-》集群运维-》版本管理" 页面的上传,查看等功能是否都正常。如果存在不正常,则需要查看s3的配置是否正确;
59+
- 如果都没有问题,则上传Kafka的以.tgz结尾的安装包以及server.properties文件;
60+
61+
**检查夜莺Job服务**
62+
- 创建一个job任务,机器选择需要安装Kafka集群的机器,然后执行的命令是echo "Hello LogiKM",看能否被成功执行。如果不行,则需要检查夜莺的安装;
63+
- 如果没有问题则表示夜莺和所需部署的机器之间的交互是没有问题的;
64+
65+
### 2.3、第三步:接入集群
66+
67+
在LogiKM的 “运维管控-》集群列表” 中接入需要安装部署的集群,**PS:此时是允许接入一个没有任何Broker的空的Kafka集群**,其中对的bootstrapServers配置搭建完成后的Kafka集群地址就可以了,而ZK地址必须和集群的server.properties中的ZK地址保持一致;
68+
69+
### 2.4、第四步:部署集群
70+
71+
- 打开LogiKM的 “运维管控-》集群运维-》集群任务” 页面,点击 “新建集群任务” 按钮;
72+
- 选择集群、任务类型、包版本、server配置及填写主机列表,然后点击确认,即可在夜莺的Job服务中心中创建一个任务出来。**PS:如果创建失败,可以看一下日志我为什么创建失败**;
73+
- 随后可以点击详情及状态对任务进行操作;
74+
75+
### 2.5、可能问题
76+
77+
#### 2.5.1、问题一:任务执行超时、失败等
78+
79+
进入夜莺Job服务中心,查看对应的任务的相关日志;
80+
81+
- 提示安装包下载失败,则需要查看对应的s3服务是否可以直接wget下载安装包,如果不可以则需要对kcm_script.sh脚本进行修改;
82+
- 提示调用LogiKM失败,则可以使用postman手动测试一下kcm_script.sh脚本调用LogiKM的那个接口是否有问题,如果存在问题则进行相应的修改;PS:具体接口见kcm_script.sh脚本
83+
84+
85+
## 3、备注说明
86+
87+
- 集群安装部署,仅安装部署Kafka-Broker,不安装Kafka的ZK服务;
88+
- 安装部署中,有任何定制化的需求,例如修改安装的目录等,可以通过修改kcm_script.sh脚本实现;
89+
- kcm_script.sh脚本位置:[kcm_script.sh](https://github.com/didi/LogiKM/blob/master/kafka-manager-extends/kafka-manager-kcm/src/main/resources/kcm_script.sh);

0 commit comments

Comments
 (0)