mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-25 04:32:12 +08:00
Compare commits
297 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89405fe003 | ||
|
|
b9ea3865a5 | ||
|
|
b5bd643814 | ||
|
|
5bc6eb6774 | ||
|
|
3ba81e9aaa | ||
|
|
329a9b59c1 | ||
|
|
22c26e24b1 | ||
|
|
396045177c | ||
|
|
e311d3767c | ||
|
|
24d7b80244 | ||
|
|
61f99e4d2e | ||
|
|
d5348bcf49 | ||
|
|
5d31d66365 | ||
|
|
29778a0154 | ||
|
|
165c0a5866 | ||
|
|
588323961e | ||
|
|
fd1c0b71c5 | ||
|
|
54fbdcadf9 | ||
|
|
69a30d0cf0 | ||
|
|
b8f9b44f38 | ||
|
|
cbf17d4eb5 | ||
|
|
327e025262 | ||
|
|
6b1e944bba | ||
|
|
668ed4d61b | ||
|
|
312c0584ed | ||
|
|
110d3acb58 | ||
|
|
ddbc60283b | ||
|
|
471bcecfd6 | ||
|
|
0245791b13 | ||
|
|
4794396ce8 | ||
|
|
c7088779d6 | ||
|
|
672905da12 | ||
|
|
47172b13be | ||
|
|
3668a10af6 | ||
|
|
a4e294c03f | ||
|
|
3fd6f4003f | ||
|
|
3eaf5cd530 | ||
|
|
c344fd8ca4 | ||
|
|
09639ca294 | ||
|
|
a81b6dca83 | ||
|
|
b74aefb08f | ||
|
|
757f90aa7a | ||
|
|
7e1b3c552b | ||
|
|
69736a63b6 | ||
|
|
fb4a9f9056 | ||
|
|
387d89d3af | ||
|
|
65d9ca9d39 | ||
|
|
8c842af4ba | ||
|
|
4faf9262c9 | ||
|
|
be7724c67d | ||
|
|
48d26347f7 | ||
|
|
bdb01ec8b5 | ||
|
|
9047815799 | ||
|
|
05bd94a2cc | ||
|
|
c9f7da84d0 | ||
|
|
bcc124e86a | ||
|
|
48d2733403 | ||
|
|
31fc6e4e56 | ||
|
|
fcdeef0146 | ||
|
|
1cd524c0cc | ||
|
|
0f746917a7 | ||
|
|
a2228d0169 | ||
|
|
e8a679d34b | ||
|
|
1912a42091 | ||
|
|
ca81f96635 | ||
|
|
eb3b8c4b31 | ||
|
|
6740d6d60b | ||
|
|
c46c35b248 | ||
|
|
0b2dcec4bc | ||
|
|
f8e2a4aff4 | ||
|
|
7256db8c4e | ||
|
|
b14d5d9bee | ||
|
|
12e15c3e4b | ||
|
|
51911bf272 | ||
|
|
6dc8061401 | ||
|
|
b8fa4f8797 | ||
|
|
cc0bea7f45 | ||
|
|
4e9124b244 | ||
|
|
f0eabef7b0 | ||
|
|
23e5557958 | ||
|
|
b1d02afa85 | ||
|
|
2edc380f47 | ||
|
|
cea8295c09 | ||
|
|
244bfc993a | ||
|
|
3a272a4493 | ||
|
|
a3300db770 | ||
|
|
b0394ce261 | ||
|
|
3123089790 | ||
|
|
f13cf66676 | ||
|
|
0c8c4d87fb | ||
|
|
066088fdeb | ||
|
|
cf641e41c7 | ||
|
|
5b48322e1b | ||
|
|
9d3f680d58 | ||
|
|
bed28d57e6 | ||
|
|
2538525103 | ||
|
|
6ed798db8c | ||
|
|
8e9d966829 | ||
|
|
be16640f92 | ||
|
|
0e1376dd2e | ||
|
|
0494575aa7 | ||
|
|
bed57534e0 | ||
|
|
1862d631d1 | ||
|
|
c977ce5690 | ||
|
|
84df377516 | ||
|
|
4d9a284f6e | ||
|
|
da7ad8b44a | ||
|
|
4164046323 | ||
|
|
72e743dfd1 | ||
|
|
7eb7edaf0a | ||
|
|
49368aaf76 | ||
|
|
b8c07a966f | ||
|
|
c6bcc0e3aa | ||
|
|
7719339f23 | ||
|
|
8ad64722ed | ||
|
|
611f8b8865 | ||
|
|
38bdc173e8 | ||
|
|
52244325d9 | ||
|
|
3fd3d99b8c | ||
|
|
d4ee5e91a2 | ||
|
|
c2ad2d7238 | ||
|
|
892e195f0e | ||
|
|
c5b1bed7dc | ||
|
|
0e388d7aa7 | ||
|
|
c3a0dbbe48 | ||
|
|
8b95b3ffc7 | ||
|
|
42b78461cd | ||
|
|
9190a41ca5 | ||
|
|
28a7251319 | ||
|
|
20565866ef | ||
|
|
246f10aee5 | ||
|
|
960017280d | ||
|
|
7218aaf52e | ||
|
|
62050cc7b6 | ||
|
|
f88a14ac0a | ||
|
|
9286761c30 | ||
|
|
07c3273247 | ||
|
|
eb8fe77582 | ||
|
|
b68ba0bff6 | ||
|
|
696657c09e | ||
|
|
12bea9b60a | ||
|
|
9334e9552f | ||
|
|
a43b04a98b | ||
|
|
f359ff995d | ||
|
|
9185d2646b | ||
|
|
33e61c762c | ||
|
|
e342e646ff | ||
|
|
ed163a80e0 | ||
|
|
b390df08b5 | ||
|
|
f0b3b9f7f4 | ||
|
|
a67d732507 | ||
|
|
ca0ebe0d75 | ||
|
|
94d113cbe0 | ||
|
|
25c3aeaa5f | ||
|
|
736d5a00b7 | ||
|
|
f1627b214c | ||
|
|
d9265ec7ea | ||
|
|
663e871bed | ||
|
|
5c5eaddef7 | ||
|
|
edaec4f1ae | ||
|
|
6d19acaa6c | ||
|
|
d29a619fbf | ||
|
|
b17808dd91 | ||
|
|
c5321a3667 | ||
|
|
8836691510 | ||
|
|
6568f6525d | ||
|
|
473fc27b49 | ||
|
|
74aeb55acb | ||
|
|
8efcf0529f | ||
|
|
06071c2f9c | ||
|
|
5eb4eca487 | ||
|
|
33f6153e12 | ||
|
|
df3283f526 | ||
|
|
b5901a2819 | ||
|
|
6d5f1402fe | ||
|
|
65e3782b2e | ||
|
|
135981dd30 | ||
|
|
fe5cf2d922 | ||
|
|
e15425cc2e | ||
|
|
c3cb0a4e33 | ||
|
|
cc32976bdd | ||
|
|
bc08318716 | ||
|
|
ee1ab30c2c | ||
|
|
7fa1a66f7e | ||
|
|
946bf37406 | ||
|
|
8706f6931a | ||
|
|
f551674860 | ||
|
|
d90fe0ef07 | ||
|
|
bf979fa3b3 | ||
|
|
b3b88891e9 | ||
|
|
01c5de60dc | ||
|
|
47b8fe5022 | ||
|
|
324b37b875 | ||
|
|
76e7e192d8 | ||
|
|
f9f3c4d923 | ||
|
|
a476476bd1 | ||
|
|
82a60a884a | ||
|
|
f17727de18 | ||
|
|
f1f33c79f4 | ||
|
|
d52eaafdbb | ||
|
|
e7a3e50ed1 | ||
|
|
2e09a87baa | ||
|
|
b92ae7e47e | ||
|
|
f98446e139 | ||
|
|
57a48dadaa | ||
|
|
c65ec68e46 | ||
|
|
d6559be3fc | ||
|
|
6fbf67f9a9 | ||
|
|
59df5b24fe | ||
|
|
3e1544294b | ||
|
|
a12c398816 | ||
|
|
0bd3e28348 | ||
|
|
ad4e39c088 | ||
|
|
2668d96e6a | ||
|
|
357c496aad | ||
|
|
22a513ba22 | ||
|
|
e6dd1119be | ||
|
|
2dbe454e04 | ||
|
|
e3a59b76eb | ||
|
|
01008acfcd | ||
|
|
b67a162d3f | ||
|
|
8bfde9fbaf | ||
|
|
1fdecf8def | ||
|
|
1141d4b833 | ||
|
|
cdac92ca7b | ||
|
|
2a57c260cc | ||
|
|
f41e29ab3a | ||
|
|
8f10624073 | ||
|
|
eb1f8be11e | ||
|
|
3333501ab9 | ||
|
|
0f40820315 | ||
|
|
5f1a839620 | ||
|
|
b9bb1c775d | ||
|
|
1059b7376b | ||
|
|
f38ab4a9ce | ||
|
|
9e7450c012 | ||
|
|
99a3e360fe | ||
|
|
d45f8f78d6 | ||
|
|
648af61116 | ||
|
|
eebf1b89b1 | ||
|
|
f8094bb624 | ||
|
|
ed13e0d2c2 | ||
|
|
aa830589b4 | ||
|
|
999a2bd929 | ||
|
|
d69ee98450 | ||
|
|
f6712c24ad | ||
|
|
89d2772194 | ||
|
|
03352142b6 | ||
|
|
73a51e0c00 | ||
|
|
2e26f8caa6 | ||
|
|
f9bcce9e43 | ||
|
|
2ecc877ba8 | ||
|
|
3f8a3c69e3 | ||
|
|
67c37a0984 | ||
|
|
a58a55d00d | ||
|
|
06d51dd0b8 | ||
|
|
d5db028f57 | ||
|
|
fcb85ff4be | ||
|
|
3695b4363d | ||
|
|
cb11e6437c | ||
|
|
5127bd11ce | ||
|
|
91f90aefa1 | ||
|
|
0a067bce36 | ||
|
|
f0aba433bf | ||
|
|
f06467a0e3 | ||
|
|
68bcd3c710 | ||
|
|
a645733cc5 | ||
|
|
49fe5baf94 | ||
|
|
411ee55653 | ||
|
|
e351ce7411 | ||
|
|
f33e585a71 | ||
|
|
77f3096e0d | ||
|
|
9a5b18c4e6 | ||
|
|
0c7112869a | ||
|
|
f66a4d71ea | ||
|
|
9b0ab878df | ||
|
|
d30b90dfd0 | ||
|
|
efd28f8c27 | ||
|
|
e05e722387 | ||
|
|
748e81956d | ||
|
|
c9a41febce | ||
|
|
18e244b756 | ||
|
|
47676139a3 | ||
|
|
1ed933b7ad | ||
|
|
f6a343ccd6 | ||
|
|
dd6cdc22e5 | ||
|
|
f70f4348b3 | ||
|
|
ec7f801929 | ||
|
|
0f8aca382e | ||
|
|
0270f77eaa | ||
|
|
dcba71ada4 | ||
|
|
6080f76a9c | ||
|
|
e7349161f3 | ||
|
|
2e2907ea09 | ||
|
|
25e84b2a6c | ||
|
|
5efd424172 | ||
|
|
9aefc55534 |
27
README.md
27
README.md
@@ -1,20 +1,21 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
阅读本README文档,您可以了解到滴滴Logi-KafkaManager的用户群体、产品定位等信息,并通过体验地址,快速体验Kafka集群指标监控与运维管控的全流程。<br>若滴滴Logi-KafkaManager已在贵司的生产环境进行使用,并想要获得官方更好地支持和指导,可以通过[`OCE认证`](http://obsuite.didiyun.com/open/openAuth),加入官方交流平台。
|
阅读本README文档,您可以了解到滴滴Logi-KafkaManager的用户群体、产品定位等信息,并通过体验地址,快速体验Kafka集群指标监控与运维管控的全流程。
|
||||||
|
|
||||||
|
|
||||||
## 1 产品简介
|
## 1 产品简介
|
||||||
滴滴Logi-KafkaManager脱胎于滴滴内部多年的Kafka运营实践经验,是面向Kafka用户、Kafka运维人员打造的共享多租户Kafka云平台。专注于Kafka运维管控、监控告警、资源治理等核心场景,经历过大规模集群、海量大数据的考验。内部满意度高达90%的同时,还与多家知名企业达成商业化合作。
|
滴滴Logi-KafkaManager脱胎于滴滴内部多年的Kafka运营实践经验,是面向Kafka用户、Kafka运维人员打造的共享多租户Kafka云平台。专注于Kafka运维管控、监控告警、资源治理等核心场景,经历过大规模集群、海量大数据的考验。内部满意度高达90%的同时,还与多家知名企业达成商业化合作。
|
||||||
|
|
||||||
### 1.1 快速体验地址
|
### 1.1 快速体验地址
|
||||||
- 体验地址 http://117.51.146.109:8080 账号密码 admin/admin
|
|
||||||
|
- 体验地址 http://117.51.150.133:8080 账号密码 admin/admin
|
||||||
|
|
||||||
### 1.2 体验地图
|
### 1.2 体验地图
|
||||||
相比较于同类产品的用户视角单一(大多为管理员视角),滴滴Logi-KafkaManager建立了基于分角色、多场景视角的体验地图。分别是:**用户体验地图、运维体验地图、运营体验地图**
|
相比较于同类产品的用户视角单一(大多为管理员视角),滴滴Logi-KafkaManager建立了基于分角色、多场景视角的体验地图。分别是:**用户体验地图、运维体验地图、运营体验地图**
|
||||||
@@ -66,15 +67,23 @@
|
|||||||
- [滴滴Logi-KafkaManager 开源之路](https://xie.infoq.cn/article/0223091a99e697412073c0d64)
|
- [滴滴Logi-KafkaManager 开源之路](https://xie.infoq.cn/article/0223091a99e697412073c0d64)
|
||||||
- [滴滴Logi-KafkaManager 系列视频教程](https://mp.weixin.qq.com/s/9X7gH0tptHPtfjPPSdGO8g)
|
- [滴滴Logi-KafkaManager 系列视频教程](https://mp.weixin.qq.com/s/9X7gH0tptHPtfjPPSdGO8g)
|
||||||
- [kafka实践(十五):滴滴开源Kafka管控平台 Logi-KafkaManager研究--A叶子叶来](https://blog.csdn.net/yezonggang/article/details/113106244)
|
- [kafka实践(十五):滴滴开源Kafka管控平台 Logi-KafkaManager研究--A叶子叶来](https://blog.csdn.net/yezonggang/article/details/113106244)
|
||||||
|
- [kafka的灵魂伴侣Logi-KafkaManager系列文章专栏 --石臻](https://blog.csdn.net/u010634066/category_10977588.html)
|
||||||
|
|
||||||
## 3 滴滴Logi开源用户钉钉交流群
|
## 3 滴滴Logi开源用户交流群
|
||||||
|
|
||||||

|
|
||||||
钉钉群ID:32821440
|
|
||||||
|
|
||||||
## 4 OCE认证
|

|
||||||
OCE是一个认证机制和交流平台,为滴滴Logi-KafkaManager生产用户量身打造,我们会为OCE企业提供更好的技术支持,比如专属的技术沙龙、企业一对一的交流机会、专属的答疑群等,如果贵司Logi-KafkaManager上了生产,[快来加入吧](http://obsuite.didiyun.com/open/openAuth)
|
微信加群:添加mike_zhangliang的微信号备注Logi加群或关注公众号 云原生可观测性 回复 "Logi加群"
|
||||||
|
|
||||||
|
## 4 知识星球
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
✅知识星球首个【Kafka中文社区】,内测期免费加入~https://z.didi.cn/5gSF9
|
||||||
|
有问必答~!
|
||||||
|
互动有礼~!
|
||||||
|
1600+群友一起共建国内最专业的【Kafka中文社区】
|
||||||
|
PS:提问请尽量把问题一次性描述清楚,并告知环境信息情况哦~!如使用版本、操作步骤、报错/警告信息等,方便嘉宾们快速解答~
|
||||||
|
|
||||||
## 5 项目成员
|
## 5 项目成员
|
||||||
|
|
||||||
@@ -90,4 +99,4 @@ OCE是一个认证机制和交流平台,为滴滴Logi-KafkaManager生产用户
|
|||||||
|
|
||||||
## 6 协议
|
## 6 协议
|
||||||
|
|
||||||
`kafka-manager`基于`Apache-2.0`协议进行分发和使用,更多信息参见[协议文件](./LICENSE)
|
`LogiKM`基于`Apache-2.0`协议进行分发和使用,更多信息参见[协议文件](./LICENSE)
|
||||||
|
|||||||
141
Releases_Notes.md
Normal file
141
Releases_Notes.md
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## v2.4.1+
|
||||||
|
|
||||||
|
版本上线时间:2021-05-21
|
||||||
|
|
||||||
|
### 能力提升
|
||||||
|
- 增加直接增加权限和配额的接口(v2.4.1)
|
||||||
|
- 增加接口调用可绕过登录的功能(v2.4.1)
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
- tomcat 版本提升至8.5.66(v2.4.2)
|
||||||
|
- op接口优化,拆分util接口为topic、leader两类接口(v2.4.1)
|
||||||
|
- 简化Gateway配置的Key长度(v2.4.1)
|
||||||
|
|
||||||
|
### bug修复
|
||||||
|
- 修复页面展示版本错误问题(v2.4.2)
|
||||||
|
|
||||||
|
|
||||||
|
## v2.4.0
|
||||||
|
|
||||||
|
版本上线时间:2021-05-18
|
||||||
|
|
||||||
|
|
||||||
|
### 能力提升
|
||||||
|
|
||||||
|
- 增加App与Topic自动化审批开关
|
||||||
|
- Broker元信息中增加Rack信息
|
||||||
|
- 升级MySQL 驱动,支持MySQL 8+
|
||||||
|
- 增加操作记录查询界面
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
|
||||||
|
- FAQ告警组说明优化
|
||||||
|
- 用户手册共享及 独享集群概念优化
|
||||||
|
- 用户管理界面,前端限制用户删除自己
|
||||||
|
|
||||||
|
### bug修复
|
||||||
|
|
||||||
|
- 修复op-util类中创建Topic失败的接口
|
||||||
|
- 周期同步Topic到DB的任务修复,将Topic列表查询从缓存调整为直接查DB
|
||||||
|
- 应用下线审批失败的功能修复,将权限为0(无权限)的数据进行过滤
|
||||||
|
- 修复登录及权限绕过的漏洞
|
||||||
|
- 修复研发角色展示接入集群、暂停监控等按钮的问题
|
||||||
|
|
||||||
|
|
||||||
|
## v2.3.0
|
||||||
|
|
||||||
|
版本上线时间:2021-02-08
|
||||||
|
|
||||||
|
|
||||||
|
### 能力提升
|
||||||
|
|
||||||
|
- 新增支持docker化部署
|
||||||
|
- 可指定Broker作为候选controller
|
||||||
|
- 可新增并管理网关配置
|
||||||
|
- 可获取消费组状态
|
||||||
|
- 增加集群的JMX认证
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
|
||||||
|
- 优化编辑用户角色、修改密码的流程
|
||||||
|
- 新增consumerID的搜索功能
|
||||||
|
- 优化“Topic连接信息”、“消费组重置消费偏移”、“修改Topic保存时间”的文案提示
|
||||||
|
- 在相应位置增加《资源申请文档》链接
|
||||||
|
|
||||||
|
### bug修复
|
||||||
|
|
||||||
|
- 修复Broker监控图表时间轴展示错误的问题
|
||||||
|
- 修复创建夜莺监控告警规则时,使用的告警周期的单位不正确的问题
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## v2.2.0
|
||||||
|
|
||||||
|
版本上线时间:2021-01-25
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 能力提升
|
||||||
|
|
||||||
|
- 优化工单批量操作流程
|
||||||
|
- 增加获取Topic75分位/99分位的实时耗时数据
|
||||||
|
- 增加定时任务,可将无主未落DB的Topic定期写入DB
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
|
||||||
|
- 在相应位置增加《集群接入文档》链接
|
||||||
|
- 优化物理集群、逻辑集群含义
|
||||||
|
- 在Topic详情页、Topic扩分区操作弹窗增加展示Topic所属Region的信息
|
||||||
|
- 优化Topic审批时,Topic数据保存时间的配置流程
|
||||||
|
- 优化Topic/应用申请、审批时的错误提示文案
|
||||||
|
- 优化Topic数据采样的操作项文案
|
||||||
|
- 优化运维人员删除Topic时的提示文案
|
||||||
|
- 优化运维人员删除Region的删除逻辑与提示文案
|
||||||
|
- 优化运维人员删除逻辑集群的提示文案
|
||||||
|
- 优化上传集群配置文件时的文件类型限制条件
|
||||||
|
|
||||||
|
### bug修复
|
||||||
|
|
||||||
|
- 修复填写应用名称时校验特殊字符出错的问题
|
||||||
|
- 修复普通用户越权访问应用详情的问题
|
||||||
|
- 修复由于Kafka版本升级,导致的数据压缩格式无法获取的问题
|
||||||
|
- 修复删除逻辑集群或Topic之后,界面依旧展示的问题
|
||||||
|
- 修复进行Leader rebalance操作时执行结果重复提示的问题
|
||||||
|
|
||||||
|
|
||||||
|
## v2.1.0
|
||||||
|
|
||||||
|
版本上线时间:2020-12-19
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 体验优化
|
||||||
|
|
||||||
|
- 优化页面加载时的背景样式
|
||||||
|
- 优化普通用户申请Topic权限的流程
|
||||||
|
- 优化Topic申请配额、申请分区的权限限制
|
||||||
|
- 优化取消Topic权限的文案提示
|
||||||
|
- 优化申请配额表单的表单项名称
|
||||||
|
- 优化重置消费偏移的操作流程
|
||||||
|
- 优化创建Topic迁移任务的表单内容
|
||||||
|
- 优化Topic扩分区操作的弹窗界面样式
|
||||||
|
- 优化集群Broker监控可视化图表样式
|
||||||
|
- 优化创建逻辑集群的表单内容
|
||||||
|
- 优化集群安全协议的提示文案
|
||||||
|
|
||||||
|
### bug修复
|
||||||
|
|
||||||
|
- 修复偶发性重置消费偏移失败的问题
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
72
build.sh
72
build.sh
@@ -1,72 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
workspace=$(cd $(dirname $0) && pwd -P)
|
|
||||||
cd $workspace
|
|
||||||
|
|
||||||
## constant
|
|
||||||
OUTPUT_DIR=./output
|
|
||||||
KM_VERSION=2.2.0
|
|
||||||
APP_NAME=kafka-manager
|
|
||||||
APP_DIR=${APP_NAME}-${KM_VERSION}
|
|
||||||
|
|
||||||
MYSQL_TABLE_SQL_FILE=./docs/install_guide/create_mysql_table.sql
|
|
||||||
CONFIG_FILE=./kafka-manager-web/src/main/resources/application.yml
|
|
||||||
|
|
||||||
## function
|
|
||||||
function build() {
|
|
||||||
# 编译命令
|
|
||||||
mvn -U clean package -Dmaven.test.skip=true
|
|
||||||
|
|
||||||
local sc=$?
|
|
||||||
if [ $sc -ne 0 ];then
|
|
||||||
## 编译失败, 退出码为 非0
|
|
||||||
echo "$APP_NAME build error"
|
|
||||||
exit $sc
|
|
||||||
else
|
|
||||||
echo "$APP_NAME build ok"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_output() {
|
|
||||||
# 新建output目录
|
|
||||||
rm -rf ${OUTPUT_DIR} &>/dev/null
|
|
||||||
mkdir -p ${OUTPUT_DIR}/${APP_DIR} &>/dev/null
|
|
||||||
|
|
||||||
# 填充output目录, output内的内容
|
|
||||||
(
|
|
||||||
cp -rf ${MYSQL_TABLE_SQL_FILE} ${OUTPUT_DIR}/${APP_DIR} && # 拷贝 sql 初始化脚本 至output目录
|
|
||||||
cp -rf ${CONFIG_FILE} ${OUTPUT_DIR}/${APP_DIR} && # 拷贝 application.yml 至output目录
|
|
||||||
|
|
||||||
# 拷贝程序包到output路径
|
|
||||||
cp kafka-manager-web/target/kafka-manager-web-${KM_VERSION}-SNAPSHOT.jar ${OUTPUT_DIR}/${APP_DIR}/${APP_NAME}.jar
|
|
||||||
echo -e "make output ok."
|
|
||||||
) || { echo -e "make output error"; exit 2; } # 填充output目录失败后, 退出码为 非0
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_package() {
|
|
||||||
# 压缩output目录
|
|
||||||
(
|
|
||||||
cd ${OUTPUT_DIR} && tar cvzf ${APP_DIR}.tar.gz ${APP_DIR}
|
|
||||||
echo -e "make package ok."
|
|
||||||
) || { echo -e "make package error"; exit 2; } # 压缩output目录失败后, 退出码为 非0
|
|
||||||
}
|
|
||||||
|
|
||||||
##########################################
|
|
||||||
## main
|
|
||||||
## 其中,
|
|
||||||
## 1.进行编译
|
|
||||||
## 2.生成部署包output
|
|
||||||
## 3.生成tar.gz压缩包
|
|
||||||
##########################################
|
|
||||||
|
|
||||||
# 1.进行编译
|
|
||||||
build
|
|
||||||
|
|
||||||
# 2.生成部署包output
|
|
||||||
make_output
|
|
||||||
|
|
||||||
# 3.生成tar.gz压缩包
|
|
||||||
make_package
|
|
||||||
|
|
||||||
# 编译成功
|
|
||||||
echo -e "build done"
|
|
||||||
exit 0
|
|
||||||
@@ -1,44 +1,28 @@
|
|||||||
FROM openjdk:8-jdk-alpine3.9
|
FROM openjdk:16-jdk-alpine3.13
|
||||||
|
|
||||||
LABEL author="yangvipguang"
|
LABEL author="fengxsong"
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache tini
|
||||||
|
|
||||||
ENV VERSION 2.1.0
|
ENV VERSION 2.4.2
|
||||||
ENV JAR_PATH kafka-manager-web/target
|
WORKDIR /opt/
|
||||||
COPY $JAR_PATH/kafka-manager-web-$VERSION-SNAPSHOT.jar /tmp/app.jar
|
|
||||||
COPY $JAR_PATH/application.yml /km/
|
|
||||||
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
|
||||||
RUN apk add --no-cache --virtual .build-deps \
|
|
||||||
font-adobe-100dpi \
|
|
||||||
ttf-dejavu \
|
|
||||||
fontconfig \
|
|
||||||
curl \
|
|
||||||
apr \
|
|
||||||
apr-util \
|
|
||||||
apr-dev \
|
|
||||||
tomcat-native \
|
|
||||||
&& apk del .build-deps
|
|
||||||
|
|
||||||
ENV AGENT_HOME /opt/agent/
|
ENV AGENT_HOME /opt/agent/
|
||||||
|
|
||||||
WORKDIR /tmp
|
|
||||||
COPY docker-depends/config.yaml $AGENT_HOME
|
COPY docker-depends/config.yaml $AGENT_HOME
|
||||||
COPY docker-depends/jmx_prometheus_javaagent-0.14.0.jar $AGENT_HOME
|
COPY docker-depends/jmx_prometheus_javaagent-0.15.0.jar $AGENT_HOME
|
||||||
|
|
||||||
ENV JAVA_AGENT="-javaagent:$AGENT_HOME/jmx_prometheus_javaagent-0.14.0.jar=9999:$AGENT_HOME/config.yaml"
|
|
||||||
|
|
||||||
|
ENV JAVA_AGENT="-javaagent:$AGENT_HOME/jmx_prometheus_javaagent-0.15.0.jar=9999:$AGENT_HOME/config.yaml"
|
||||||
ENV JAVA_HEAP_OPTS="-Xms1024M -Xmx1024M -Xmn100M "
|
ENV JAVA_HEAP_OPTS="-Xms1024M -Xmx1024M -Xmn100M "
|
||||||
|
|
||||||
ENV JAVA_OPTS="-verbose:gc \
|
ENV JAVA_OPTS="-verbose:gc \
|
||||||
-XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintHeapAtGC -Xloggc:/tmp/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps \
|
-XX:MaxMetaspaceSize=256M -XX:+DisableExplicitGC -XX:+UseStringDeduplication \
|
||||||
-XX:MaxMetaspaceSize=256M -XX:+DisableExplicitGC -XX:+UseStringDeduplication \
|
-XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:-UseContainerSupport"
|
||||||
-XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:-UseContainerSupport"
|
|
||||||
#-Xlog:gc -Xlog:gc* -Xlog:gc+heap=trace -Xlog:safepoint
|
RUN wget https://github.com/didi/Logi-KafkaManager/releases/download/v${VERSION}/kafka-manager-${VERSION}.tar.gz && \
|
||||||
|
tar xvf kafka-manager-${VERSION}.tar.gz && \
|
||||||
|
mv kafka-manager-${VERSION}/kafka-manager.jar /opt/app.jar && \
|
||||||
|
rm -rf kafka-manager-${VERSION}*
|
||||||
|
|
||||||
EXPOSE 8080 9999
|
EXPOSE 8080 9999
|
||||||
|
|
||||||
ENTRYPOINT ["sh","-c","java -jar $JAVA_HEAP_OPTS $JAVA_OPTS /tmp/app.jar --spring.config.location=/km/application.yml"]
|
ENTRYPOINT ["tini", "--"]
|
||||||
|
|
||||||
## 默认不带Prometheus JMX监控,需要可以自行取消以下注释并注释上面一行默认Entrypoint 命令。
|
|
||||||
## ENTRYPOINT ["sh","-c","java -jar $JAVA_AGENT $JAVA_HEAP_OPTS $JAVA_OPTS /tmp/app.jar --spring.config.location=/km/application.yml"]
|
|
||||||
|
|
||||||
|
CMD [ "sh", "-c", "java -jar $JAVA_AGENT $JAVA_HEAP_OPTS $JAVA_OPTS app.jar --spring.config.location=application.yml"]
|
||||||
Binary file not shown.
Binary file not shown.
6
container/helm/Chart.lock
Normal file
6
container/helm/Chart.lock
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: mysql
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
version: 8.6.3
|
||||||
|
digest: sha256:d250c463c1d78ba30a24a338a06a551503c7a736621d974fe4999d2db7f6143e
|
||||||
|
generated: "2021-06-24T11:34:54.625217+08:00"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: didi-km
|
name: didi-km
|
||||||
description: A Helm chart for Kubernetes
|
description: Logi-KafkaManager
|
||||||
|
|
||||||
# A chart can be either an 'application' or a 'library' chart.
|
# A chart can be either an 'application' or a 'library' chart.
|
||||||
#
|
#
|
||||||
@@ -21,4 +21,9 @@ version: 0.1.0
|
|||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "1.16.0"
|
appVersion: "2.4.2"
|
||||||
|
dependencies:
|
||||||
|
- condition: mysql.enabled
|
||||||
|
name: mysql
|
||||||
|
repository: https://charts.bitnami.com/bitnami
|
||||||
|
version: 8.x.x
|
||||||
|
|||||||
BIN
container/helm/charts/mysql-8.6.3.tgz
Normal file
BIN
container/helm/charts/mysql-8.6.3.tgz
Normal file
Binary file not shown.
@@ -1,7 +1,17 @@
|
|||||||
|
{{- define "datasource.mysql" -}}
|
||||||
|
{{- if .Values.mysql.enabled }}
|
||||||
|
{{- printf "%s-mysql" (include "didi-km.fullname" .) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s" .Values.externalDatabase.host -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: km-cm
|
name: {{ include "didi-km.fullname" . }}-configs
|
||||||
|
labels:
|
||||||
|
{{- include "didi-km.labels" . | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
application.yml: |
|
application.yml: |
|
||||||
server:
|
server:
|
||||||
@@ -17,9 +27,9 @@ data:
|
|||||||
name: kafkamanager
|
name: kafkamanager
|
||||||
datasource:
|
datasource:
|
||||||
kafka-manager:
|
kafka-manager:
|
||||||
jdbc-url: jdbc:mysql://xxxxx:3306/kafka-manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
|
jdbc-url: jdbc:mysql://{{ include "datasource.mysql" . }}:3306/{{ .Values.mysql.auth.database }}?characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
|
||||||
username: admin
|
username: {{ .Values.mysql.auth.username }}
|
||||||
password: admin
|
password: {{ .Values.mysql.auth.password }}
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
@@ -54,7 +64,10 @@ data:
|
|||||||
sync-topic-enabled: false # 未落盘的Topic定期同步到DB中
|
sync-topic-enabled: false # 未落盘的Topic定期同步到DB中
|
||||||
|
|
||||||
account:
|
account:
|
||||||
|
# ldap settings
|
||||||
ldap:
|
ldap:
|
||||||
|
enabled: false
|
||||||
|
authUserRegistration: false
|
||||||
|
|
||||||
kcm:
|
kcm:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: configs
|
||||||
|
mountPath: /tmp/application.yml
|
||||||
|
subPath: application.yml
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
@@ -54,3 +58,7 @@ spec:
|
|||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
volumes:
|
||||||
|
- name: configs
|
||||||
|
configMap:
|
||||||
|
name: {{ include "didi-km.fullname" . }}-configs
|
||||||
|
|||||||
@@ -5,13 +5,14 @@
|
|||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: docker.io/yangvipguang/km
|
repository: docker.io/fengxsong/logi-kafka-manager
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
# Overrides the image tag whose default is the chart appVersion.
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
tag: "v18"
|
tag: "v2.4.2"
|
||||||
|
|
||||||
imagePullSecrets: []
|
imagePullSecrets: []
|
||||||
nameOverride: ""
|
nameOverride: ""
|
||||||
|
# fullnameOverride must set same as release name
|
||||||
fullnameOverride: "km"
|
fullnameOverride: "km"
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
@@ -59,10 +60,10 @@ resources:
|
|||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
limits:
|
limits:
|
||||||
cpu: 50m
|
cpu: 500m
|
||||||
memory: 2048Mi
|
memory: 2048Mi
|
||||||
requests:
|
requests:
|
||||||
cpu: 10m
|
cpu: 100m
|
||||||
memory: 200Mi
|
memory: 200Mi
|
||||||
|
|
||||||
autoscaling:
|
autoscaling:
|
||||||
@@ -77,3 +78,16 @@ nodeSelector: {}
|
|||||||
tolerations: []
|
tolerations: []
|
||||||
|
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
|
# more configurations are set with configmap in file template/configmap.yaml
|
||||||
|
externalDatabase:
|
||||||
|
host: ""
|
||||||
|
mysql:
|
||||||
|
# if enabled is set to false, then you should manually specified externalDatabase.host
|
||||||
|
enabled: true
|
||||||
|
architecture: standalone
|
||||||
|
auth:
|
||||||
|
rootPassword: "s3cretR00t"
|
||||||
|
database: "logi_kafka_manager"
|
||||||
|
username: "logi_kafka_manager"
|
||||||
|
password: "n0tp@55w0rd"
|
||||||
|
|||||||
16
distribution/bin/shutdown.sh
Normal file
16
distribution/bin/shutdown.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd `dirname $0`/../target
|
||||||
|
target_dir=`pwd`
|
||||||
|
|
||||||
|
pid=`ps ax | grep -i 'kafka-manager' | grep ${target_dir} | grep java | grep -v grep | awk '{print $1}'`
|
||||||
|
if [ -z "$pid" ] ; then
|
||||||
|
echo "No kafka-manager running."
|
||||||
|
exit -1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "The kafka-manager (${pid}) is running..."
|
||||||
|
|
||||||
|
kill ${pid}
|
||||||
|
|
||||||
|
echo "Send shutdown request to kafka-manager (${pid}) OK"
|
||||||
81
distribution/bin/startup.sh
Normal file
81
distribution/bin/startup.sh
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
error_exit ()
|
||||||
|
{
|
||||||
|
echo "ERROR: $1 !!"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=$HOME/jdk/java
|
||||||
|
[ ! -e "$JAVA_HOME/bin/java" ] && JAVA_HOME=/usr/java
|
||||||
|
[ ! -e "$JAVA_HOME/bin/java" ] && unset JAVA_HOME
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if $darwin; then
|
||||||
|
|
||||||
|
if [ -x '/usr/libexec/java_home' ] ; then
|
||||||
|
export JAVA_HOME=`/usr/libexec/java_home`
|
||||||
|
|
||||||
|
elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
|
||||||
|
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVA_PATH=`dirname $(readlink -f $(which javac))`
|
||||||
|
if [ "x$JAVA_PATH" != "x" ]; then
|
||||||
|
export JAVA_HOME=`dirname $JAVA_PATH 2>/dev/null`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better!"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export WEB_SERVER="kafka-manager"
|
||||||
|
export JAVA_HOME
|
||||||
|
export JAVA="$JAVA_HOME/bin/java"
|
||||||
|
export BASE_DIR=`cd $(dirname $0)/..; pwd`
|
||||||
|
export CUSTOM_SEARCH_LOCATIONS=file:${BASE_DIR}/conf/
|
||||||
|
|
||||||
|
|
||||||
|
#===========================================================================================
|
||||||
|
# JVM Configuration
|
||||||
|
#===========================================================================================
|
||||||
|
|
||||||
|
JAVA_OPT="${JAVA_OPT} -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
|
||||||
|
JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/logs/java_heapdump.hprof"
|
||||||
|
|
||||||
|
## jdk版本高的情况 有些 参数废弃了
|
||||||
|
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p')
|
||||||
|
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
|
||||||
|
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/km_gc.log:time,tags:filecount=10,filesize=102400"
|
||||||
|
else
|
||||||
|
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext"
|
||||||
|
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/km_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/${WEB_SERVER}.jar"
|
||||||
|
JAVA_OPT="${JAVA_OPT} --spring.config.additional-location=${CUSTOM_SEARCH_LOCATIONS}"
|
||||||
|
JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/logback-spring.xml"
|
||||||
|
JAVA_OPT="${JAVA_OPT} --server.max-http-header-size=524288"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -d "${BASE_DIR}/logs" ]; then
|
||||||
|
mkdir ${BASE_DIR}/logs
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$JAVA ${JAVA_OPT}"
|
||||||
|
|
||||||
|
# check the start.out log output file
|
||||||
|
if [ ! -f "${BASE_DIR}/logs/start.out" ]; then
|
||||||
|
touch "${BASE_DIR}/logs/start.out"
|
||||||
|
fi
|
||||||
|
# start
|
||||||
|
echo -e "---- 启动脚本 ------\n $JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/start.out 2>&1 &
|
||||||
|
|
||||||
|
|
||||||
|
nohup $JAVA ${JAVA_OPT} >> ${BASE_DIR}/logs/start.out 2>&1 &
|
||||||
|
|
||||||
|
echo "${WEB_SERVER} is starting,you can check the ${BASE_DIR}/logs/start.out"
|
||||||
28
distribution/conf/application.yml
Normal file
28
distribution/conf/application.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
## kafka-manager的配置文件,该文件中的配置会覆盖默认配置
|
||||||
|
## 下面的配置信息基本就是jar中的 application.yml默认配置了;
|
||||||
|
## 可以只修改自己变更的配置,其他的删除就行了; 比如只配置一下mysql
|
||||||
|
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
tomcat:
|
||||||
|
accept-count: 1000
|
||||||
|
max-connections: 10000
|
||||||
|
max-threads: 800
|
||||||
|
min-spare-threads: 100
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: kafkamanager
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
datasource:
|
||||||
|
kafka-manager:
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/logi_kafka_manager?characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: 123456
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
116
distribution/conf/application.yml.example
Normal file
116
distribution/conf/application.yml.example
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
## kafka-manager的配置文件,该文件中的配置会覆盖默认配置
|
||||||
|
## 下面的配置信息基本就是jar中的 application.yml默认配置了;
|
||||||
|
## 可以只修改自己变更的配置,其他的删除就行了; 比如只配置一下mysql
|
||||||
|
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 8080
|
||||||
|
tomcat:
|
||||||
|
accept-count: 1000
|
||||||
|
max-connections: 10000
|
||||||
|
max-threads: 800
|
||||||
|
min-spare-threads: 100
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: kafkamanager
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
datasource:
|
||||||
|
kafka-manager:
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/logi_kafka_manager?characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: 123456
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
|
||||||
|
logging:
|
||||||
|
config: classpath:logback-spring.xml
|
||||||
|
|
||||||
|
custom:
|
||||||
|
idc: cn # 部署的数据中心, 忽略该配置, 后续会进行删除
|
||||||
|
jmx:
|
||||||
|
max-conn: 10 # 2.3版本配置不在这个地方生效
|
||||||
|
store-metrics-task:
|
||||||
|
community:
|
||||||
|
broker-metrics-enabled: true # 社区部分broker metrics信息收集开关, 关闭之后metrics信息将不会进行收集及写DB
|
||||||
|
topic-metrics-enabled: true # 社区部分topic的metrics信息收集开关, 关闭之后metrics信息将不会进行收集及写DB
|
||||||
|
didi:
|
||||||
|
app-topic-metrics-enabled: false # 滴滴埋入的指标, 社区AK不存在该指标,因此默认关闭
|
||||||
|
topic-request-time-metrics-enabled: false # 滴滴埋入的指标, 社区AK不存在该指标,因此默认关闭
|
||||||
|
topic-throttled-metrics: false # 滴滴埋入的指标, 社区AK不存在该指标,因此默认关闭
|
||||||
|
save-days: 7 #指标在DB中保持的天数,-1表示永久保存,7表示保存近7天的数据
|
||||||
|
|
||||||
|
# 任务相关的开关
|
||||||
|
task:
|
||||||
|
op:
|
||||||
|
sync-topic-enabled: false # 未落盘的Topic定期同步到DB中
|
||||||
|
order-auto-exec: # 工单自动化审批线程的开关
|
||||||
|
topic-enabled: false # Topic工单自动化审批开关, false:关闭自动化审批, true:开启
|
||||||
|
app-enabled: false # App工单自动化审批开关, false:关闭自动化审批, true:开启
|
||||||
|
|
||||||
|
# ldap相关的配置
|
||||||
|
account:
|
||||||
|
ldap:
|
||||||
|
enabled: false
|
||||||
|
url: ldap://127.0.0.1:389/
|
||||||
|
basedn: dc=tsign,dc=cn
|
||||||
|
factory: com.sun.jndi.ldap.LdapCtxFactory
|
||||||
|
filter: sAMAccountName
|
||||||
|
security:
|
||||||
|
authentication: simple
|
||||||
|
principal: cn=admin,dc=tsign,dc=cn
|
||||||
|
credentials: admin
|
||||||
|
auth-user-registration: true
|
||||||
|
auth-user-registration-role: normal
|
||||||
|
|
||||||
|
# 集群升级部署相关的功能,需要配合夜莺及S3进行使用
|
||||||
|
kcm:
|
||||||
|
enabled: false
|
||||||
|
s3:
|
||||||
|
endpoint: s3.didiyunapi.com
|
||||||
|
access-key: 1234567890
|
||||||
|
secret-key: 0987654321
|
||||||
|
bucket: logi-kafka
|
||||||
|
n9e:
|
||||||
|
base-url: http://127.0.0.1:8004
|
||||||
|
user-token: 12345678
|
||||||
|
timeout: 300
|
||||||
|
account: root
|
||||||
|
script-file: kcm_script.sh
|
||||||
|
|
||||||
|
# 监控告警相关的功能,需要配合夜莺进行使用
|
||||||
|
# enabled: 表示是否开启监控告警的功能, true: 开启, false: 不开启
|
||||||
|
# n9e.nid: 夜莺的节点ID
|
||||||
|
# n9e.user-token: 用户的密钥,在夜莺的个人设置中
|
||||||
|
# n9e.mon.base-url: 监控地址
|
||||||
|
# n9e.sink.base-url: 数据上报地址
|
||||||
|
# n9e.rdb.base-url: 用户资源中心地址
|
||||||
|
|
||||||
|
monitor:
|
||||||
|
enabled: false
|
||||||
|
n9e:
|
||||||
|
nid: 2
|
||||||
|
user-token: 1234567890
|
||||||
|
mon:
|
||||||
|
base-url: http://127.0.0.1:8000 # 夜莺v4版本,默认端口统一调整为了8000
|
||||||
|
sink:
|
||||||
|
base-url: http://127.0.0.1:8000 # 夜莺v4版本,默认端口统一调整为了8000
|
||||||
|
rdb:
|
||||||
|
base-url: http://127.0.0.1:8000 # 夜莺v4版本,默认端口统一调整为了8000
|
||||||
|
|
||||||
|
|
||||||
|
notify: # 通知的功能
|
||||||
|
kafka: # 默认通知发送到kafka的指定Topic中
|
||||||
|
cluster-id: 95 # Topic的集群ID
|
||||||
|
topic-name: didi-kafka-notify # Topic名称
|
||||||
|
order: # 部署的KM的地址
|
||||||
|
detail-url: http://127.0.0.1
|
||||||
@@ -203,17 +203,18 @@ CREATE TABLE `gateway_config` (
|
|||||||
`type` varchar(128) NOT NULL DEFAULT '' COMMENT '配置类型',
|
`type` varchar(128) NOT NULL DEFAULT '' COMMENT '配置类型',
|
||||||
`name` varchar(128) NOT NULL DEFAULT '' COMMENT '配置名称',
|
`name` varchar(128) NOT NULL DEFAULT '' COMMENT '配置名称',
|
||||||
`value` text COMMENT '配置值',
|
`value` text COMMENT '配置值',
|
||||||
`version` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '版本信息',
|
`version` bigint(20) unsigned NOT NULL DEFAULT '1' COMMENT '版本信息',
|
||||||
|
`description` text COMMENT '描述信息',
|
||||||
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
`modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
`modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `uniq_type_name` (`type`,`name`)
|
UNIQUE KEY `uniq_type_name` (`type`,`name`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='gateway配置';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='gateway配置';
|
||||||
INSERT INTO gateway_config(type, name, value, `version`) values('SERVICE_DISCOVERY_QUEUE_SIZE', 'SERVICE_DISCOVERY_QUEUE_SIZE', 100000000, 1);
|
INSERT INTO gateway_config(type, name, value, `version`, `description`) values('SD_QUEUE_SIZE', 'SD_QUEUE_SIZE', 100000000, 1, '任意集群队列大小');
|
||||||
INSERT INTO gateway_config(type, name, value, `version`) values('SERVICE_DISCOVERY_APPID_RATE', 'SERVICE_DISCOVERY_APPID_RATE', 100000000, 1);
|
INSERT INTO gateway_config(type, name, value, `version`, `description`) values('SD_APP_RATE', 'SD_APP_RATE', 100000000, 1, '任意一个App限速');
|
||||||
INSERT INTO gateway_config(type, name, value, `version`) values('SERVICE_DISCOVERY_IP_RATE', 'SERVICE_DISCOVERY_IP_RATE', 100000000, 1);
|
INSERT INTO gateway_config(type, name, value, `version`, `description`) values('SD_IP_RATE', 'SD_IP_RATE', 100000000, 1, '任意一个IP限速');
|
||||||
INSERT INTO gateway_config(type, name, value, `version`) values('SERVICE_DISCOVERY_SP_RATE', 'app_01234567', 100000000, 1);
|
INSERT INTO gateway_config(type, name, value, `version`, `description`) values('SD_SP_RATE', 'app_01234567', 100000000, 1, '指定App限速');
|
||||||
INSERT INTO gateway_config(type, name, value, `version`) values('SERVICE_DISCOVERY_SP_RATE', '192.168.0.1', 100000000, 1);
|
INSERT INTO gateway_config(type, name, value, `version`, `description`) values('SD_SP_RATE', '192.168.0.1', 100000000, 1, '指定IP限速');
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `heartbeat`
|
-- Table structure for table `heartbeat`
|
||||||
215
distribution/conf/logback-spring.xml
Normal file
215
distribution/conf/logback-spring.xml
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="10 seconds">
|
||||||
|
<contextName>logback</contextName>
|
||||||
|
<property name="log.path" value="./logs" />
|
||||||
|
|
||||||
|
<!-- 彩色日志 -->
|
||||||
|
<!-- 彩色日志依赖的渲染类 -->
|
||||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
|
||||||
|
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
|
||||||
|
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
|
||||||
|
<!-- 彩色日志格式 -->
|
||||||
|
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||||
|
|
||||||
|
<!--输出到控制台-->
|
||||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>info</level>
|
||||||
|
</filter>
|
||||||
|
<encoder>
|
||||||
|
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
|
<!--输出到文件-->
|
||||||
|
|
||||||
|
<!-- 时间滚动输出 level为 DEBUG 日志 -->
|
||||||
|
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/log_debug.log</file>
|
||||||
|
<!--日志文件输出格式-->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset> <!-- 设置字符集 -->
|
||||||
|
</encoder>
|
||||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志归档 -->
|
||||||
|
<fileNamePattern>${log.path}/log_debug_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>7</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<!-- 此日志文件只记录debug级别的 -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 时间滚动输出 level为 INFO 日志 -->
|
||||||
|
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||||
|
<file>${log.path}/log_info.log</file>
|
||||||
|
<!--日志文件输出格式-->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 每天日志归档路径以及格式 -->
|
||||||
|
<fileNamePattern>${log.path}/log_info_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>7</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<!-- 此日志文件只记录info级别的 -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>info</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 时间滚动输出 level为 WARN 日志 -->
|
||||||
|
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||||
|
<file>${log.path}/log_warn.log</file>
|
||||||
|
<!--日志文件输出格式-->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
|
||||||
|
</encoder>
|
||||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/log_warn_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>7</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<!-- 此日志文件只记录warn级别的 -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>warn</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 时间滚动输出 level为 ERROR 日志 -->
|
||||||
|
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<!-- 正在记录的日志文件的路径及文件名 -->
|
||||||
|
<file>${log.path}/log_error.log</file>
|
||||||
|
<!--日志文件输出格式-->
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
|
||||||
|
</encoder>
|
||||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/log_error_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>7</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<!-- 此日志文件只记录ERROR级别的 -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Metrics信息收集日志 -->
|
||||||
|
<appender name="COLLECTOR_METRICS_LOGGER" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/metrics/collector_metrics.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/metrics/collector_metrics_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>3</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Metrics信息收集日志 -->
|
||||||
|
<appender name="API_METRICS_LOGGER" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/metrics/api_metrics.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/metrics/api_metrics_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>3</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Metrics信息收集日志 -->
|
||||||
|
<appender name="SCHEDULED_TASK_LOGGER" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/metrics/scheduled_tasks.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>UTF-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/metrics/scheduled_tasks_%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>100MB</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>5</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="COLLECTOR_METRICS_LOGGER" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="COLLECTOR_METRICS_LOGGER"/>
|
||||||
|
</logger>
|
||||||
|
<logger name="API_METRICS_LOGGER" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="API_METRICS_LOGGER"/>
|
||||||
|
</logger>
|
||||||
|
<logger name="SCHEDULED_TASK_LOGGER" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="SCHEDULED_TASK_LOGGER"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="org.apache.ibatis" level="INFO" additivity="false" />
|
||||||
|
<logger name="org.mybatis.spring" level="INFO" additivity="false" />
|
||||||
|
<logger name="com.github.miemiedev.mybatis.paginator" level="INFO" additivity="false" />
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
<appender-ref ref="DEBUG_FILE" />
|
||||||
|
<appender-ref ref="INFO_FILE" />
|
||||||
|
<appender-ref ref="WARN_FILE" />
|
||||||
|
<appender-ref ref="ERROR_FILE" />
|
||||||
|
<!--<appender-ref ref="METRICS_LOG" />-->
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--生产环境:输出到文件-->
|
||||||
|
<!--<springProfile name="pro">-->
|
||||||
|
<!--<root level="info">-->
|
||||||
|
<!--<appender-ref ref="CONSOLE" />-->
|
||||||
|
<!--<appender-ref ref="DEBUG_FILE" />-->
|
||||||
|
<!--<appender-ref ref="INFO_FILE" />-->
|
||||||
|
<!--<appender-ref ref="ERROR_FILE" />-->
|
||||||
|
<!--<appender-ref ref="WARN_FILE" />-->
|
||||||
|
<!--</root>-->
|
||||||
|
<!--</springProfile>-->
|
||||||
|
</configuration>
|
||||||
64
distribution/pom.xml
Normal file
64
distribution/pom.xml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<artifactId>kafka-manager</artifactId>
|
||||||
|
<groupId>com.xiaojukeji.kafka</groupId>
|
||||||
|
<version>${kafka-manager.revision}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>distribution</artifactId>
|
||||||
|
<name>distribution</name>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>kafka-manager-web</artifactId>
|
||||||
|
<version>${kafka-manager.revision}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>release-kafka-manager</id>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>kafka-manager-web</artifactId>
|
||||||
|
<version>${kafka-manager.revision}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>release-km.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
<tarLongFileMode>posix</tarLongFileMode>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>make-assembly</id>
|
||||||
|
<phase>install</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<finalName>kafka-manager</finalName>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
</project>
|
||||||
22
distribution/readme.md
Normal file
22
distribution/readme.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
## 说明
|
||||||
|
|
||||||
|
### 1.创建mysql数据库文件
|
||||||
|
> conf/create_mysql_table.sql
|
||||||
|
|
||||||
|
### 2. 修改配置文件
|
||||||
|
> conf/application.yml.example
|
||||||
|
> 请将application.yml.example 复制一份改名为application.yml;
|
||||||
|
> 并放在同级目录下(conf/); 并修改成自己的配置
|
||||||
|
> 这里的优先级比jar包内配置文件的默认值高;
|
||||||
|
>
|
||||||
|
|
||||||
|
### 3.启动/关闭kafka-manager
|
||||||
|
> sh bin/startup.sh 启动
|
||||||
|
>
|
||||||
|
> sh shutdown.sh 关闭
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
### 4.升级jar包
|
||||||
|
> 如果是升级, 可以看看文件 `upgrade_config.md` 的配置变更历史;
|
||||||
|
>
|
||||||
51
distribution/release-km.xml
Executable file
51
distribution/release-km.xml
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<assembly>
|
||||||
|
<id>${project.version}</id>
|
||||||
|
<includeBaseDirectory>true</includeBaseDirectory>
|
||||||
|
<formats>
|
||||||
|
<format>dir</format>
|
||||||
|
<format>tar.gz</format>
|
||||||
|
<format>zip</format>
|
||||||
|
</formats>
|
||||||
|
<fileSets>
|
||||||
|
<fileSet>
|
||||||
|
<includes>
|
||||||
|
<include>conf/**</include>
|
||||||
|
</includes>
|
||||||
|
</fileSet>
|
||||||
|
|
||||||
|
<fileSet>
|
||||||
|
<includes>
|
||||||
|
<include>bin/*</include>
|
||||||
|
</includes>
|
||||||
|
<fileMode>0755</fileMode>
|
||||||
|
</fileSet>
|
||||||
|
</fileSets>
|
||||||
|
<files>
|
||||||
|
|
||||||
|
|
||||||
|
<file>
|
||||||
|
<source>readme.md</source>
|
||||||
|
<destName>readme.md</destName>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<source>upgrade_config.md</source>
|
||||||
|
<destName>upgrade_config.md</destName>
|
||||||
|
</file>
|
||||||
|
<file>
|
||||||
|
<!--打好的jar包名称和放置目录-->
|
||||||
|
<source>../kafka-manager-web/target/kafka-manager.jar</source>
|
||||||
|
<outputDirectory>target/</outputDirectory>
|
||||||
|
</file>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
<moduleSets>
|
||||||
|
<moduleSet>
|
||||||
|
<useAllReactorProjects>true</useAllReactorProjects>
|
||||||
|
<includes>
|
||||||
|
<include>com.xiaojukeji.kafka:kafka-manager-web</include>
|
||||||
|
</includes>
|
||||||
|
</moduleSet>
|
||||||
|
</moduleSets>
|
||||||
|
</assembly>
|
||||||
42
distribution/upgrade_config.md
Normal file
42
distribution/upgrade_config.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
## 版本升级配置变更
|
||||||
|
> 本文件 从 V2.2.0 开始记录; 如果配置有变更则会填写到下文中; 如果没有,则表示无变更;
|
||||||
|
> 当您从一个很低的版本升级时候,应该依次执行中间有过变更的sql脚本
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 1.升级至`V2.2.0`版本
|
||||||
|
|
||||||
|
#### 1.mysql变更
|
||||||
|
|
||||||
|
`2.2.0`版本在`cluster`表及`logical_cluster`各增加了一个字段,因此需要执行下面的sql进行字段的增加。
|
||||||
|
|
||||||
|
```sql
|
||||||
|
# 往cluster表中增加jmx_properties字段, 这个字段会用于存储jmx相关的认证以及配置信息
|
||||||
|
ALTER TABLE `cluster` ADD COLUMN `jmx_properties` TEXT NULL COMMENT 'JMX配置' AFTER `security_properties`;
|
||||||
|
|
||||||
|
# 往logical_cluster中增加identification字段, 同时数据和原先name数据相同, 最后增加一个唯一键.
|
||||||
|
# 此后, name字段还是表示集群名称, 而identification字段表示的是集群标识, 只能是字母数字及下划线组成,
|
||||||
|
# 数据上报到监控系统时, 集群这个标识采用的字段就是identification字段, 之前使用的是name字段.
|
||||||
|
ALTER TABLE `logical_cluster` ADD COLUMN `identification` VARCHAR(192) NOT NULL DEFAULT '' COMMENT '逻辑集群标识' AFTER `name`;
|
||||||
|
|
||||||
|
UPDATE `logical_cluster` SET `identification`=`name` WHERE id>=0;
|
||||||
|
|
||||||
|
ALTER TABLE `logical_cluster` ADD INDEX `uniq_identification` (`identification` ASC);
|
||||||
|
```
|
||||||
|
|
||||||
|
### 升级至`2.3.0`版本
|
||||||
|
|
||||||
|
#### 1.mysql变更
|
||||||
|
`2.3.0`版本在`gateway_config`表增加了一个描述说明的字段,因此需要执行下面的sql进行字段的增加。
|
||||||
|
|
||||||
|
```sql
|
||||||
|
ALTER TABLE `gateway_config`
|
||||||
|
ADD COLUMN `description` TEXT NULL COMMENT '描述信息' AFTER `version`;
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 785 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
@@ -9,6 +9,15 @@
|
|||||||
|
|
||||||
# 动态配置管理
|
# 动态配置管理
|
||||||
|
|
||||||
|
## 0、目录
|
||||||
|
|
||||||
|
- 1、Topic定时同步任务
|
||||||
|
- 2、专家服务——Topic分区热点
|
||||||
|
- 3、专家服务——Topic分区不足
|
||||||
|
- 4、专家服务——Topic资源治理
|
||||||
|
- 5、账单配置
|
||||||
|
|
||||||
|
|
||||||
## 1、Topic定时同步任务
|
## 1、Topic定时同步任务
|
||||||
|
|
||||||
### 1.1、配置的用途
|
### 1.1、配置的用途
|
||||||
@@ -63,3 +72,97 @@ task:
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2、专家服务——Topic分区热点
|
||||||
|
|
||||||
|
在`Region`所圈定的Broker范围内,某个Topic的Leader数在这些圈定的Broker上分布不均衡时,我们认为该Topic是存在热点的Topic。
|
||||||
|
|
||||||
|
备注:单纯的查看Leader数的分布,确实存在一定的局限性,这块欢迎贡献更多的热点定义于代码。
|
||||||
|
|
||||||
|
|
||||||
|
Topic分区热点相关的动态配置(页面在运维管控->平台管理->配置管理):
|
||||||
|
|
||||||
|
配置Key:
|
||||||
|
```
|
||||||
|
REGION_HOT_TOPIC_CONFIG
|
||||||
|
```
|
||||||
|
|
||||||
|
配置Value:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"maxDisPartitionNum": 2, # Region内Broker间的leader数差距超过2时,则认为是存在热点的Topic
|
||||||
|
"minTopicBytesInUnitB": 1048576, # 流量低于该值的Topic不做统计
|
||||||
|
"ignoreClusterIdList": [ # 忽略的集群
|
||||||
|
50
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3、专家服务——Topic分区不足
|
||||||
|
|
||||||
|
总流量除以分区数,超过指定值时,则我们认为存在Topic分区不足。
|
||||||
|
|
||||||
|
Topic分区不足相关的动态配置(页面在运维管控->平台管理->配置管理):
|
||||||
|
|
||||||
|
配置Key:
|
||||||
|
```
|
||||||
|
TOPIC_INSUFFICIENT_PARTITION_CONFIG
|
||||||
|
```
|
||||||
|
|
||||||
|
配置Value:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"maxBytesInPerPartitionUnitB": 3145728, # 单分区流量超过该值, 则认为分区不去
|
||||||
|
"minTopicBytesInUnitB": 1048576, # 流量低于该值的Topic不做统计
|
||||||
|
"ignoreClusterIdList": [ # 忽略的集群
|
||||||
|
50
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## 4、专家服务——Topic资源治理
|
||||||
|
|
||||||
|
首先,我们认为在一定的时间长度内,Topic的分区offset没有任何变化的Topic,即没有数据写入的Topic,为过期的Topic。
|
||||||
|
|
||||||
|
Topic分区不足相关的动态配置(页面在运维管控->平台管理->配置管理):
|
||||||
|
|
||||||
|
配置Key:
|
||||||
|
```
|
||||||
|
EXPIRED_TOPIC_CONFIG
|
||||||
|
```
|
||||||
|
|
||||||
|
配置Value:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"minExpiredDay": 30, #过期时间大于此值才显示
|
||||||
|
"ignoreClusterIdList": [ # 忽略的集群
|
||||||
|
50
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5、账单配置
|
||||||
|
|
||||||
|
Logi-KafkaManager除了作为Kafka运维管控平台之外,实际上还会有一些资源定价相关的功能。
|
||||||
|
|
||||||
|
当前定价方式:当月Topic的maxAvgDay天的峰值的均值流量作为Topic的使用额度。使用的额度 * 单价 * 溢价(预留buffer) 就等于当月的费用。
|
||||||
|
详细的计算逻辑见:com.xiaojukeji.kafka.manager.task.dispatch.biz.CalKafkaTopicBill; 和 com.xiaojukeji.kafka.manager.task.dispatch.biz.CalTopicStatistics;
|
||||||
|
|
||||||
|
这块在计算Topic的费用的配置如下所示:
|
||||||
|
|
||||||
|
配置Key:
|
||||||
|
```
|
||||||
|
KAFKA_TOPIC_BILL_CONFIG
|
||||||
|
```
|
||||||
|
|
||||||
|
配置Value:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"maxAvgDay": 10, # 使用额度的计算规则
|
||||||
|
"quotaRatio": 1.5, # 溢价率
|
||||||
|
"priseUnitMB": 100 # 单价,即单MB/s流量多少钱
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
10
docs/dev_guide/gateway_config_manager.md
Normal file
10
docs/dev_guide/gateway_config_manager.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Kafka-Gateway 配置说明
|
||||||
17
docs/dev_guide/upgrade_manual/logi-km-v2.3.0.md
Normal file
17
docs/dev_guide/upgrade_manual/logi-km-v2.3.0.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 升级至`2.3.0`版本
|
||||||
|
|
||||||
|
`2.3.0`版本在`gateway_config`表增加了一个描述说明的字段,因此需要执行下面的sql进行字段的增加。
|
||||||
|
|
||||||
|
```sql
|
||||||
|
ALTER TABLE `gateway_config`
|
||||||
|
ADD COLUMN `description` TEXT NULL COMMENT '描述信息' AFTER `version`;
|
||||||
|
```
|
||||||
53
docs/dev_guide/如何增加上报监控系统指标.md
Normal file
53
docs/dev_guide/如何增加上报监控系统指标.md
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 如何增加上报监控系统指标?
|
||||||
|
|
||||||
|
## 0、前言
|
||||||
|
|
||||||
|
LogiKM是 **一站式`Apache Kafka`集群指标监控与运维管控平台** ,当前会将消费Lag,Topic流量等指标上报到监控系统中,从而方便用户在监控系统中对这些指标配置监控告警规则,进而达到监控自身客户端是否正常的目的。
|
||||||
|
|
||||||
|
那么,如果我们想增加一个新的监控指标,应该如何做呢,比如我们想监控Broker的流量,监控Broker的存活信息,监控集群Controller个数等等。
|
||||||
|
|
||||||
|
在具体介绍之前,我们大家都知道,Kafka监控相关的信息,基本都存储于Broker、Jmx以及ZK中。当前LogiKM也已经具备从这三个地方获取数据的基本能力,因此基于LogiKM我们再获取其他指标,总体上还是非常方便的。
|
||||||
|
|
||||||
|
这里我们就以已经获取到的Topic流量信息为例,看LogiKM如何实现Topic指标的获取并上报的。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1、确定指标位置
|
||||||
|
|
||||||
|
基于对Kafka的了解,我们知道Topic流量信息这个指标是存储于Jmx中的,因此我们需要从Jmx中获取。大家如果对于自己所需要获取的指标存储在何处不太清楚的,可以加入我们维护的Kafka中文社区(README中有二维码)中今天沟通交流。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2、指标获取
|
||||||
|
|
||||||
|
Topic流量指标的获取详细见图中说明。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3、指标上报
|
||||||
|
|
||||||
|
上一步我们已经采集到Topic流量指标了,下一步就是将该指标上报到监控系统,这块只需要按照监控系统要求的格式,将数据上报即可。
|
||||||
|
|
||||||
|
LogiKM中有一个monitor模块,具体的如下图所示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## 4、补充说明
|
||||||
|
|
||||||
|
监控系统对接的相关内容见:
|
||||||
|
|
||||||
|
[监控系统集成](./monitor_system_integrate_with_self.md)
|
||||||
|
|
||||||
|
[监控系统集成例子——集成夜莺](./monitor_system_integrate_with_n9e.md)
|
||||||
@@ -58,6 +58,9 @@ custom:
|
|||||||
task:
|
task:
|
||||||
op:
|
op:
|
||||||
sync-topic-enabled: false # 未落盘的Topic定期同步到DB中
|
sync-topic-enabled: false # 未落盘的Topic定期同步到DB中
|
||||||
|
order-auto-exec: # 工单自动化审批线程的开关
|
||||||
|
topic-enabled: false # Topic工单自动化审批开关, false:关闭自动化审批, true:开启
|
||||||
|
app-enabled: false # App工单自动化审批开关, false:关闭自动化审批, true:开启
|
||||||
|
|
||||||
account: # ldap相关的配置, 社区版本暂时支持不够完善,可以先忽略,欢迎贡献代码对这块做优化
|
account: # ldap相关的配置, 社区版本暂时支持不够完善,可以先忽略,欢迎贡献代码对这块做优化
|
||||||
ldap:
|
ldap:
|
||||||
|
|||||||
@@ -31,17 +31,23 @@
|
|||||||
|
|
||||||
**2、源代码进行打包**
|
**2、源代码进行打包**
|
||||||
|
|
||||||
下载好代码之后,进入`Logi-KafkaManager`的主目录,执行`sh build.sh`命令即可,执行完成之后会在`output/kafka-manager-xxx`目录下面生成一个jar包。
|
下载好代码之后,进入`Logi-KafkaManager`的主目录,执行`mvn -Prelease-kafka-manager -Dmaven.test.skip=true clean install -U `命令即可,
|
||||||
|
执行完成之后会在`distribution/target`目录下面生成一个`kafka-manager-*.tar.gz`。
|
||||||
|
和一个`kafka-manager-*.zip` 文件,随便任意一个压缩包都可以;
|
||||||
|
当然此时同级目录有一个已经解压好的文件夹;
|
||||||
|
|
||||||
对于`windows`环境的用户,估计执行不了`sh build.sh`命令,因此可以直接执行`mvn install`,然后在`kafka-manager-web/target`目录下生成一个kafka-manager-web-xxx.jar的包。
|
|
||||||
|
|
||||||
获取到jar包之后,我们继续下面的步骤。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3、MySQL-DB初始化
|
## 3. 解压安装包
|
||||||
|
解压完成后; 在文件目录中可以看到有`kafka-manager/conf/create_mysql_table.sql` 有个mysql初始化文件
|
||||||
|
先初始化DB
|
||||||
|
|
||||||
执行[create_mysql_table.sql](create_mysql_table.sql)中的SQL命令,从而创建所需的MySQL库及表,默认创建的库名是`logi_kafka_manager`。
|
|
||||||
|
## 4、MySQL-DB初始化
|
||||||
|
|
||||||
|
执行[create_mysql_table.sql](../../distribution/conf/create_mysql_table.sql)中的SQL命令,从而创建所需的MySQL库及表,默认创建的库名是`logi_kafka_manager`。
|
||||||
|
|
||||||
```
|
```
|
||||||
# 示例:
|
# 示例:
|
||||||
@@ -50,15 +56,38 @@ mysql -uXXXX -pXXX -h XXX.XXX.XXX.XXX -PXXXX < ./create_mysql_table.sql
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4、启动
|
## 5.修该配置
|
||||||
|
请将`conf/application.yml.example` 文件复制一份出来命名为`application.yml` 放在同级目录:conf/application.yml ;
|
||||||
|
并且修改配置; 当然不修改的话 就会用默认的配置;
|
||||||
|
至少 mysql配置成自己的吧
|
||||||
|
|
||||||
```
|
|
||||||
# application.yml 是配置文件,最简单的是仅修改MySQL相关的配置即可启动
|
|
||||||
|
|
||||||
nohup java -jar kafka-manager.jar --spring.config.location=./application.yml > /dev/null 2>&1 &
|
## 6、启动/关闭
|
||||||
```
|
解压包中有启动和关闭脚本
|
||||||
|
`kafka-manager/bin/shutdown.sh`
|
||||||
|
`kafka-manager/bin/startup.sh`
|
||||||
|
|
||||||
### 5、使用
|
执行 sh startup.sh 启动
|
||||||
|
执行 sh shutdown.sh 关闭
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 6、使用
|
||||||
|
|
||||||
本地启动的话,访问`http://localhost:8080`,输入帐号及密码(默认`admin/admin`)进行登录。更多参考:[kafka-manager 用户使用手册](../user_guide/user_guide_cn.md)
|
本地启动的话,访问`http://localhost:8080`,输入帐号及密码(默认`admin/admin`)进行登录。更多参考:[kafka-manager 用户使用手册](../user_guide/user_guide_cn.md)
|
||||||
|
|
||||||
|
### 7. 升级
|
||||||
|
|
||||||
|
如果是升级版本,请查看文件 [kafka-manager 升级手册](../../distribution/upgrade_config.md)
|
||||||
|
在您下载的启动包(V2.5及其后)中也有记录,在 kafka-manager/upgrade_config.md 中
|
||||||
|
|
||||||
|
|
||||||
|
### 8. 在IDE中启动
|
||||||
|
> 如果想参与开发或者想在IDE中启动的话
|
||||||
|
> 先执行 `mvn -Dmaven.test.skip=true clean install -U `
|
||||||
|
>
|
||||||
|
> 然后这个时候可以选择去 [pom.xml](../../pom.xml) 中将`kafka-manager-console`模块注释掉;
|
||||||
|
> 注释是因为每次install的时候都会把前端文件`kafka-manager-console`重新打包进`kafka-manager-web`
|
||||||
|
>
|
||||||
|
> 完事之后,只需要直接用IDE启动运行`kafka-manager-web`模块中的
|
||||||
|
> com.xiaojukeji.kafka.manager.web.MainApplication main方法就行了
|
||||||
94
docs/install_guide/install_guide_nginx_cn.md
Normal file
94
docs/install_guide/install_guide_nginx_cn.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## nginx配置-安装手册
|
||||||
|
|
||||||
|
# 一、独立部署
|
||||||
|
|
||||||
|
请参考参考:[kafka-manager 安装手册](install_guide_cn.md)
|
||||||
|
|
||||||
|
# 二、nginx配置
|
||||||
|
|
||||||
|
## 1、独立部署配置
|
||||||
|
|
||||||
|
```
|
||||||
|
#nginx 根目录访问配置如下
|
||||||
|
location / {
|
||||||
|
proxy_pass http://ip:port;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2、前后端分离&配置多个静态资源
|
||||||
|
|
||||||
|
以下配置解决`nginx代理多个静态资源`,实现项目前后端分离,版本更新迭代。
|
||||||
|
|
||||||
|
### 1、源码下载
|
||||||
|
|
||||||
|
根据所需版本下载对应代码,下载地址:[Github 下载地址](https://github.com/didi/Logi-KafkaManager)
|
||||||
|
|
||||||
|
### 2、修改webpack.config.js 配置文件
|
||||||
|
|
||||||
|
修改`kafka-manager-console`模块 `webpack.config.js`
|
||||||
|
以下所有<font color='red'>xxxx</font>为nginx代理路径和打包静态文件加载前缀,<font color='red'>xxxx</font>可根据需求自行更改。
|
||||||
|
|
||||||
|
```
|
||||||
|
cd kafka-manager-console
|
||||||
|
vi webpack.config.js
|
||||||
|
|
||||||
|
# publicPath默认打包方式根目录下,修改为nginx代理访问路径。
|
||||||
|
let publicPath = '/xxxx';
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3、打包
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
npm cache clean --force && npm install
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
ps:如果打包过程中报错,运行`npm install clipboard@2.0.6`,相反请忽略!
|
||||||
|
|
||||||
|
### 4、部署
|
||||||
|
|
||||||
|
#### 1、前段静态文件部署
|
||||||
|
|
||||||
|
静态资源 `../kafka-manager-web/src/main/resources/templates`
|
||||||
|
|
||||||
|
上传到指定目录,目前以`root目录`做demo
|
||||||
|
|
||||||
|
#### 2、上传jar包并启动,请参考:[kafka-manager 安装手册](install_guide_cn.md)
|
||||||
|
|
||||||
|
#### 3、修改nginx 配置
|
||||||
|
|
||||||
|
```
|
||||||
|
location /xxxx {
|
||||||
|
# 静态文件存放位置
|
||||||
|
alias /root/templates;
|
||||||
|
try_files $uri $uri/ /xxxx/index.html;
|
||||||
|
index index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
proxy_pass http://ip:port;
|
||||||
|
}
|
||||||
|
#后代端口建议使用/api,如果冲突可以使用以下配置
|
||||||
|
#location /api/v2 {
|
||||||
|
# proxy_pass http://ip:port;
|
||||||
|
#}
|
||||||
|
#location /api/v1 {
|
||||||
|
# proxy_pass http://ip:port;
|
||||||
|
#}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
49
docs/user_guide/call_api_bypass_login.md
Normal file
49
docs/user_guide/call_api_bypass_login.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 登录绕过
|
||||||
|
|
||||||
|
## 背景
|
||||||
|
|
||||||
|
现在除了开放出来的第三方接口,其他接口都需要走登录认证。
|
||||||
|
|
||||||
|
但是第三方接口不多,开放出来的能力有限,但是登录的接口又需要登录,非常的麻烦。
|
||||||
|
|
||||||
|
因此,新增了一个登录绕过的功能,为一些紧急临时的需求,提供一个调用不需要登录的能力。
|
||||||
|
|
||||||
|
## 使用方式
|
||||||
|
|
||||||
|
步骤一:接口调用时,在header中,增加如下信息:
|
||||||
|
```shell
|
||||||
|
# 表示开启登录绕过
|
||||||
|
Trick-Login-Switch : on
|
||||||
|
|
||||||
|
# 登录绕过的用户, 这里可以是admin, 或者是其他的, 但是必须在运维管控->平台管理->用户管理中设置了该用户。
|
||||||
|
Trick-Login-User : admin
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
步骤二:在运维管控->平台管理->平台配置上,设置允许了该用户以绕过的方式登录
|
||||||
|
```shell
|
||||||
|
# 设置的key,必须是这个
|
||||||
|
SECURITY.TRICK_USERS
|
||||||
|
|
||||||
|
# 设置的value,是json数组的格式,例如
|
||||||
|
[ "admin", "logi"]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
步骤三:解释说明
|
||||||
|
|
||||||
|
设置完成上面两步之后,就可以直接调用需要登录的接口了。
|
||||||
|
|
||||||
|
但是还有一点需要注意,绕过的用户仅能调用他有权限的接口,比如一个普通用户,那么他就只能调用普通的接口,不能去调用运维人员的接口。
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# FAQ
|
# FAQ
|
||||||
|
|
||||||
- 0、Github图裂问题解决
|
- 0、支持哪些Kafka版本?
|
||||||
- 1、Topic申请、新建监控告警等操作时没有可选择的集群?
|
- 1、Topic申请、新建监控告警等操作时没有可选择的集群?
|
||||||
- 2、逻辑集群 & Region的用途?
|
- 2、逻辑集群 & Region的用途?
|
||||||
- 3、登录失败?
|
- 3、登录失败?
|
||||||
@@ -18,22 +18,24 @@
|
|||||||
- 6、如何使用`MySQL 8`?
|
- 6、如何使用`MySQL 8`?
|
||||||
- 7、`Jmx`连接失败如何解决?
|
- 7、`Jmx`连接失败如何解决?
|
||||||
- 8、`topic biz data not exist`错误及处理方式
|
- 8、`topic biz data not exist`错误及处理方式
|
||||||
|
- 9、进程启动后,如何查看API文档
|
||||||
|
- 10、如何创建告警组?
|
||||||
|
- 11、连接信息、耗时信息、磁盘信息为什么没有数据?
|
||||||
|
- 12、逻辑集群申请审批通过之后为什么看不到逻辑集群?
|
||||||
|
- 13、heartbeat表关联业务和使用场景是什么?
|
||||||
|
- 14、集群的删除,是否会真正的删除集群?
|
||||||
|
- 15、APP(应用)如何被使用起来?
|
||||||
|
- 16、为什么下线应用提示operation forbidden?
|
||||||
|
- 17、删除Topic成功,为什么过一会儿之后又出现了?
|
||||||
|
- 18、如何在不登录的情况下,调用一些需要登录的接口?
|
||||||
|
- 19、为什么无法看到连接信息、耗时信息等指标?
|
||||||
|
- 20、AppID鉴权、生产消费配额不起作用
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 0、Github图裂问题解决
|
### 0、支持哪些Kafka版本?
|
||||||
|
|
||||||
可以在本地机器`ping github.com`这个地址,获取到`github.com`地址的IP地址。
|
基本上只要所使用的Kafka还依赖于Zookeeper,那么该版本的主要功能基本上应该就是支持的。
|
||||||
|
|
||||||
然后将IP绑定到`/etc/hosts`文件中。
|
|
||||||
|
|
||||||
例如
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# 在 /etc/hosts文件中增加如下信息
|
|
||||||
|
|
||||||
140.82.113.3 github.com
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@
|
|||||||
|
|
||||||
逻辑集群的创建参看:
|
逻辑集群的创建参看:
|
||||||
|
|
||||||
- [kafka-manager 接入集群](docs/user_guide/add_cluster/add_cluster.md) 手册,这里的Region和逻辑集群都必须添加。
|
- [kafka-manager 接入集群](add_cluster/add_cluster.md) 手册,这里的Region和逻辑集群都必须添加。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@
|
|||||||
|
|
||||||
- 3、数据库时区问题。
|
- 3、数据库时区问题。
|
||||||
|
|
||||||
检查MySQL的topic表,查看是否有数据,如果有数据,那么再检查设置的时区是否正确。
|
检查MySQL的cluster表的gmt_modify字段,做一个update动作,看这个gmt_modify时间是否是当前时间,如果不是,那么就是时区问题了。时区不对问题具体可以搜索一下看如何解决。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -109,3 +111,105 @@
|
|||||||
可以在`运维管控->集群列表->Topic信息`下面,编辑申请权限的Topic,为Topic选择一个应用即可。
|
可以在`运维管控->集群列表->Topic信息`下面,编辑申请权限的Topic,为Topic选择一个应用即可。
|
||||||
|
|
||||||
以上仅仅只是针对单个Topic的场景,如果你有非常多的Topic需要进行初始化的,那么此时可以在配置管理中增加一个配置,来定时的对无主的Topic进行同步,具体见:[动态配置管理 - 1、Topic定时同步任务](../dev_guide/dynamic_config_manager.md)
|
以上仅仅只是针对单个Topic的场景,如果你有非常多的Topic需要进行初始化的,那么此时可以在配置管理中增加一个配置,来定时的对无主的Topic进行同步,具体见:[动态配置管理 - 1、Topic定时同步任务](../dev_guide/dynamic_config_manager.md)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### 9、进程启动后,如何查看API文档
|
||||||
|
|
||||||
|
- 滴滴Logi-KafkaManager采用Swagger-API工具记录API文档。Swagger-API地址: [http://IP:PORT/swagger-ui.html#/](http://IP:PORT/swagger-ui.html#/)
|
||||||
|
|
||||||
|
|
||||||
|
### 10、如何创建告警组?
|
||||||
|
|
||||||
|
告警组的创建需要到Logi-KM对接的监控系统中创建,比如我们现在默认是对接了夜莺,那么告警组需要到夜莺中创建,如果没有安装夜莺,那么需要安装一下夜莺并进行对接。当然,这里也可以对接自己内部的监控系统,不过需要实现一些接口。
|
||||||
|
|
||||||
|
具体的文档可见:[监控功能对接夜莺](../dev_guide/monitor_system_integrate_with_n9e.md)、[监控功能对接其他系统](../dev_guide/monitor_system_integrate_with_self.md)
|
||||||
|
|
||||||
|
那么在夜莺中,如何创建告警组呢?
|
||||||
|
需要前往夜莺平台-用户资源中心-团队管理中新建团队。新建过团队之后再次回到Logi-KM中刷新页面就可以在该下拉框中选择告警接收组了。
|
||||||
|
|
||||||
|
### 11、连接信息、耗时信息、磁盘信息为什么没有数据?
|
||||||
|
|
||||||
|
这块需要结合滴滴内部的kafka-gateway一同使用才会有数据,滴滴kafka-gateway暂未开源。
|
||||||
|
|
||||||
|
### 12、逻辑集群申请审批通过之后为什么看不到逻辑集群?
|
||||||
|
|
||||||
|
逻辑集群的申请与审批仅仅只是一个工单流程,并不会去实际创建逻辑集群,逻辑集群的创建还需要手动去创建。
|
||||||
|
|
||||||
|
具体的操作可见:[kafka-manager 接入集群](add_cluster/add_cluster.md)。
|
||||||
|
|
||||||
|
|
||||||
|
### 13、heartbeat表关联业务和使用场景是什么?
|
||||||
|
|
||||||
|
做任务抢占用的。
|
||||||
|
|
||||||
|
KM支持HA的方式部署,那么部署多台的时候,就会出现每一台都可能去做指标收集的事情,这块就使用heartbeat表做KM的存活性判断,然后进行任务的抢占或者是均衡。
|
||||||
|
|
||||||
|
更多详细的内容,可以看一下源码中,heartbeat表在哪里被使用了。
|
||||||
|
|
||||||
|
|
||||||
|
### 14、集群的删除,是否会真正的删除集群?
|
||||||
|
|
||||||
|
Logi-KM的运维管控,集群列表中的集群删除,仅仅只是将该集群从Logi-KM中进行删除,并不会对真正的物理集群做什么操作。
|
||||||
|
|
||||||
|
|
||||||
|
### 15、APP(应用)如何被使用起来?
|
||||||
|
|
||||||
|
app在Logi-KM中可以近似理解为租户,或者是kafka里面的一个账号的概念。
|
||||||
|
|
||||||
|
界面中显示的app信息、权限信息等,在平台层面仅仅只是控制Topic或集群在平台上的可见性,如果使用的是社区版本的Kafka,那么实际上是不能真正的管控到客户端对Topic的生产和消费。
|
||||||
|
|
||||||
|
但是如果是使用的滴滴的Kafka-Gateway,那么是可以做到对客户端的生产和消费的权限管控。滴滴的Kafka-Gateway暂未开源,属于企业服务,具体的可以入群交流,群地址在README中。
|
||||||
|
|
||||||
|
|
||||||
|
### 16、为什么下线应用提示operation forbidden?
|
||||||
|
|
||||||
|
**原因一:**
|
||||||
|
|
||||||
|
该应用还存在对Topic的权限,因此导致下线失败。具体查看的位置在"Topic管理-》应用管理-》详情",可以看到应用对哪些Topic还有权限。
|
||||||
|
|
||||||
|
只有当权限全部去除之后,才可以下线应用。
|
||||||
|
|
||||||
|
**原因二:**
|
||||||
|
|
||||||
|
使用的是2.4.0之前的旧版本,旧版本存在缓存更新的BUG,建议升级至最新的版本,或者简单粗暴的就是重启一下KM。
|
||||||
|
|
||||||
|
|
||||||
|
### 17、删除Topic成功,为什么过一会儿之后又出现了?
|
||||||
|
|
||||||
|
**原因说明:**
|
||||||
|
|
||||||
|
Logi-KM会去请求Topic的endoffset信息,要获取这个信息就需要发送metadata请求,发送metadata请求的时候,如果集群允许自动创建Topic,那么当Topic不存在时,就会自动将该Topic创建出来。
|
||||||
|
|
||||||
|
|
||||||
|
**问题解决:**
|
||||||
|
|
||||||
|
因为在Logi-KM上,禁止Kafka客户端内部元信息获取这个动作非常的难做到,因此短时间内这个问题不好从Logi-KM上解决。
|
||||||
|
|
||||||
|
当然,对于不存在的Topic,Logi-KM是不会进行元信息请求的,因此也不用担心会莫名其妙的创建一个Topic出来。
|
||||||
|
|
||||||
|
但是,另外一点,对于开启允许Topic自动创建的集群,建议是关闭该功能,开启是非常危险的,如果关闭之后,Logi-KM也不会有这个问题。
|
||||||
|
|
||||||
|
最后这里举个开启这个配置后,非常危险的代码例子吧:
|
||||||
|
|
||||||
|
```java
|
||||||
|
for (int i= 0; i < 100000; ++i) {
|
||||||
|
// 如果是客户端类似这样写的,那么一启动,那么将创建10万个Topic出来,集群元信息瞬间爆炸,controller可能就不可服务了。
|
||||||
|
producer.send(new ProducerRecord<String, String>("logi_km" + i,"hello logi_km"));
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 18、如何在不登录的情况下,调用一些需要登录的接口?
|
||||||
|
|
||||||
|
具体见:[登录绕过](./call_api_bypass_login.md)
|
||||||
|
|
||||||
|
### 19、为什么无法看到连接信息、耗时信息等指标?
|
||||||
|
连接信息、耗时信息等指标依赖于滴滴kafka-gateway和滴滴Kafka引擎,通过gateway可获取到连接到该Topic的应用情况,提高对Topic的管控能力。通过滴滴Kafka引擎的自带埋点,可获取到耗时信息,提升Topic生产消费时的可观测性。这部分内容是属于商业版的范畴,暂未开源。如有需要,可进行商业合作。
|
||||||
|
|
||||||
|
具体见:[滴滴Logi-KafkaManager开源版和商业版特性对比](../开源版与商业版特性对比.md)
|
||||||
|
|
||||||
|
### 20、AppID鉴权、生产消费配额不起作用?
|
||||||
|
AppID鉴权、生产消费配额依赖于滴滴kafka-gateway,通过gateway进行身份鉴权和生产消费限流,可避免用户无限制的使用集群的流量,流量大的用户会耗尽系统资源从而影响其他用户的使用,造成集群的节点故障。这部分内容是属于商业版的范畴,暂未开源。如有需要,可进行商业合作。
|
||||||
|
|
||||||
|
具体见:[滴滴Logi-KafkaManager开源版和商业版特性对比](../开源版与商业版特性对比.md)
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,16 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 报警策略-监控指标说明
|
||||||
|
|
||||||
|
| 指标 | 含义 |备注 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| online-kafka-consumer-lag | 消费时,按照分区的维度进行监控lag数 | lag表示有多少数据没有被消费,因为按照分区的维度监控,所以告警时一般会有分区信息 |
|
||||||
|
| online-kafka-consumer-maxLag | 消费时,按照整个Topic的维度,监控Topic所有的分区里面的那个最大的lag | 比如每个分区的lag分别是3、5、7,那么maxLag的值就是max(3,5,7)=7 |
|
||||||
|
| online-kafka-consumer-maxDelayTime | 消费时,按照Topic维度监控预计的消费延迟 | 这块是按照lag和messagesIn之间的关系计算出来的,可能会有误差 |
|
||||||
|
|
||||||
## 报警策略-报警函数介绍
|
## 报警策略-报警函数介绍
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
| 类别 | 函数 | 含义 |函数文案 |备注 |
|
| 类别 | 函数 | 含义 |函数文案 |备注 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| 发生次数 |all,n | 最近$n个周期内,全发生 | 连续发生(all) | |
|
| 发生次数 |all,n | 最近$n个周期内,全发生 | 连续发生(all) | |
|
||||||
@@ -609,10 +609,10 @@ Lag:表示该消费客户端是否有堆积;等于 partition offset-consume
|
|||||||
|
|
||||||
集群类型:选择创建的集群为“独享”还是“独立”。
|
集群类型:选择创建的集群为“独享”还是“独立”。
|
||||||
|
|
||||||
* 独享集群意味着,您独自拥有一个
|
* 独享集群意味着, 您拥有一个集群中,部分broker的使用权限。
|
||||||
集群;
|
|
||||||
|
|
||||||
* 独立集群意味着,您拥有一个集群中,部分broker的使用权限。
|
* 独立集群意味着,您独自拥有一个
|
||||||
|
物理集群;
|
||||||
|
|
||||||
* <font color = red>共享集群意味着,大家共用一个集群及其中broker。</font>
|
* <font color = red>共享集群意味着,大家共用一个集群及其中broker。</font>
|
||||||
|
|
||||||
|
|||||||
55
docs/开源版与商业版特性对比.md
Normal file
55
docs/开源版与商业版特性对比.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**开源版、商业版对比**
|
||||||
|
|
||||||
|
纲要:Logi-KafakManager的商业特性是强依赖于滴滴Kafka Gateway和滴滴kafka引擎。
|
||||||
|
滴滴KafkaGateway主要负责:服务发现、安全管控(身份鉴权、生产消费鉴权等)、流量管控(应用配额等)等;
|
||||||
|
滴滴Kafka引擎主要负责:更丰富的监控指标(broker实时耗时、压缩指标、分区落盘等)、磁盘过载保护等
|
||||||
|
备注:两个版本的产品功能页面是一样的。区别在于开源版未使用滴滴KafkaGateway(滴滴Kafka引擎),部分产品功能/功能不起作用或者页面无数据
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| 模块 |对比指标 |底层依赖 |开源版 |商业版 |备注 |
|
||||||
|
| --- | --- | --- | --- | --- | --- |
|
||||||
|
| 服务发现 | bootstrap地址变更对客户端无影响 | Gateway | | 是| |
|
||||||
|
| 安全管控 | 身份鉴权(appID+password) | Gateway | | 是 | |
|
||||||
|
| | 权限鉴权(Topic+appID) | Gateway | | 是 | |
|
||||||
|
| 指标监控 | Topic实时流量、历史流量 | | 是 | 是 | |
|
||||||
|
| | Broker实时耗时、历史耗时 | 引擎 | | 是 | |
|
||||||
|
| | 分区落盘 | 引擎 | | 是 | |
|
||||||
|
| | Topic里的数据压缩格式 | 引擎 | | 是 | |
|
||||||
|
| | 连接信息(Topic上有哪些应用连接) | Gateway | | 是| |
|
||||||
|
| | 流量管控(应用配额、生产消费限流等) | Gateway | | 是 | |
|
||||||
|
| 监控报警 | | | 是 | 是 | 监控指标上报,需对接外部监控系统(夜莺or企业内部监控系统) |
|
||||||
|
| Topic运维 | 申请分区 | | 是 | 是 | |
|
||||||
|
| | 调整配额 | Gateway | | | 是 |
|
||||||
|
| | Topic数据采样 | | 是 | 是 | |
|
||||||
|
| | 消费组管理(重置消费偏移等) | | 是 | 是 | |
|
||||||
|
| 集群管理 | 集群接入(部署) | | 是 | 是 | 需手动部署集群,或借助外部的自动化部署系统(夜莺)来部署系统 |
|
||||||
|
| | 集群指标监控 | | 是 | 是 | |
|
||||||
|
| | 按照Region、逻辑集群进行管理 | | 是 | 是 | |
|
||||||
|
| | Topic迁移 | | 是 | 是| |
|
||||||
|
| | 集群任务(集群版本管理、升级、扩缩容、回滚等) | | 是 | 是 | 需借助夜莺或自动化部署系统来实现 |
|
||||||
|
| | 磁盘过载保护 | 引擎 | | 是 | |
|
||||||
|
| | 指定broker作为优选controller | Gateway | | 是 | |
|
||||||
|
| Gateway管理 | 管理 Gateway的配置文件 | Gateway | | 是 | |
|
||||||
|
| 资源治理 | 专家服务(Topic分区热点、Topic分区不足、Topic长期未使用、Topic流量异常) | | 是 | 是 | 开源版:具备问题发现与基础的问题解决能力;商业版:可在此基础上,融入滴滴内部的资源治理经验,提供更加专家化的问题解决方法 |
|
||||||
|
| | 健康分 | | 是 | 是 | 开源版:具备基础的健康分算法;商业版:可融入更多的指标统计,及定制化的健康分算法 |
|
||||||
|
| 运营管理 | 资源审批(应用申请、Topic申请、分区申请、配额申请、集群申请等,都需要通过工单进行审批) | |是 | 是 | |
|
||||||
|
| | 账单体系(根据流量核算Topic、集群费用) | | 是 | 是| |
|
||||||
|
|
||||||
|
|
||||||
|
**总结**
|
||||||
|
|
||||||
|
滴滴LogiKM的商业特性体现在滴滴Kafka Gateway、滴滴Kafka引擎、内部沉淀出的资源治理专家经验、可定制化的健康分算法。
|
||||||
|
从场景来看,滴滴Logi-KafkaManager的开源版本在kafka集群运维、的Topic管理、监控告警、资源治理等kafka核心场景都充分开源用户的使用需求并且有着出色的表现。而商业版相较于开源版在安全管控、流量管控、更丰富的指标监控、资源治理专家经验的具有明显提升,更加符合企业业务需求。
|
||||||
|
除此之外,商业版还可根据企业实际需求对平台源码进行定制化改造,并提供运维保障,稳定性保障,运营保障等服务。
|
||||||
|
|
||||||
@@ -47,4 +47,13 @@ public enum AccountRoleEnum {
|
|||||||
}
|
}
|
||||||
return AccountRoleEnum.UNKNOWN;
|
return AccountRoleEnum.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static AccountRoleEnum getUserRoleEnum(String roleName) {
|
||||||
|
for (AccountRoleEnum elem: AccountRoleEnum.values()) {
|
||||||
|
if (elem.message.equalsIgnoreCase(roleName)) {
|
||||||
|
return elem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AccountRoleEnum.UNKNOWN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.bizenum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zengqiao
|
|
||||||
* @date 20/7/27
|
|
||||||
*/
|
|
||||||
public enum ApiLevelEnum {
|
|
||||||
LEVEL_0(0),
|
|
||||||
LEVEL_1(1),
|
|
||||||
LEVEL_2(2),
|
|
||||||
LEVEL_3(3)
|
|
||||||
;
|
|
||||||
|
|
||||||
private int level;
|
|
||||||
|
|
||||||
ApiLevelEnum(int level) {
|
|
||||||
this.level = level;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,18 +24,10 @@ public enum ConsumeHealthEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ConsumeHealthEnum{" +
|
return "ConsumeHealthEnum{" +
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ public enum DBStatusEnum {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(int status) {
|
@Override
|
||||||
this.status = status;
|
public String toString() {
|
||||||
|
return "DBStatusEnum{" +
|
||||||
|
"status=" + status +
|
||||||
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,18 +21,10 @@ public enum IDCEnum {
|
|||||||
return idc;
|
return idc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIdc(String idc) {
|
|
||||||
this.idc = idc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "IDCEnum{" +
|
return "IDCEnum{" +
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ public enum KafkaBrokerRoleEnum {
|
|||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRole(String role) {
|
|
||||||
this.role = role;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "KafkaBrokerRoleEnum{" +
|
return "KafkaBrokerRoleEnum{" +
|
||||||
|
|||||||
@@ -24,18 +24,10 @@ public enum KafkaClientEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "KafkaClientEnum{" +
|
return "KafkaClientEnum{" +
|
||||||
|
|||||||
@@ -18,4 +18,11 @@ public enum OffsetResetTypeEnum {
|
|||||||
public Integer getCode() {
|
public Integer getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "OffsetResetTypeEnum{" +
|
||||||
|
"code=" + code +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public enum OperateEnum {
|
|||||||
|
|
||||||
public static boolean validate(Integer code) {
|
public static boolean validate(Integer code) {
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
for (OperateEnum state : OperateEnum.values()) {
|
for (OperateEnum state : OperateEnum.values()) {
|
||||||
if (state.getCode() == code) {
|
if (state.getCode() == code) {
|
||||||
|
|||||||
@@ -27,4 +27,12 @@ public enum OperationStatusEnum {
|
|||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "OperationStatusEnum{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message='" + message + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,9 +15,9 @@ public enum PeakFlowStatusEnum {
|
|||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
public Integer code;
|
private Integer code;
|
||||||
|
|
||||||
public String message;
|
private String message;
|
||||||
|
|
||||||
PeakFlowStatusEnum(Integer code, String message) {
|
PeakFlowStatusEnum(Integer code, String message) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
@@ -28,18 +28,10 @@ public enum PeakFlowStatusEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PeakFlowStatusEnum{" +
|
return "PeakFlowStatusEnum{" +
|
||||||
|
|||||||
@@ -29,4 +29,12 @@ public enum RebalanceDimensionEnum {
|
|||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RebalanceDimensionEnum{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message='" + message + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.bizenum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否上报监控系统
|
|
||||||
* @author zengqiao
|
|
||||||
* @date 20/9/25
|
|
||||||
*/
|
|
||||||
public enum SinkMonitorSystemEnum {
|
|
||||||
SINK_MONITOR_SYSTEM(0, "上报监控系统"),
|
|
||||||
NOT_SINK_MONITOR_SYSTEM(1, "不上报监控系统"),
|
|
||||||
;
|
|
||||||
|
|
||||||
private Integer code;
|
|
||||||
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
SinkMonitorSystemEnum(Integer code, String message) {
|
|
||||||
this.code = code;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "SinkMonitorSystemEnum{" +
|
|
||||||
"code=" + code +
|
|
||||||
", message='" + message + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -43,18 +43,10 @@ public enum TaskStatusEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TaskStatusEnum{" +
|
return "TaskStatusEnum{" +
|
||||||
@@ -64,9 +56,6 @@ public enum TaskStatusEnum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean isFinished(Integer code) {
|
public static Boolean isFinished(Integer code) {
|
||||||
if (code >= FINISHED.getCode()) {
|
return code >= FINISHED.getCode();
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,11 +45,6 @@ public enum TaskStatusReassignEnum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean isFinished(Integer code) {
|
public static Boolean isFinished(Integer code) {
|
||||||
if (SUCCEED.getCode().equals(code)
|
return SUCCEED.getCode().equals(code) || FAILED.getCode().equals(code) || CANCELED.getCode().equals(code);
|
||||||
|| FAILED.getCode().equals(code)
|
|
||||||
|| CANCELED.getCode().equals(code)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,4 +33,12 @@ public enum TopicAuthorityEnum {
|
|||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TopicAuthorityEnum{" +
|
||||||
|
"code=" + code +
|
||||||
|
", message='" + message + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.xiaojukeji.kafka.manager.common.bizenum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期Topic状态
|
||||||
|
* @author zengqiao
|
||||||
|
* @date 21/01/25
|
||||||
|
*/
|
||||||
|
public enum TopicExpiredStatusEnum {
|
||||||
|
ALREADY_NOTIFIED_AND_DELETED(-2, "已通知, 已下线"),
|
||||||
|
ALREADY_NOTIFIED_AND_CAN_DELETE(-1, "已通知, 可下线"),
|
||||||
|
ALREADY_EXPIRED_AND_WAIT_NOTIFY(0, "已过期, 待通知"),
|
||||||
|
ALREADY_NOTIFIED_AND_WAIT_RESPONSE(1, "已通知, 待反馈"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
TopicExpiredStatusEnum(int status, String message) {
|
||||||
|
this.status = status;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TopicExpiredStatusEnum{" +
|
||||||
|
"status=" + status +
|
||||||
|
", message='" + message + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,18 +23,10 @@ public enum TopicOffsetChangedEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(Integer code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TopicOffsetChangedEnum{" +
|
return "TopicOffsetChangedEnum{" +
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ package com.xiaojukeji.kafka.manager.common.bizenum.gateway;
|
|||||||
* @date 20/7/28
|
* @date 20/7/28
|
||||||
*/
|
*/
|
||||||
public enum GatewayConfigKeyEnum {
|
public enum GatewayConfigKeyEnum {
|
||||||
SD_CLUSTER_ID("SERVICE_DISCOVERY_CLUSTER_ID", "SERVICE_DISCOVERY_CLUSTER_ID"),
|
SD_CLUSTER_ID("SD_CLUSTER_ID", "SD_CLUSTER_ID"),
|
||||||
SD_QUEUE_SIZE("SERVICE_DISCOVERY_QUEUE_SIZE", "SERVICE_DISCOVERY_QUEUE_SIZE"),
|
SD_QUEUE_SIZE("SD_QUEUE_SIZE", "SD_QUEUE_SIZE"),
|
||||||
SD_APP_ID_RATE("SERVICE_DISCOVERY_APPID_RATE", "SERVICE_DISCOVERY_APPID_RATE"),
|
SD_APP_RATE("SD_APP_RATE", "SD_APP_RATE"),
|
||||||
SD_IP_RATE("SERVICE_DISCOVERY_IP_RATE", "SERVICE_DISCOVERY_IP_RATE"),
|
SD_IP_RATE("SD_IP_RATE", "SD_IP_RATE"),
|
||||||
SD_SP_RATE("SERVICE_DISCOVERY_SP_RATE", "SERVICE_DISCOVERY_SP_RATE"),
|
SD_SP_RATE("SD_SP_RATE", "SD_SP_RATE"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -26,18 +26,10 @@ public enum GatewayConfigKeyEnum {
|
|||||||
return configType;
|
return configType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigType(String configType) {
|
|
||||||
this.configType = configType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConfigName() {
|
public String getConfigName() {
|
||||||
return configName;
|
return configName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigName(String configName) {
|
|
||||||
this.configName = configName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "GatewayConfigKeyEnum{" +
|
return "GatewayConfigKeyEnum{" +
|
||||||
|
|||||||
@@ -12,4 +12,7 @@ public class ApiLevelContent {
|
|||||||
public static final int LEVEL_NORMAL_3 = 3;
|
public static final int LEVEL_NORMAL_3 = 3;
|
||||||
|
|
||||||
public static final int LEVEL_DEFAULT_4 = 4;
|
public static final int LEVEL_DEFAULT_4 = 4;
|
||||||
|
|
||||||
|
private ApiLevelContent() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,19 +7,28 @@ package com.xiaojukeji.kafka.manager.common.constant;
|
|||||||
*/
|
*/
|
||||||
public class ApiPrefix {
|
public class ApiPrefix {
|
||||||
public static final String API_PREFIX = "/api/";
|
public static final String API_PREFIX = "/api/";
|
||||||
public static final String API_V1_PREFIX = API_PREFIX + "v1/";
|
private static final String API_V1_PREFIX = API_PREFIX + "v1/";
|
||||||
public static final String API_V2_PREFIX = API_PREFIX + "v2/";
|
|
||||||
|
// login
|
||||||
|
public static final String API_V1_SSO_PREFIX = API_V1_PREFIX + "sso/";
|
||||||
|
|
||||||
// console
|
// console
|
||||||
public static final String API_V1_SSO_PREFIX = API_V1_PREFIX + "sso/";
|
|
||||||
public static final String API_V1_NORMAL_PREFIX = API_V1_PREFIX + "normal/";
|
public static final String API_V1_NORMAL_PREFIX = API_V1_PREFIX + "normal/";
|
||||||
public static final String API_V1_RD_PREFIX = API_V1_PREFIX + "rd/";
|
public static final String API_V1_RD_PREFIX = API_V1_PREFIX + "rd/";
|
||||||
public static final String API_V1_OP_PREFIX = API_V1_PREFIX + "op/";
|
public static final String API_V1_OP_PREFIX = API_V1_PREFIX + "op/";
|
||||||
|
|
||||||
// open
|
// open
|
||||||
public static final String API_V1_THIRD_PART_PREFIX = API_V1_PREFIX + "third-part/";
|
public static final String API_V1_THIRD_PART_PREFIX = API_V1_PREFIX + "third-part/";
|
||||||
public static final String API_V2_THIRD_PART_PREFIX = API_V2_PREFIX + "third-part/";
|
|
||||||
|
// 开放给OP的接口, 后续对 应的接口的集群都需要是物理集群
|
||||||
|
public static final String API_V1_THIRD_PART_OP_PREFIX = API_V1_THIRD_PART_PREFIX + "op/";
|
||||||
|
|
||||||
|
// 开放给Normal的接口, 后续对应的接口的集群,都需要是逻辑集群
|
||||||
|
public static final String API_V1_THIRD_PART_NORMAL_PREFIX = API_V1_THIRD_PART_PREFIX + "normal/";
|
||||||
|
|
||||||
// gateway
|
// gateway
|
||||||
public static final String GATEWAY_API_V1_PREFIX = "/gateway" + API_V1_PREFIX;
|
public static final String GATEWAY_API_V1_PREFIX = "/gateway" + API_V1_PREFIX;
|
||||||
|
|
||||||
|
private ApiPrefix() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -30,4 +30,7 @@ public class ConfigConstant {
|
|||||||
public static final String BROKER_CAPACITY_LIMIT_CONFIG_KEY = "BROKER_CAPACITY_LIMIT_CONFIG";
|
public static final String BROKER_CAPACITY_LIMIT_CONFIG_KEY = "BROKER_CAPACITY_LIMIT_CONFIG";
|
||||||
|
|
||||||
public static final String KAFKA_CLUSTER_DO_CONFIG_KEY = "KAFKA_CLUSTER_DO_CONFIG";
|
public static final String KAFKA_CLUSTER_DO_CONFIG_KEY = "KAFKA_CLUSTER_DO_CONFIG";
|
||||||
|
|
||||||
|
private ConfigConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,7 @@ public class Constant {
|
|||||||
public static final Integer DEFAULT_MAX_CAL_TOPIC_EXPIRED_DAY = 90;
|
public static final Integer DEFAULT_MAX_CAL_TOPIC_EXPIRED_DAY = 90;
|
||||||
|
|
||||||
public static final Integer INVALID_CODE = -1;
|
public static final Integer INVALID_CODE = -1;
|
||||||
|
|
||||||
|
private Constant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,7 @@ public class KafkaConstant {
|
|||||||
public static final String CLIENT_VERSION_NAME_UNKNOWN = "unknown";
|
public static final String CLIENT_VERSION_NAME_UNKNOWN = "unknown";
|
||||||
|
|
||||||
public static final String RETENTION_MS_KEY = "retention.ms";
|
public static final String RETENTION_MS_KEY = "retention.ms";
|
||||||
|
|
||||||
|
private KafkaConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -39,4 +39,7 @@ public class KafkaMetricsCollections {
|
|||||||
* Broker信息
|
* Broker信息
|
||||||
*/
|
*/
|
||||||
public static final int BROKER_VERSION = 400;
|
public static final int BROKER_VERSION = 400;
|
||||||
|
|
||||||
|
private KafkaMetricsCollections() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,4 +10,7 @@ public class LogConstant {
|
|||||||
public static final String API_METRICS_LOGGER = "API_METRICS_LOGGER";
|
public static final String API_METRICS_LOGGER = "API_METRICS_LOGGER";
|
||||||
|
|
||||||
public static final String SCHEDULED_TASK_LOGGER = "SCHEDULED_TASK_LOGGER";
|
public static final String SCHEDULED_TASK_LOGGER = "SCHEDULED_TASK_LOGGER";
|
||||||
|
|
||||||
|
private LogConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,4 +11,7 @@ public class LoginConstant {
|
|||||||
public static final String COOKIE_CHINESE_USERNAME_KEY = "chineseName";
|
public static final String COOKIE_CHINESE_USERNAME_KEY = "chineseName";
|
||||||
|
|
||||||
public static final Integer COOKIE_OR_SESSION_MAX_AGE_UNIT_MS = 24 * 60 * 60 * 1000;
|
public static final Integer COOKIE_OR_SESSION_MAX_AGE_UNIT_MS = 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
private LoginConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,4 +6,7 @@ package com.xiaojukeji.kafka.manager.common.constant;
|
|||||||
*/
|
*/
|
||||||
public class SystemCodeConstant {
|
public class SystemCodeConstant {
|
||||||
public static final String KAFKA_MANAGER = "kafka-manager";
|
public static final String KAFKA_MANAGER = "kafka-manager";
|
||||||
|
|
||||||
|
private SystemCodeConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,8 @@ public class TopicCreationConstant {
|
|||||||
|
|
||||||
public static final String TOPIC_RETENTION_TIME_KEY_NAME = "retention.ms";
|
public static final String TOPIC_RETENTION_TIME_KEY_NAME = "retention.ms";
|
||||||
|
|
||||||
|
public static final String TOPIC_RETENTION_BYTES_KEY_NAME = "retention.bytes";
|
||||||
|
|
||||||
public static final Long DEFAULT_QUOTA = 3 * 1024 * 1024L;
|
public static final Long DEFAULT_QUOTA = 3 * 1024 * 1024L;
|
||||||
|
|
||||||
public static Properties createNewProperties(Long retentionTime) {
|
public static Properties createNewProperties(Long retentionTime) {
|
||||||
@@ -54,4 +56,7 @@ public class TopicCreationConstant {
|
|||||||
* 单次自动化审批, 最多允许的通过单子
|
* 单次自动化审批, 最多允许的通过单子
|
||||||
*/
|
*/
|
||||||
public static final Integer MAX_PASSED_ORDER_NUM_PER_TASK = 200;
|
public static final Integer MAX_PASSED_ORDER_NUM_PER_TASK = 200;
|
||||||
|
|
||||||
|
private TopicCreationConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,4 +16,7 @@ public class TopicSampleConstant {
|
|||||||
public static final Integer MAX_TIMEOUT_UNIT_MS = 10000;
|
public static final Integer MAX_TIMEOUT_UNIT_MS = 10000;
|
||||||
public static final Integer POLL_TIME_OUT_UNIT_MS = 2000;
|
public static final Integer POLL_TIME_OUT_UNIT_MS = 2000;
|
||||||
public static final Integer MAX_DATA_LENGTH_UNIT_BYTE = 2048;
|
public static final Integer MAX_DATA_LENGTH_UNIT_BYTE = 2048;
|
||||||
|
|
||||||
|
private TopicSampleConstant() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.xiaojukeji.kafka.manager.common.constant;
|
||||||
|
|
||||||
|
public class TrickLoginConstant {
|
||||||
|
/**
|
||||||
|
* HTTP Header key
|
||||||
|
*/
|
||||||
|
public static final String TRICK_LOGIN_SWITCH = "Trick-Login-Switch";
|
||||||
|
|
||||||
|
public static final String TRICK_LOGIN_USER = "Trick-Login-User";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置允许 trick 登录用户名单
|
||||||
|
*/
|
||||||
|
public static final String TRICK_LOGIN_LEGAL_USER_CONFIG_KEY = "SECURITY.TRICK_USERS";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开关状态值
|
||||||
|
*/
|
||||||
|
public static final String TRICK_LOGIN_SWITCH_ON = "on";
|
||||||
|
public static final String TRICK_LOGIN_SWITCH_OFF = "off";
|
||||||
|
|
||||||
|
private TrickLoginConstant() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -97,7 +97,7 @@ public class Result<T> implements Serializable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> Result<T> buildFailure(String message) {
|
public static <T> Result<T> buildGatewayFailure(String message) {
|
||||||
Result<T> result = new Result<T>();
|
Result<T> result = new Result<T>();
|
||||||
result.setCode(ResultStatus.GATEWAY_INVALID_REQUEST.getCode());
|
result.setCode(ResultStatus.GATEWAY_INVALID_REQUEST.getCode());
|
||||||
result.setMessage(message);
|
result.setMessage(message);
|
||||||
@@ -105,6 +105,14 @@ public class Result<T> implements Serializable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> Result<T> buildFailure(String message) {
|
||||||
|
Result<T> result = new Result<T>();
|
||||||
|
result.setCode(ResultStatus.FAIL.getCode());
|
||||||
|
result.setMessage(message);
|
||||||
|
result.setData(null);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public static Result buildFrom(ResultStatus resultStatus) {
|
public static Result buildFrom(ResultStatus resultStatus) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
result.setCode(resultStatus.getCode());
|
result.setCode(resultStatus.getCode());
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public enum ResultStatus {
|
|||||||
|
|
||||||
SUCCESS(Constant.SUCCESS, "success"),
|
SUCCESS(Constant.SUCCESS, "success"),
|
||||||
|
|
||||||
|
FAIL(1, "操作失败"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作错误[1000, 2000)
|
* 操作错误[1000, 2000)
|
||||||
* ------------------------------------------------------------------------------------------
|
* ------------------------------------------------------------------------------------------
|
||||||
@@ -23,6 +25,9 @@ public enum ResultStatus {
|
|||||||
CHANGE_ZOOKEEPER_FORBIDDEN(1405, "change zookeeper forbidden"),
|
CHANGE_ZOOKEEPER_FORBIDDEN(1405, "change zookeeper forbidden"),
|
||||||
|
|
||||||
|
|
||||||
|
APP_OFFLINE_FORBIDDEN(1406, "先下线topic,才能下线应用~"),
|
||||||
|
|
||||||
|
|
||||||
TOPIC_OPERATION_PARAM_NULL_POINTER(1450, "参数错误"),
|
TOPIC_OPERATION_PARAM_NULL_POINTER(1450, "参数错误"),
|
||||||
TOPIC_OPERATION_PARTITION_NUM_ILLEGAL(1451, "分区数错误"),
|
TOPIC_OPERATION_PARTITION_NUM_ILLEGAL(1451, "分区数错误"),
|
||||||
TOPIC_OPERATION_BROKER_NUM_NOT_ENOUGH(1452, "Broker数不足错误"),
|
TOPIC_OPERATION_BROKER_NUM_NOT_ENOUGH(1452, "Broker数不足错误"),
|
||||||
@@ -91,6 +96,8 @@ public enum ResultStatus {
|
|||||||
|
|
||||||
ZOOKEEPER_CONNECT_FAILED(8020, "zookeeper connect failed"),
|
ZOOKEEPER_CONNECT_FAILED(8020, "zookeeper connect failed"),
|
||||||
ZOOKEEPER_READ_FAILED(8021, "zookeeper read failed"),
|
ZOOKEEPER_READ_FAILED(8021, "zookeeper read failed"),
|
||||||
|
ZOOKEEPER_WRITE_FAILED(8022, "zookeeper write failed"),
|
||||||
|
ZOOKEEPER_DELETE_FAILED(8023, "zookeeper delete failed"),
|
||||||
|
|
||||||
// 调用集群任务里面的agent失败
|
// 调用集群任务里面的agent失败
|
||||||
CALL_CLUSTER_TASK_AGENT_FAILED(8030, " call cluster task agent failed"),
|
CALL_CLUSTER_TASK_AGENT_FAILED(8030, " call cluster task agent failed"),
|
||||||
@@ -102,6 +109,7 @@ public enum ResultStatus {
|
|||||||
STORAGE_UPLOAD_FILE_FAILED(8050, "upload file failed"),
|
STORAGE_UPLOAD_FILE_FAILED(8050, "upload file failed"),
|
||||||
STORAGE_FILE_TYPE_NOT_SUPPORT(8051, "File type not support"),
|
STORAGE_FILE_TYPE_NOT_SUPPORT(8051, "File type not support"),
|
||||||
STORAGE_DOWNLOAD_FILE_FAILED(8052, "download file failed"),
|
STORAGE_DOWNLOAD_FILE_FAILED(8052, "download file failed"),
|
||||||
|
LDAP_AUTHENTICATION_FAILED(8053, "ldap authentication failed"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class ClusterDetailDTO {
|
|||||||
|
|
||||||
private String securityProperties;
|
private String securityProperties;
|
||||||
|
|
||||||
|
private String jmxProperties;
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
private Date gmtCreate;
|
private Date gmtCreate;
|
||||||
@@ -103,6 +105,14 @@ public class ClusterDetailDTO {
|
|||||||
this.securityProperties = securityProperties;
|
this.securityProperties = securityProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getJmxProperties() {
|
||||||
|
return jmxProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJmxProperties(String jmxProperties) {
|
||||||
|
this.jmxProperties = jmxProperties;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getStatus() {
|
public Integer getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -176,8 +186,9 @@ public class ClusterDetailDTO {
|
|||||||
", bootstrapServers='" + bootstrapServers + '\'' +
|
", bootstrapServers='" + bootstrapServers + '\'' +
|
||||||
", kafkaVersion='" + kafkaVersion + '\'' +
|
", kafkaVersion='" + kafkaVersion + '\'' +
|
||||||
", idc='" + idc + '\'' +
|
", idc='" + idc + '\'' +
|
||||||
", mode='" + mode + '\'' +
|
", mode=" + mode +
|
||||||
", securityProperties='" + securityProperties + '\'' +
|
", securityProperties='" + securityProperties + '\'' +
|
||||||
|
", jmxProperties='" + jmxProperties + '\'' +
|
||||||
", status=" + status +
|
", status=" + status +
|
||||||
", gmtCreate=" + gmtCreate +
|
", gmtCreate=" + gmtCreate +
|
||||||
", gmtModify=" + gmtModify +
|
", gmtModify=" + gmtModify +
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.entity.ao.config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zengqiao
|
|
||||||
* @date 20/9/7
|
|
||||||
*/
|
|
||||||
public class SinkTopicRequestTimeMetricsConfig {
|
|
||||||
private Long clusterId;
|
|
||||||
|
|
||||||
private String topicName;
|
|
||||||
|
|
||||||
private Long startId;
|
|
||||||
|
|
||||||
private Long step;
|
|
||||||
|
|
||||||
public Long getClusterId() {
|
|
||||||
return clusterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClusterId(Long clusterId) {
|
|
||||||
this.clusterId = clusterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTopicName() {
|
|
||||||
return topicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTopicName(String topicName) {
|
|
||||||
this.topicName = topicName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStartId() {
|
|
||||||
return startId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartId(Long startId) {
|
|
||||||
this.startId = startId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStep() {
|
|
||||||
return step;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStep(Long step) {
|
|
||||||
this.step = step;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "SinkTopicRequestTimeMetricsConfig{" +
|
|
||||||
"clusterId=" + clusterId +
|
|
||||||
", topicName='" + topicName + '\'' +
|
|
||||||
", startId=" + startId +
|
|
||||||
", step=" + step +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
|
package com.xiaojukeji.kafka.manager.common.entity.ao.gateway;
|
||||||
|
|
||||||
|
import com.xiaojukeji.kafka.manager.common.entity.dto.gateway.TopicQuotaDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhongyuankai
|
* @author zhongyuankai
|
||||||
* @date 2020/4/27
|
* @date 2020/4/27
|
||||||
@@ -65,4 +67,15 @@ public class TopicQuota {
|
|||||||
", consumeQuota=" + consumeQuota +
|
", consumeQuota=" + consumeQuota +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TopicQuota buildFrom(TopicQuotaDTO dto) {
|
||||||
|
TopicQuota topicQuota = new TopicQuota();
|
||||||
|
topicQuota.setAppId(dto.getAppId());
|
||||||
|
topicQuota.setClusterId(dto.getClusterId());
|
||||||
|
topicQuota.setTopicName(dto.getTopicName());
|
||||||
|
topicQuota.setProduceQuota(dto.getProduceQuota());
|
||||||
|
topicQuota.setConsumeQuota(dto.getConsumeQuota());
|
||||||
|
return topicQuota;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ public class MineTopicSummary {
|
|||||||
|
|
||||||
private Integer access;
|
private Integer access;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
public Long getLogicalClusterId() {
|
public Long getLogicalClusterId() {
|
||||||
return logicalClusterId;
|
return logicalClusterId;
|
||||||
}
|
}
|
||||||
@@ -105,6 +107,14 @@ public class MineTopicSummary {
|
|||||||
this.access = access;
|
this.access = access;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MineTopicSummary{" +
|
return "MineTopicSummary{" +
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class TopicBasicDTO {
|
|||||||
|
|
||||||
private Long retentionTime;
|
private Long retentionTime;
|
||||||
|
|
||||||
|
private Long retentionBytes;
|
||||||
|
|
||||||
public Long getClusterId() {
|
public Long getClusterId() {
|
||||||
return clusterId;
|
return clusterId;
|
||||||
}
|
}
|
||||||
@@ -157,6 +159,14 @@ public class TopicBasicDTO {
|
|||||||
this.retentionTime = retentionTime;
|
this.retentionTime = retentionTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getRetentionBytes() {
|
||||||
|
return retentionBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRetentionBytes(Long retentionBytes) {
|
||||||
|
this.retentionBytes = retentionBytes;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TopicBasicDTO{" +
|
return "TopicBasicDTO{" +
|
||||||
@@ -166,7 +176,7 @@ public class TopicBasicDTO {
|
|||||||
", principals='" + principals + '\'' +
|
", principals='" + principals + '\'' +
|
||||||
", topicName='" + topicName + '\'' +
|
", topicName='" + topicName + '\'' +
|
||||||
", description='" + description + '\'' +
|
", description='" + description + '\'' +
|
||||||
", regionNameList='" + regionNameList + '\'' +
|
", regionNameList=" + regionNameList +
|
||||||
", score=" + score +
|
", score=" + score +
|
||||||
", topicCodeC='" + topicCodeC + '\'' +
|
", topicCodeC='" + topicCodeC + '\'' +
|
||||||
", partitionNum=" + partitionNum +
|
", partitionNum=" + partitionNum +
|
||||||
@@ -175,6 +185,7 @@ public class TopicBasicDTO {
|
|||||||
", modifyTime=" + modifyTime +
|
", modifyTime=" + modifyTime +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", retentionTime=" + retentionTime +
|
", retentionTime=" + retentionTime +
|
||||||
|
", retentionBytes=" + retentionBytes +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.xiaojukeji.kafka.manager.common.entity.dto.gateway;
|
||||||
|
|
||||||
|
import com.xiaojukeji.kafka.manager.common.entity.dto.ClusterTopicDTO;
|
||||||
|
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
@ApiModel(description = "配额调整")
|
||||||
|
public class TopicQuotaDTO extends ClusterTopicDTO {
|
||||||
|
@ApiModelProperty(value = "appId")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发送数据速率B/s")
|
||||||
|
private Long produceQuota;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "消费数据速率B/s")
|
||||||
|
private Long consumeQuota;
|
||||||
|
|
||||||
|
public String getAppId() {
|
||||||
|
return appId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppId(String appId) {
|
||||||
|
this.appId = appId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProduceQuota() {
|
||||||
|
return produceQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProduceQuota(Long produceQuota) {
|
||||||
|
this.produceQuota = produceQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getConsumeQuota() {
|
||||||
|
return consumeQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConsumeQuota(Long consumeQuota) {
|
||||||
|
this.consumeQuota = consumeQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean paramLegal() {
|
||||||
|
return !ValidateUtils.isNullOrLessThanZero(clusterId) && !ValidateUtils.isBlank(topicName) && !ValidateUtils.isBlank(appId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.xiaojukeji.kafka.manager.common.entity.dto.op;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zengqiao
|
||||||
|
* @date 21/01/24
|
||||||
|
*/
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
@ApiModel(description="优选为Controller的候选者")
|
||||||
|
public class ControllerPreferredCandidateDTO {
|
||||||
|
@ApiModelProperty(value="集群ID")
|
||||||
|
private Long clusterId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="优选为controller的BrokerId")
|
||||||
|
private List<Integer> brokerIdList;
|
||||||
|
|
||||||
|
public Long getClusterId() {
|
||||||
|
return clusterId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClusterId(Long clusterId) {
|
||||||
|
this.clusterId = clusterId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getBrokerIdList() {
|
||||||
|
return brokerIdList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBrokerIdList(List<Integer> brokerIdList) {
|
||||||
|
this.brokerIdList = brokerIdList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ControllerPreferredCandidateDTO{" +
|
||||||
|
"clusterId=" + clusterId +
|
||||||
|
", brokerIdList=" + brokerIdList +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,6 +40,9 @@ public class TopicCreationDTO extends ClusterTopicDTO {
|
|||||||
@ApiModelProperty(value = "Topic属性列表")
|
@ApiModelProperty(value = "Topic属性列表")
|
||||||
private Properties properties;
|
private Properties properties;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "最大写入字节数")
|
||||||
|
private Long peakBytesIn;
|
||||||
|
|
||||||
public String getAppId() {
|
public String getAppId() {
|
||||||
return appId;
|
return appId;
|
||||||
}
|
}
|
||||||
@@ -104,6 +107,14 @@ public class TopicCreationDTO extends ClusterTopicDTO {
|
|||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getPeakBytesIn() {
|
||||||
|
return peakBytesIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeakBytesIn(Long peakBytesIn) {
|
||||||
|
this.peakBytesIn = peakBytesIn;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TopicCreationDTO{" +
|
return "TopicCreationDTO{" +
|
||||||
|
|||||||
@@ -102,12 +102,11 @@ public class ClusterDTO {
|
|||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean legal() {
|
public boolean legal() {
|
||||||
if (ValidateUtils.isNull(clusterName)
|
if (ValidateUtils.isNull(clusterName)
|
||||||
|| ValidateUtils.isNull(zookeeper)
|
|| ValidateUtils.isNull(zookeeper)
|
||||||
|| ValidateUtils.isNull(idc)
|
|| ValidateUtils.isNull(idc)
|
||||||
|| ValidateUtils.isNull(bootstrapServers)
|
|| ValidateUtils.isNull(bootstrapServers)) {
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -81,11 +81,6 @@ public class OperateRecordDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean legal() {
|
public boolean legal() {
|
||||||
if (!ModuleEnum.validate(moduleId) ||
|
return !ValidateUtils.isNull(moduleId) && ModuleEnum.validate(moduleId) && OperateEnum.validate(operateId);
|
||||||
(!ValidateUtils.isNull(operateId) && OperateEnum.validate(operateId))
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.entity.pojo;
|
package com.xiaojukeji.kafka.manager.common.entity.pojo;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zengqiao
|
* @author zengqiao
|
||||||
@@ -116,4 +117,22 @@ public class ClusterDO implements Comparable<ClusterDO> {
|
|||||||
public int compareTo(ClusterDO clusterDO) {
|
public int compareTo(ClusterDO clusterDO) {
|
||||||
return this.id.compareTo(clusterDO.id);
|
return this.id.compareTo(clusterDO.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
ClusterDO clusterDO = (ClusterDO) o;
|
||||||
|
return Objects.equals(id, clusterDO.id)
|
||||||
|
&& Objects.equals(clusterName, clusterDO.clusterName)
|
||||||
|
&& Objects.equals(zookeeper, clusterDO.zookeeper)
|
||||||
|
&& Objects.equals(bootstrapServers, clusterDO.bootstrapServers)
|
||||||
|
&& Objects.equals(securityProperties, clusterDO.securityProperties)
|
||||||
|
&& Objects.equals(jmxProperties, clusterDO.jmxProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, clusterName, zookeeper, bootstrapServers, securityProperties, jmxProperties);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.entity.pojo;
|
package com.xiaojukeji.kafka.manager.common.entity.pojo;
|
||||||
|
|
||||||
import com.xiaojukeji.kafka.manager.common.entity.dto.op.topic.TopicCreationDTO;
|
import com.xiaojukeji.kafka.manager.common.entity.dto.op.topic.TopicCreationDTO;
|
||||||
|
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ public class TopicDO {
|
|||||||
topicDO.setClusterId(dto.getClusterId());
|
topicDO.setClusterId(dto.getClusterId());
|
||||||
topicDO.setTopicName(dto.getTopicName());
|
topicDO.setTopicName(dto.getTopicName());
|
||||||
topicDO.setDescription(dto.getDescription());
|
topicDO.setDescription(dto.getDescription());
|
||||||
|
topicDO.setPeakBytesIn(ValidateUtils.isNull(dto.getPeakBytesIn()) ? -1L : dto.getPeakBytesIn());
|
||||||
return topicDO;
|
return topicDO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,8 @@ public class GatewayConfigDO {
|
|||||||
|
|
||||||
private Long version;
|
private Long version;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private Date modifyTime;
|
private Date modifyTime;
|
||||||
@@ -61,6 +63,14 @@ public class GatewayConfigDO {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getCreateTime() {
|
public Date getCreateTime() {
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
@@ -85,6 +95,7 @@ public class GatewayConfigDO {
|
|||||||
", name='" + name + '\'' +
|
", name='" + name + '\'' +
|
||||||
", value='" + value + '\'' +
|
", value='" + value + '\'' +
|
||||||
", version=" + version +
|
", version=" + version +
|
||||||
|
", description='" + description + '\'' +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", modifyTime=" + modifyTime +
|
", modifyTime=" + modifyTime +
|
||||||
'}';
|
'}';
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class BrokerOverviewVO {
|
|||||||
@ApiModelProperty(value = "分区数")
|
@ApiModelProperty(value = "分区数")
|
||||||
private Integer partitionCount;
|
private Integer partitionCount;
|
||||||
|
|
||||||
@ApiModelProperty(value = "已同步副本数")
|
@ApiModelProperty(value = "失效副本分区的个数")
|
||||||
private Integer underReplicatedPartitions;
|
private Integer underReplicatedPartitions;
|
||||||
|
|
||||||
@ApiModelProperty(value = "未同步")
|
@ApiModelProperty(value = "未同步")
|
||||||
|
|||||||
@@ -27,8 +27,11 @@ public class OrderVO {
|
|||||||
@ApiModelProperty(value = "工单状态, 0:待审批, 1:通过, 2:拒绝, 3:取消")
|
@ApiModelProperty(value = "工单状态, 0:待审批, 1:通过, 2:拒绝, 3:取消")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@ApiModelProperty(value = "申请/审核时间")
|
@ApiModelProperty(value = "申请时间")
|
||||||
private Date gmtTime;
|
private Date gmtCreate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "审核时间")
|
||||||
|
private Date gmtHandle;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
@@ -70,12 +73,20 @@ public class OrderVO {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getGmtTime() {
|
public Date getGmtCreate() {
|
||||||
return gmtTime;
|
return gmtCreate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGmtTime(Date gmtTime) {
|
public void setGmtCreate(Date gmtCreate) {
|
||||||
this.gmtTime = gmtTime;
|
this.gmtCreate = gmtCreate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getGmtHandle() {
|
||||||
|
return gmtHandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGmtHandle(Date gmtHandle) {
|
||||||
|
this.gmtHandle = gmtHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getApplicant() {
|
public String getApplicant() {
|
||||||
@@ -95,7 +106,7 @@ public class OrderVO {
|
|||||||
", applicant='" + applicant + '\'' +
|
", applicant='" + applicant + '\'' +
|
||||||
", description='" + description + '\'' +
|
", description='" + description + '\'' +
|
||||||
", status=" + status +
|
", status=" + status +
|
||||||
", gmtTime=" + gmtTime +
|
", gmtTime=" + gmtCreate +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public class TopicBasicVO {
|
|||||||
@ApiModelProperty(value = "存储时间(ms)")
|
@ApiModelProperty(value = "存储时间(ms)")
|
||||||
private Long retentionTime;
|
private Long retentionTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单分区数据保存大小(Byte)")
|
||||||
|
private Long retentionBytes;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Long createTime;
|
private Long createTime;
|
||||||
|
|
||||||
@@ -62,12 +65,20 @@ public class TopicBasicVO {
|
|||||||
this.clusterId = clusterId;
|
this.clusterId = clusterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTopicCodeC() {
|
public String getAppId() {
|
||||||
return topicCodeC;
|
return appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTopicCodeC(String topicCodeC) {
|
public void setAppId(String appId) {
|
||||||
this.topicCodeC = topicCodeC;
|
this.appId = appId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppName() {
|
||||||
|
return appName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppName(String appName) {
|
||||||
|
this.appName = appName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPartitionNum() {
|
public Integer getPartitionNum() {
|
||||||
@@ -86,22 +97,6 @@ public class TopicBasicVO {
|
|||||||
this.replicaNum = replicaNum;
|
this.replicaNum = replicaNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getModifyTime() {
|
|
||||||
return modifyTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModifyTime(Long modifyTime) {
|
|
||||||
this.modifyTime = modifyTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Long createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrincipals() {
|
public String getPrincipals() {
|
||||||
return principals;
|
return principals;
|
||||||
}
|
}
|
||||||
@@ -110,30 +105,6 @@ public class TopicBasicVO {
|
|||||||
this.principals = principals;
|
this.principals = principals;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppId(String appId) {
|
|
||||||
this.appId = appId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBootstrapServers(String bootstrapServers) {
|
|
||||||
this.bootstrapServers = bootstrapServers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAppId() {
|
|
||||||
return appId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBootstrapServers() {
|
|
||||||
return bootstrapServers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getRetentionTime() {
|
public Long getRetentionTime() {
|
||||||
return retentionTime;
|
return retentionTime;
|
||||||
}
|
}
|
||||||
@@ -142,12 +113,28 @@ public class TopicBasicVO {
|
|||||||
this.retentionTime = retentionTime;
|
this.retentionTime = retentionTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAppName() {
|
public Long getRetentionBytes() {
|
||||||
return appName;
|
return retentionBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAppName(String appName) {
|
public void setRetentionBytes(Long retentionBytes) {
|
||||||
this.appName = appName;
|
this.retentionBytes = retentionBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Long createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getModifyTime() {
|
||||||
|
return modifyTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModifyTime(Long modifyTime) {
|
||||||
|
this.modifyTime = modifyTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getScore() {
|
public Integer getScore() {
|
||||||
@@ -158,6 +145,30 @@ public class TopicBasicVO {
|
|||||||
this.score = score;
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTopicCodeC() {
|
||||||
|
return topicCodeC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTopicCodeC(String topicCodeC) {
|
||||||
|
this.topicCodeC = topicCodeC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBootstrapServers() {
|
||||||
|
return bootstrapServers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBootstrapServers(String bootstrapServers) {
|
||||||
|
this.bootstrapServers = bootstrapServers;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getRegionNameList() {
|
public List<String> getRegionNameList() {
|
||||||
return regionNameList;
|
return regionNameList;
|
||||||
}
|
}
|
||||||
@@ -176,6 +187,7 @@ public class TopicBasicVO {
|
|||||||
", replicaNum=" + replicaNum +
|
", replicaNum=" + replicaNum +
|
||||||
", principals='" + principals + '\'' +
|
", principals='" + principals + '\'' +
|
||||||
", retentionTime=" + retentionTime +
|
", retentionTime=" + retentionTime +
|
||||||
|
", retentionBytes=" + retentionBytes +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", modifyTime=" + modifyTime +
|
", modifyTime=" + modifyTime +
|
||||||
", score=" + score +
|
", score=" + score +
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class TopicMineVO {
|
|||||||
@ApiModelProperty(value = "状态, 0:无权限, 1:可消费 2:可发送 3:可消费发送 4:可管理")
|
@ApiModelProperty(value = "状态, 0:无权限, 1:可消费 2:可发送 3:可消费发送 4:可管理")
|
||||||
private Integer access;
|
private Integer access;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String description;
|
||||||
|
|
||||||
public Long getClusterId() {
|
public Long getClusterId() {
|
||||||
return clusterId;
|
return clusterId;
|
||||||
}
|
}
|
||||||
@@ -108,6 +111,14 @@ public class TopicMineVO {
|
|||||||
this.access = access;
|
this.access = access;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TopicMineVO{" +
|
return "TopicMineVO{" +
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiaojukeji.kafka.manager.openapi.common.vo;
|
package com.xiaojukeji.kafka.manager.common.entity.vo.normal.topic;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -14,7 +14,6 @@ public class TopicStatisticMetricsVO {
|
|||||||
|
|
||||||
public TopicStatisticMetricsVO(Double peakBytesIn) {
|
public TopicStatisticMetricsVO(Double peakBytesIn) {
|
||||||
this.peakBytesIn = peakBytesIn;
|
this.peakBytesIn = peakBytesIn;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getPeakBytesIn() {
|
public Double getPeakBytesIn() {
|
||||||
@@ -28,7 +28,7 @@ public class ExpiredTopicVO {
|
|||||||
@ApiModelProperty(value = "负责人")
|
@ApiModelProperty(value = "负责人")
|
||||||
private String principals;
|
private String principals;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态, -1:可下线, 0:过期待通知, 1+:已通知待反馈")
|
@ApiModelProperty(value = "状态, -1:已通知可下线, 0:过期待通知, 1+:已通知待反馈")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
public Long getClusterId() {
|
public Long getClusterId() {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ public class GatewayConfigVO {
|
|||||||
@ApiModelProperty(value="版本")
|
@ApiModelProperty(value="版本")
|
||||||
private Long version;
|
private Long version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="描述说明")
|
||||||
|
private String description;
|
||||||
|
|
||||||
@ApiModelProperty(value="创建时间")
|
@ApiModelProperty(value="创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
@@ -72,6 +75,14 @@ public class GatewayConfigVO {
|
|||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
public Date getCreateTime() {
|
public Date getCreateTime() {
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
@@ -96,6 +107,7 @@ public class GatewayConfigVO {
|
|||||||
", name='" + name + '\'' +
|
", name='" + name + '\'' +
|
||||||
", value='" + value + '\'' +
|
", value='" + value + '\'' +
|
||||||
", version=" + version +
|
", version=" + version +
|
||||||
|
", description='" + description + '\'' +
|
||||||
", createTime=" + createTime +
|
", createTime=" + createTime +
|
||||||
", modifyTime=" + modifyTime +
|
", modifyTime=" + modifyTime +
|
||||||
'}';
|
'}';
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.xiaojukeji.kafka.manager.common.utils;
|
||||||
|
|
||||||
|
public class BackoffUtils {
|
||||||
|
private BackoffUtils() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void backoff(long timeUnitMs) {
|
||||||
|
if (timeUnitMs <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(timeUnitMs);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,13 @@ public class JsonUtils {
|
|||||||
return JSON.parseObject(src, clazz);
|
return JSON.parseObject(src, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> List<T> stringToArrObj(String src, Class<T> clazz) {
|
||||||
|
if (ValidateUtils.isBlank(src)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return JSON.parseArray(src, clazz);
|
||||||
|
}
|
||||||
|
|
||||||
public static List<TopicConnectionDO> parseTopicConnections(Long clusterId, JSONObject jsonObject, long postTime) {
|
public static List<TopicConnectionDO> parseTopicConnections(Long clusterId, JSONObject jsonObject, long postTime) {
|
||||||
List<TopicConnectionDO> connectionDOList = new ArrayList<>();
|
List<TopicConnectionDO> connectionDOList = new ArrayList<>();
|
||||||
for (String clientType: jsonObject.keySet()) {
|
for (String clientType: jsonObject.keySet()) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.xiaojukeji.kafka.manager.common.utils;
|
|||||||
|
|
||||||
import com.xiaojukeji.kafka.manager.common.constant.Constant;
|
import com.xiaojukeji.kafka.manager.common.constant.Constant;
|
||||||
import com.xiaojukeji.kafka.manager.common.constant.LoginConstant;
|
import com.xiaojukeji.kafka.manager.common.constant.LoginConstant;
|
||||||
|
import com.xiaojukeji.kafka.manager.common.constant.TrickLoginConstant;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
@@ -53,13 +54,6 @@ public class SpringTool implements ApplicationContextAware, DisposableBean {
|
|||||||
return getApplicationContext().getBeansOfType(type);
|
return getApplicationContext().getBeansOfType(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 从静态变量applicationContext中去的Bean,自动转型为所复制对象的类型
|
|
||||||
// */
|
|
||||||
// public static <T> T getBean(Class<T> requiredType) {
|
|
||||||
// return (T) applicationContext.getBean(requiredType);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除SpringContextHolder中的ApplicationContext为Null
|
* 清除SpringContextHolder中的ApplicationContext为Null
|
||||||
*/
|
*/
|
||||||
@@ -87,10 +81,18 @@ public class SpringTool implements ApplicationContextAware, DisposableBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getUserName(){
|
public static String getUserName(){
|
||||||
HttpServletRequest request =
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
||||||
HttpSession session = request.getSession();
|
String username = null;
|
||||||
String username = (String) session.getAttribute(LoginConstant.SESSION_USERNAME_KEY);
|
if (TrickLoginConstant.TRICK_LOGIN_SWITCH_ON.equals(request.getHeader(TrickLoginConstant.TRICK_LOGIN_SWITCH))) {
|
||||||
|
// trick登录方式的获取用户
|
||||||
|
username = request.getHeader(TrickLoginConstant.TRICK_LOGIN_USER);
|
||||||
|
} else {
|
||||||
|
// 走页面登录方式登录的获取用户
|
||||||
|
HttpSession session = request.getSession();
|
||||||
|
username = (String) session.getAttribute(LoginConstant.SESSION_USERNAME_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
if (ValidateUtils.isNull(username)) {
|
if (ValidateUtils.isNull(username)) {
|
||||||
return Constant.DEFAULT_USER_NAME;
|
return Constant.DEFAULT_USER_NAME;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.utils.factory;
|
package com.xiaojukeji.kafka.manager.common.utils.factory;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO;
|
import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO;
|
||||||
|
import com.xiaojukeji.kafka.manager.common.utils.JsonUtils;
|
||||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||||
import org.apache.commons.pool2.BasePooledObjectFactory;
|
import org.apache.commons.pool2.BasePooledObjectFactory;
|
||||||
import org.apache.commons.pool2.PooledObject;
|
import org.apache.commons.pool2.PooledObject;
|
||||||
@@ -16,7 +16,7 @@ import java.util.Properties;
|
|||||||
* @author zengqiao
|
* @author zengqiao
|
||||||
* @date 20/8/24
|
* @date 20/8/24
|
||||||
*/
|
*/
|
||||||
public class KafkaConsumerFactory extends BasePooledObjectFactory<KafkaConsumer> {
|
public class KafkaConsumerFactory extends BasePooledObjectFactory<KafkaConsumer<String, String>> {
|
||||||
private ClusterDO clusterDO;
|
private ClusterDO clusterDO;
|
||||||
|
|
||||||
public KafkaConsumerFactory(ClusterDO clusterDO) {
|
public KafkaConsumerFactory(ClusterDO clusterDO) {
|
||||||
@@ -25,17 +25,17 @@ public class KafkaConsumerFactory extends BasePooledObjectFactory<KafkaConsumer>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KafkaConsumer create() {
|
public KafkaConsumer create() {
|
||||||
return new KafkaConsumer(createKafkaConsumerProperties(clusterDO));
|
return new KafkaConsumer<String, String>(createKafkaConsumerProperties(clusterDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PooledObject<KafkaConsumer> wrap(KafkaConsumer obj) {
|
public PooledObject<KafkaConsumer<String, String>> wrap(KafkaConsumer<String, String> obj) {
|
||||||
return new DefaultPooledObject<KafkaConsumer>(obj);
|
return new DefaultPooledObject<>(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroyObject(final PooledObject<KafkaConsumer> p) throws Exception {
|
public void destroyObject(final PooledObject<KafkaConsumer<String, String>> p) throws Exception {
|
||||||
KafkaConsumer kafkaConsumer = p.getObject();
|
KafkaConsumer<String, String> kafkaConsumer = p.getObject();
|
||||||
if (ValidateUtils.isNull(kafkaConsumer)) {
|
if (ValidateUtils.isNull(kafkaConsumer)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ public class KafkaConsumerFactory extends BasePooledObjectFactory<KafkaConsumer>
|
|||||||
if (ValidateUtils.isBlank(clusterDO.getSecurityProperties())) {
|
if (ValidateUtils.isBlank(clusterDO.getSecurityProperties())) {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
properties.putAll(JSONObject.parseObject(clusterDO.getSecurityProperties(), Properties.class));
|
properties.putAll(JsonUtils.stringToObj(clusterDO.getSecurityProperties(), Properties.class));
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.utils.jmx;
|
package com.xiaojukeji.kafka.manager.common.utils.jmx;
|
||||||
|
|
||||||
|
import com.xiaojukeji.kafka.manager.common.utils.BackoffUtils;
|
||||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -79,7 +80,8 @@ public class JmxConnectorWrap {
|
|||||||
try {
|
try {
|
||||||
Map<String, Object> environment = new HashMap<String, Object>();
|
Map<String, Object> environment = new HashMap<String, Object>();
|
||||||
if (!ValidateUtils.isBlank(this.jmxConfig.getUsername()) && !ValidateUtils.isBlank(this.jmxConfig.getPassword())) {
|
if (!ValidateUtils.isBlank(this.jmxConfig.getUsername()) && !ValidateUtils.isBlank(this.jmxConfig.getPassword())) {
|
||||||
environment.put(javax.management.remote.JMXConnector.CREDENTIALS, Arrays.asList(this.jmxConfig.getUsername(), this.jmxConfig.getPassword()));
|
// fixed by riyuetianmu
|
||||||
|
environment.put(JMXConnector.CREDENTIALS, new String[]{this.jmxConfig.getUsername(), this.jmxConfig.getPassword()});
|
||||||
}
|
}
|
||||||
if (jmxConfig.isOpenSSL() != null && this.jmxConfig.isOpenSSL()) {
|
if (jmxConfig.isOpenSSL() != null && this.jmxConfig.isOpenSSL()) {
|
||||||
environment.put(Context.SECURITY_PROTOCOL, "ssl");
|
environment.put(Context.SECURITY_PROTOCOL, "ssl");
|
||||||
@@ -145,18 +147,16 @@ public class JmxConnectorWrap {
|
|||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
if (System.currentTimeMillis() - now > 60000) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
int num = atomicInteger.get();
|
int num = atomicInteger.get();
|
||||||
if (num <= 0) {
|
if (num <= 0) {
|
||||||
Thread.sleep(2);
|
BackoffUtils.backoff(2);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (atomicInteger.compareAndSet(num, num - 1)) {
|
|
||||||
|
if (atomicInteger.compareAndSet(num, num - 1) || System.currentTimeMillis() - now > 6000) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ public class ZkPathUtil {
|
|||||||
|
|
||||||
private static final String D_METRICS_CONFIG_ROOT_NODE = CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + "KafkaExMetrics";
|
private static final String D_METRICS_CONFIG_ROOT_NODE = CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + "KafkaExMetrics";
|
||||||
|
|
||||||
public static final String D_CONTROLLER_CANDIDATES = CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + "extension/candidates";
|
public static final String D_CONFIG_EXTENSION_ROOT_NODE = CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + "extension";
|
||||||
|
|
||||||
|
public static final String D_CONTROLLER_CANDIDATES = D_CONFIG_EXTENSION_ROOT_NODE + ZOOKEEPER_SEPARATOR + "candidates";
|
||||||
|
|
||||||
public static String getBrokerIdNodePath(Integer brokerId) {
|
public static String getBrokerIdNodePath(Integer brokerId) {
|
||||||
return BROKER_IDS_ROOT + ZOOKEEPER_SEPARATOR + String.valueOf(brokerId);
|
return BROKER_IDS_ROOT + ZOOKEEPER_SEPARATOR + String.valueOf(brokerId);
|
||||||
@@ -111,6 +113,13 @@ public class ZkPathUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getKafkaExtraMetricsPath(Integer brokerId) {
|
public static String getKafkaExtraMetricsPath(Integer brokerId) {
|
||||||
return D_METRICS_CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + String.valueOf(brokerId);
|
return D_METRICS_CONFIG_ROOT_NODE + ZOOKEEPER_SEPARATOR + brokerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getControllerCandidatePath(Integer brokerId) {
|
||||||
|
return D_CONTROLLER_CANDIDATES + ZOOKEEPER_SEPARATOR + brokerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ZkPathUtil() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers;
|
package com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,12 +15,11 @@ import java.util.List;
|
|||||||
* "host":null,
|
* "host":null,
|
||||||
* "timestamp":"1546632983233",
|
* "timestamp":"1546632983233",
|
||||||
* "port":-1,
|
* "port":-1,
|
||||||
* "version":4
|
* "version":4,
|
||||||
|
* "rack": "CY"
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
public class BrokerMetadata implements Cloneable {
|
public class BrokerMetadata implements Cloneable {
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(TopicMetadata.class);
|
|
||||||
|
|
||||||
private long clusterId;
|
private long clusterId;
|
||||||
|
|
||||||
private int brokerId;
|
private int brokerId;
|
||||||
@@ -43,6 +39,8 @@ public class BrokerMetadata implements Cloneable {
|
|||||||
|
|
||||||
private long timestamp;
|
private long timestamp;
|
||||||
|
|
||||||
|
private String rack;
|
||||||
|
|
||||||
public long getClusterId() {
|
public long getClusterId() {
|
||||||
return clusterId;
|
return clusterId;
|
||||||
}
|
}
|
||||||
@@ -107,14 +105,12 @@ public class BrokerMetadata implements Cloneable {
|
|||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String getRack() {
|
||||||
public Object clone() {
|
return rack;
|
||||||
try {
|
}
|
||||||
return super.clone();
|
|
||||||
} catch (CloneNotSupportedException var3) {
|
public void setRack(String rack) {
|
||||||
LOGGER.error("clone BrokerMetadata failed.", var3);
|
this.rack = rack;
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -128,6 +124,7 @@ public class BrokerMetadata implements Cloneable {
|
|||||||
", jmxPort=" + jmx_port +
|
", jmxPort=" + jmx_port +
|
||||||
", version='" + version + '\'' +
|
", version='" + version + '\'' +
|
||||||
", timestamp=" + timestamp +
|
", timestamp=" + timestamp +
|
||||||
|
", rack='" + rack + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "mobx-ts-example",
|
"name": "logi-kafka",
|
||||||
"version": "1.0.0",
|
"version": "2.5.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack-dev-server",
|
"start": "webpack-dev-server",
|
||||||
"daily-build": "cross-env NODE_ENV=production webpack",
|
"daily-build": "cross-env NODE_ENV=production webpack",
|
||||||
"pre-build": "cross-env NODE_ENV=production webpack",
|
"pre-build": "cross-env NODE_ENV=production webpack",
|
||||||
"prod-build": "cross-env NODE_ENV=production webpack"
|
"prod-build": "cross-env NODE_ENV=production webpack",
|
||||||
|
"fix-memory": "cross-env LIMIT=4096 increase-memory-limit"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@hot-loader/react-dom": "^16.8.6",
|
"@hot-loader/react-dom": "^16.8.6",
|
||||||
"@types/clipboard": "^2.0.1",
|
|
||||||
"@types/echarts": "^4.4.1",
|
"@types/echarts": "^4.4.1",
|
||||||
"@types/lodash.debounce": "^4.0.6",
|
"@types/lodash.debounce": "^4.0.6",
|
||||||
"@types/react": "^16.8.8",
|
"@types/react": "^16.8.8",
|
||||||
@@ -21,12 +21,13 @@
|
|||||||
"@types/spark-md5": "^3.0.2",
|
"@types/spark-md5": "^3.0.2",
|
||||||
"antd": "^3.26.15",
|
"antd": "^3.26.15",
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
"clipboard": "^2.0.6",
|
"clipboard": "^2.0.8",
|
||||||
"cross-env": "^7.0.2",
|
"cross-env": "^7.0.2",
|
||||||
"css-loader": "^2.1.0",
|
"css-loader": "^2.1.0",
|
||||||
"echarts": "^4.5.0",
|
"echarts": "^4.5.0",
|
||||||
"file-loader": "^5.0.2",
|
"file-loader": "^5.0.2",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
|
"increase-memory-limit": "^1.0.7",
|
||||||
"less": "^3.9.0",
|
"less": "^3.9.0",
|
||||||
"less-loader": "^4.1.0",
|
"less-loader": "^4.1.0",
|
||||||
"mini-css-extract-plugin": "^0.6.0",
|
"mini-css-extract-plugin": "^0.6.0",
|
||||||
|
|||||||
BIN
kafka-manager-console/src/assets/image/weChat.png
Normal file
BIN
kafka-manager-console/src/assets/image/weChat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user