diff --git a/build.sh b/build.sh index da5d20ef..03b1087e 100644 --- a/build.sh +++ b/build.sh @@ -4,8 +4,9 @@ cd $workspace ## constant OUTPUT_DIR=./output -KM_VERSION=2.1.0 -APP_NAME=kafka-manager-$KM_VERSION +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 @@ -28,15 +29,15 @@ function build() { function make_output() { # 新建output目录 rm -rf ${OUTPUT_DIR} &>/dev/null - mkdir -p ${OUTPUT_DIR}/${APP_NAME} &>/dev/null + mkdir -p ${OUTPUT_DIR}/${APP_DIR} &>/dev/null # 填充output目录, output内的内容 ( - cp -rf ${MYSQL_TABLE_SQL_FILE} ${OUTPUT_DIR}/${APP_NAME} && # 拷贝 sql 初始化脚本 至output目录 - cp -rf ${CONFIG_FILE} ${OUTPUT_DIR}/${APP_NAME} && # 拷贝 application.yml 至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_NAME}/${APP_NAME}-SNAPSHOT.jar + 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 } @@ -44,7 +45,7 @@ function make_output() { function make_package() { # 压缩output目录 ( - cd ${OUTPUT_DIR} && tar cvzf ${APP_NAME}.tar.gz ${APP_NAME} + 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 } diff --git a/docs/assets/images/common/Logi Kafka Manager架构图.png b/docs/assets/images/common/Logi Kafka Manager架构图.png deleted file mode 100644 index 15932909..00000000 Binary files a/docs/assets/images/common/Logi Kafka Manager架构图.png and /dev/null differ diff --git a/docs/dev_guide/upgrade_manual/logi-km-v2.2.0.md b/docs/dev_guide/upgrade_manual/logi-km-v2.2.0.md new file mode 100644 index 00000000..96622080 --- /dev/null +++ b/docs/dev_guide/upgrade_manual/logi-km-v2.2.0.md @@ -0,0 +1,27 @@ + +--- + +![kafka-manager-logo](../../assets/images/common/logo_name.png) + +**一站式`Apache Kafka`集群指标监控与运维管控平台** + +--- + +# 升级至`2.2.0`版本 + +`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); +``` + diff --git a/docs/install_guide/create_mysql_table.sql b/docs/install_guide/create_mysql_table.sql index 528838ee..2a015de1 100644 --- a/docs/install_guide/create_mysql_table.sql +++ b/docs/install_guide/create_mysql_table.sql @@ -1,3 +1,8 @@ +-- create database +CREATE DATABASE logi_kafka_manager; + +USE logi_kafka_manager; + -- -- Table structure for table `account` -- @@ -104,7 +109,8 @@ CREATE TABLE `cluster` ( `zookeeper` varchar(512) NOT NULL DEFAULT '' COMMENT 'zk地址', `bootstrap_servers` varchar(512) NOT NULL DEFAULT '' COMMENT 'server地址', `kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'kafka版本', - `security_properties` text COMMENT '安全认证参数', + `security_properties` text COMMENT 'Kafka安全认证参数', + `jmx_properties` text COMMENT 'JMX配置', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT ' 监控标记, 0表示未监控, 1表示监控中', `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', @@ -302,20 +308,22 @@ INSERT INTO kafka_user(app_id, password, user_type, operation) VALUES ('dkm_admi -- Table structure for table `logical_cluster` -- --- DROP TABLE IF EXISTS `logical_cluster`; CREATE TABLE `logical_cluster` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `name` varchar(192) NOT NULL DEFAULT '' COMMENT '逻辑集群名称', - `mode` int(16) NOT NULL DEFAULT '0' COMMENT '逻辑集群类型, 0:共享集群, 1:独享集群, 2:独立集群', - `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '所属应用', - `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id', - `region_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'regionid列表', - `description` text COMMENT '备注说明', - `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - PRIMARY KEY (`id`), - UNIQUE KEY `uniq_name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='逻辑集群信息表'; + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `name` varchar(192) NOT NULL DEFAULT '' COMMENT '逻辑集群名称', + `identification` varchar(192) NOT NULL DEFAULT '' COMMENT '逻辑集群标识', + `mode` int(16) NOT NULL DEFAULT '0' COMMENT '逻辑集群类型, 0:共享集群, 1:独享集群, 2:独立集群', + `app_id` varchar(64) NOT NULL DEFAULT '' COMMENT '所属应用', + `cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群id', + `region_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'regionid列表', + `description` text COMMENT '备注说明', + `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `gmt_modify` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uniq_name` (`name`), + UNIQUE KEY `uniq_identification` (`identification`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='逻辑集群信息表'; + -- -- Table structure for table `monitor_rule` diff --git a/docs/install_guide/install_guide_cn.md b/docs/install_guide/install_guide_cn.md index 9c700587..9a4a415b 100644 --- a/docs/install_guide/install_guide_cn.md +++ b/docs/install_guide/install_guide_cn.md @@ -9,19 +9,39 @@ # 安装手册 +## 1、环境依赖 -## 环境依赖 +如果是以Release包进行安装的,则仅安装`Java`及`MySQL`即可。如果是要先进行源码包进行打包,然后再使用,则需要安装`Maven`及`Node`环境。 -- `Maven 3.5+`(后端打包依赖) -- `node v12+`(前端打包依赖) - `Java 8+`(运行环境需要) - `MySQL 5.7`(数据存储) +- `Maven 3.5+`(后端打包依赖) +- `Node 10+`(前端打包依赖) --- -## 环境初始化 +## 2、获取安装包 -执行[create_mysql_table.sql](create_mysql_table.sql)中的SQL命令,从而创建所需的MySQL库及表,默认创建的库名是`kafka_manager`。 +**1、Release直接下载** + +这里如果觉得麻烦,然后也不想进行二次开发,则可以直接下载Release包,下载地址:[Github Release包下载地址](https://github.com/didi/Logi-KafkaManager/releases) + +如果觉得Github的下载地址太慢了,也可以进入`Logi-KafkaManager`的用户群获取,群地址在README中。 + + +**2、源代码进行打包** + +下载好代码之后,进入`Logi-KafkaManager`的主目录,执行`sh build.sh`命令即可,执行完成之后会在`output/kafka-manager-xxx`目录下面生成一个jar包。 + +对于`windows`环境的用户,估计执行不了`sh build.sh`命令,因此可以直接执行`mvn install`,然后在`kafka-manager-web/target`目录下生成一个kafka-manager-web-xxx.jar的包。 + +获取到jar包之后,我们继续下面的步骤。 + +--- + +## 3、MySQL-DB初始化 + +执行[create_mysql_table.sql](create_mysql_table.sql)中的SQL命令,从而创建所需的MySQL库及表,默认创建的库名是`logi_kafka_manager`。 ``` # 示例: @@ -30,29 +50,15 @@ mysql -uXXXX -pXXX -h XXX.XXX.XXX.XXX -PXXXX < ./create_mysql_table.sql --- -## 打包 - -```bash - -# 一次性打包 -cd .. -mvn install +## 4、启动 ``` +# application.yml 是配置文件,最简单的是仅修改MySQL相关的配置即可启动 ---- - -## 启动 - -``` -# application.yml 是配置文件 - -cp kafka-manager-web/src/main/resources/application.yml kafka-manager-web/target/ -cd kafka-manager-web/target/ -nohup java -jar kafka-manager-web-2.1.0-SNAPSHOT.jar --spring.config.location=./application.yml > /dev/null 2>&1 & +nohup java -jar kafka-manager.jar --spring.config.location=./application.yml > /dev/null 2>&1 & ``` -## 使用 +### 5、使用 本地启动的话,访问`http://localhost:8080`,输入帐号及密码(默认`admin/admin`)进行登录。更多参考:[kafka-manager 用户使用手册](../user_guide/user_guide_cn.md) diff --git a/docs/user_guide/alarm_rules.md b/docs/user_guide/alarm_rules.md new file mode 100644 index 00000000..f4356790 --- /dev/null +++ b/docs/user_guide/alarm_rules.md @@ -0,0 +1,25 @@ +![kafka-manager-logo](../assets/images/common/logo_name.png)) + +**一站式`Apache Kafka`集群指标监控与运维管控平台** + +--- + + +## 报警策略-报警函数介绍 + + + +| 类别 | 函数 | 含义 |函数文案 |备注 | +| --- | --- | --- | --- | --- | +| 发生次数 |all,n | 最近$n个周期内,全发生 | 连续发生(all) | | +| 发生次数 | happen, n, m | 最近$n个周期内,发生m次 | 出现(happen) | null点也计算在n内 | +| 数学统计 | sum, n | 最近$n个周期取值 的 和 | 求和(sum) | sum_over_time | +| 数学统计 | avg, n | 最近$n个周期取值 的 平均值 | 平均值(avg) | avg_over_time | +| 数学统计 | min, n | 最近$n个周期取值 的 最小值 | 最小值(min) | min_over_time | +| 数学统计 | max, n | 最近$n个周期取值 的 最大值 | 最大值(max | max_over_time | +| 变化率 | pdiff, n | 最近$n个点的变化率, 有一个满足 则触发 | 突增突降率(pdiff) | 假设, 最近3个周期的值分别为 v, v2, v3(v为最新值)那么计算公式为 any( (v-v2)/v2, (v-v3)/v3 )**区分正负** | +| 变化量 | diff, n | 最近$n个点的变化量, 有一个满足 则触发 | 突增突降值(diff) | 假设, 最近3个周期的值分别为 v, v2, v3(v为最新值)那么计算公式为 any( (v-v2), (v-v3) )**区分正负** | +| 变化量 | ndiff | 最近n个周期,发生m次 v(t) - v(t-1) $OP threshold其中 v(t) 为最新值 | 连续变化(区分正负) - ndiff | | +| 数据中断 | nodata, t | 最近 $t 秒内 无数据上报 | 数据上报中断(nodata) | | +| 同环比 | c_avg_rate_abs, n | 最近$n个周期的取值,相比 1天或7天前取值 的变化率 的绝对值 | 同比变化率(c_avg_rate_abs) | 假设最近的n个值为 v1, v2, v3历史取到的对应n'个值为 v1', v2'那么计算公式为abs((avg(v1,v2,v3) / avg(v1',v2') -1)* 100%) | +| 同环比 | c_avg_rate, n | 最近$n个周期的取值,相比 1天或7天前取值 的变化率(**区分正负**) | 同比变化率(c_avg_rate) | 假设最近的n个值为 v1, v2, v3历史取到的对应n'个值为 v1', v2'那么计算公式为(avg(v1,v2,v3) / avg(v1',v2') -1)* 100% | diff --git a/docs/user_guide/faq.md b/docs/user_guide/faq.md index ba46eb66..3980a96b 100644 --- a/docs/user_guide/faq.md +++ b/docs/user_guide/faq.md @@ -29,7 +29,7 @@ 主要用途是进行大集群的管理 & 集群细节的屏蔽。 - 逻辑集群:通过逻辑集群概念,将集群Broker按业务进行归类,方便管理; -- Region:通过引入Region,同时Topic按Region纬度创建,减少Broker间的连接; +- Region:通过引入Region,同时Topic按Region维度创建,减少Broker间的连接; --- diff --git a/kafka-manager-common/pom.xml b/kafka-manager-common/pom.xml index f310a81a..67fbcdbd 100644 --- a/kafka-manager-common/pom.xml +++ b/kafka-manager-common/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.xiaojukeji.kafka kafka-manager-common - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java index 86941d0e..a7525374 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/ao/cluster/LogicalCluster.java @@ -9,6 +9,8 @@ public class LogicalCluster { private String logicalClusterName; + private String logicalClusterIdentification; + private Integer mode; private Integer topicNum; @@ -41,6 +43,14 @@ public class LogicalCluster { this.logicalClusterName = logicalClusterName; } + public String getLogicalClusterIdentification() { + return logicalClusterIdentification; + } + + public void setLogicalClusterIdentification(String logicalClusterIdentification) { + this.logicalClusterIdentification = logicalClusterIdentification; + } + public Integer getMode() { return mode; } @@ -81,6 +91,14 @@ public class LogicalCluster { this.bootstrapServers = bootstrapServers; } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + public Long getGmtCreate() { return gmtCreate; } @@ -97,19 +115,12 @@ public class LogicalCluster { this.gmtModify = gmtModify; } - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Override public String toString() { return "LogicalCluster{" + "logicalClusterId=" + logicalClusterId + ", logicalClusterName='" + logicalClusterName + '\'' + + ", logicalClusterIdentification='" + logicalClusterIdentification + '\'' + ", mode=" + mode + ", topicNum=" + topicNum + ", clusterVersion='" + clusterVersion + '\'' + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java index c28bc8b6..0b6fcebb 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/ClusterDTO.java @@ -27,9 +27,12 @@ public class ClusterDTO { @ApiModelProperty(value="数据中心") private String idc; - @ApiModelProperty(value="安全配置参数") + @ApiModelProperty(value="Kafka安全配置") private String securityProperties; + @ApiModelProperty(value="Jmx配置") + private String jmxProperties; + public Long getClusterId() { return clusterId; } @@ -78,6 +81,14 @@ public class ClusterDTO { this.securityProperties = securityProperties; } + public String getJmxProperties() { + return jmxProperties; + } + + public void setJmxProperties(String jmxProperties) { + this.jmxProperties = jmxProperties; + } + @Override public String toString() { return "ClusterDTO{" + @@ -87,6 +98,7 @@ public class ClusterDTO { ", bootstrapServers='" + bootstrapServers + '\'' + ", idc='" + idc + '\'' + ", securityProperties='" + securityProperties + '\'' + + ", jmxProperties='" + jmxProperties + '\'' + '}'; } diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java index 790f9758..def22479 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/rd/LogicalClusterDTO.java @@ -21,6 +21,9 @@ public class LogicalClusterDTO { @ApiModelProperty(value = "名称") private String name; + @ApiModelProperty(value = "集群标识, 用于告警的上报") + private String identification; + @ApiModelProperty(value = "集群模式") private Integer mode; @@ -52,6 +55,14 @@ public class LogicalClusterDTO { this.name = name; } + public String getIdentification() { + return identification; + } + + public void setIdentification(String identification) { + this.identification = identification; + } + public Integer getMode() { return mode; } @@ -97,6 +108,7 @@ public class LogicalClusterDTO { return "LogicalClusterDTO{" + "id=" + id + ", name='" + name + '\'' + + ", identification='" + identification + '\'' + ", mode=" + mode + ", clusterId=" + clusterId + ", regionIdList=" + regionIdList + @@ -117,6 +129,7 @@ public class LogicalClusterDTO { } appId = ValidateUtils.isNull(appId)? "": appId; description = ValidateUtils.isNull(description)? "": description; + identification = ValidateUtils.isNull(identification)? name: identification; return true; } } \ No newline at end of file diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/ClusterDO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/ClusterDO.java index cefbc9f2..04ee265d 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/ClusterDO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/ClusterDO.java @@ -17,6 +17,8 @@ public class ClusterDO implements Comparable { private String securityProperties; + private String jmxProperties; + private Integer status; private Date gmtCreate; @@ -31,30 +33,6 @@ public class ClusterDO implements Comparable { this.id = id; } - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Date getGmtCreate() { - return gmtCreate; - } - - public void setGmtCreate(Date gmtCreate) { - this.gmtCreate = gmtCreate; - } - - public Date getGmtModify() { - return gmtModify; - } - - public void setGmtModify(Date gmtModify) { - this.gmtModify = gmtModify; - } - public String getClusterName() { return clusterName; } @@ -87,6 +65,38 @@ public class ClusterDO implements Comparable { this.securityProperties = securityProperties; } + public String getJmxProperties() { + return jmxProperties; + } + + public void setJmxProperties(String jmxProperties) { + this.jmxProperties = jmxProperties; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getGmtCreate() { + return gmtCreate; + } + + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + public Date getGmtModify() { + return gmtModify; + } + + public void setGmtModify(Date gmtModify) { + this.gmtModify = gmtModify; + } + @Override public String toString() { return "ClusterDO{" + @@ -95,6 +105,7 @@ public class ClusterDO implements Comparable { ", zookeeper='" + zookeeper + '\'' + ", bootstrapServers='" + bootstrapServers + '\'' + ", securityProperties='" + securityProperties + '\'' + + ", jmxProperties='" + jmxProperties + '\'' + ", status=" + status + ", gmtCreate=" + gmtCreate + ", gmtModify=" + gmtModify + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/LogicalClusterDO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/LogicalClusterDO.java index d5cb3497..db81c1c9 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/LogicalClusterDO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/LogicalClusterDO.java @@ -11,6 +11,8 @@ public class LogicalClusterDO { private String name; + private String identification; + private Integer mode; private String appId; @@ -41,6 +43,14 @@ public class LogicalClusterDO { this.name = name; } + public String getIdentification() { + return identification; + } + + public void setIdentification(String identification) { + this.identification = identification; + } + public Integer getMode() { return mode; } @@ -102,6 +112,7 @@ public class LogicalClusterDO { return "LogicalClusterDO{" + "id=" + id + ", name='" + name + '\'' + + ", identification='" + identification + '\'' + ", mode=" + mode + ", appId='" + appId + '\'' + ", clusterId=" + clusterId + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/normal/cluster/LogicClusterVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/normal/cluster/LogicClusterVO.java index c3c5f9c3..8fa5db9d 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/normal/cluster/LogicClusterVO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/normal/cluster/LogicClusterVO.java @@ -15,6 +15,9 @@ public class LogicClusterVO { @ApiModelProperty(value="逻辑集群名称") private String clusterName; + @ApiModelProperty(value="逻辑标识") + private String clusterIdentification; + @ApiModelProperty(value="逻辑集群类型, 0:共享集群, 1:独享集群, 2:独立集群") private Integer mode; @@ -24,9 +27,6 @@ public class LogicClusterVO { @ApiModelProperty(value="集群版本") private String clusterVersion; - @ApiModelProperty(value="物理集群ID") - private Long physicalClusterId; - @ApiModelProperty(value="集群服务地址") private String bootstrapServers; @@ -55,6 +55,22 @@ public class LogicClusterVO { this.clusterName = clusterName; } + public String getClusterIdentification() { + return clusterIdentification; + } + + public void setClusterIdentification(String clusterIdentification) { + this.clusterIdentification = clusterIdentification; + } + + public Integer getMode() { + return mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + public Integer getTopicNum() { return topicNum; } @@ -71,14 +87,6 @@ public class LogicClusterVO { this.clusterVersion = clusterVersion; } - public Long getPhysicalClusterId() { - return physicalClusterId; - } - - public void setPhysicalClusterId(Long physicalClusterId) { - this.physicalClusterId = physicalClusterId; - } - public String getBootstrapServers() { return bootstrapServers; } @@ -87,6 +95,14 @@ public class LogicClusterVO { this.bootstrapServers = bootstrapServers; } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + public Long getGmtCreate() { return gmtCreate; } @@ -103,32 +119,15 @@ public class LogicClusterVO { this.gmtModify = gmtModify; } - public Integer getMode() { - return mode; - } - - public void setMode(Integer mode) { - this.mode = mode; - } - - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - @Override public String toString() { return "LogicClusterVO{" + "clusterId=" + clusterId + ", clusterName='" + clusterName + '\'' + + ", clusterIdentification='" + clusterIdentification + '\'' + ", mode=" + mode + ", topicNum=" + topicNum + ", clusterVersion='" + clusterVersion + '\'' + - ", physicalClusterId=" + physicalClusterId + ", bootstrapServers='" + bootstrapServers + '\'' + ", description='" + description + '\'' + ", gmtCreate=" + gmtCreate + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/ClusterBaseVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/ClusterBaseVO.java index ca2b7350..111304f1 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/ClusterBaseVO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/ClusterBaseVO.java @@ -32,9 +32,12 @@ public class ClusterBaseVO { @ApiModelProperty(value="集群类型") private Integer mode; - @ApiModelProperty(value="安全配置参数") + @ApiModelProperty(value="Kafka安全配置") private String securityProperties; + @ApiModelProperty(value="Jmx配置") + private String jmxProperties; + @ApiModelProperty(value="1:监控中, 0:暂停监控") private Integer status; @@ -108,6 +111,14 @@ public class ClusterBaseVO { this.securityProperties = securityProperties; } + public String getJmxProperties() { + return jmxProperties; + } + + public void setJmxProperties(String jmxProperties) { + this.jmxProperties = jmxProperties; + } + public Integer getStatus() { return status; } @@ -141,8 +152,9 @@ public class ClusterBaseVO { ", bootstrapServers='" + bootstrapServers + '\'' + ", kafkaVersion='" + kafkaVersion + '\'' + ", idc='" + idc + '\'' + - ", mode='" + mode + '\'' + + ", mode=" + mode + ", securityProperties='" + securityProperties + '\'' + + ", jmxProperties='" + jmxProperties + '\'' + ", status=" + status + ", gmtCreate=" + gmtCreate + ", gmtModify=" + gmtModify + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/LogicalClusterVO.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/LogicalClusterVO.java index 86ced10f..61f9b90c 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/LogicalClusterVO.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/vo/rd/cluster/LogicalClusterVO.java @@ -18,6 +18,9 @@ public class LogicalClusterVO { @ApiModelProperty(value = "逻辑集群名称") private String logicalClusterName; + @ApiModelProperty(value = "逻辑集群标识") + private String logicalClusterIdentification; + @ApiModelProperty(value = "物理集群ID") private Long physicalClusterId; @@ -55,6 +58,14 @@ public class LogicalClusterVO { this.logicalClusterName = logicalClusterName; } + public String getLogicalClusterIdentification() { + return logicalClusterIdentification; + } + + public void setLogicalClusterIdentification(String logicalClusterIdentification) { + this.logicalClusterIdentification = logicalClusterIdentification; + } + public Long getPhysicalClusterId() { return physicalClusterId; } @@ -116,6 +127,7 @@ public class LogicalClusterVO { return "LogicalClusterVO{" + "logicalClusterId=" + logicalClusterId + ", logicalClusterName='" + logicalClusterName + '\'' + + ", logicalClusterIdentification='" + logicalClusterIdentification + '\'' + ", physicalClusterId=" + physicalClusterId + ", regionIdList=" + regionIdList + ", mode=" + mode + diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/JsonUtils.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/JsonUtils.java index d9724065..46d177ad 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/JsonUtils.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/JsonUtils.java @@ -53,6 +53,13 @@ public class JsonUtils { return JSON.toJSONString(obj); } + public static T stringToObj(String src, Class clazz) { + if (ValidateUtils.isBlank(src)) { + return null; + } + return JSON.parseObject(src, clazz); + } + public static List parseTopicConnections(Long clusterId, JSONObject jsonObject, long postTime) { List connectionDOList = new ArrayList<>(); for (String clientType: jsonObject.keySet()) { diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConfig.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConfig.java new file mode 100644 index 00000000..bbc913c4 --- /dev/null +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConfig.java @@ -0,0 +1,65 @@ +package com.xiaojukeji.kafka.manager.common.utils.jmx; + +public class JmxConfig { + /** + * 单台最大连接数 + */ + private Integer maxConn; + + /** + * 用户名 + */ + private String username; + + /** + * 密码 + */ + private String password; + + /** + * 开启SSL + */ + private Boolean openSSL; + + public Integer getMaxConn() { + return maxConn; + } + + public void setMaxConn(Integer maxConn) { + this.maxConn = maxConn; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Boolean isOpenSSL() { + return openSSL; + } + + public void setOpenSSL(Boolean openSSL) { + this.openSSL = openSSL; + } + + @Override + public String toString() { + return "JmxConfig{" + + "maxConn=" + maxConn + + ", username='" + username + '\'' + + ", password='" + password + '\'' + + ", openSSL=" + openSSL + + '}'; + } +} diff --git a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConnectorWrap.java b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConnectorWrap.java index ed8a639e..fc70c6b2 100644 --- a/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConnectorWrap.java +++ b/kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/utils/jmx/JmxConnectorWrap.java @@ -1,5 +1,6 @@ package com.xiaojukeji.kafka.manager.common.utils.jmx; +import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -7,8 +8,14 @@ import javax.management.*; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; +import javax.management.remote.rmi.RMIConnectorServer; +import javax.naming.Context; +import javax.rmi.ssl.SslRMIClientSocketFactory; import java.io.IOException; import java.net.MalformedURLException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; @@ -28,13 +35,19 @@ public class JmxConnectorWrap { private AtomicInteger atomicInteger; - public JmxConnectorWrap(String host, int port, int maxConn) { + private JmxConfig jmxConfig; + + public JmxConnectorWrap(String host, int port, JmxConfig jmxConfig) { this.host = host; this.port = port; - if (maxConn <= 0) { - maxConn = 1; + this.jmxConfig = jmxConfig; + if (ValidateUtils.isNull(this.jmxConfig)) { + this.jmxConfig = new JmxConfig(); } - this.atomicInteger = new AtomicInteger(maxConn); + if (ValidateUtils.isNullOrLessThanZero(this.jmxConfig.getMaxConn())) { + this.jmxConfig.setMaxConn(1); + } + this.atomicInteger = new AtomicInteger(this.jmxConfig.getMaxConn()); } public boolean checkJmxConnectionAndInitIfNeed() { @@ -64,8 +77,18 @@ public class JmxConnectorWrap { } String jmxUrl = String.format("service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi", host, port); try { - JMXServiceURL url = new JMXServiceURL(jmxUrl); - jmxConnector = JMXConnectorFactory.connect(url, null); + Map environment = new HashMap(); + 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())); + } + if (jmxConfig.isOpenSSL() != null && this.jmxConfig.isOpenSSL()) { + environment.put(Context.SECURITY_PROTOCOL, "ssl"); + SslRMIClientSocketFactory clientSocketFactory = new SslRMIClientSocketFactory(); + environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, clientSocketFactory); + environment.put("com.sun.jndi.rmi.factory.socket", clientSocketFactory); + } + + jmxConnector = JMXConnectorFactory.connect(new JMXServiceURL(jmxUrl), environment); LOGGER.info("JMX connect success, host:{} port:{}.", host, port); return true; } catch (MalformedURLException e) { diff --git a/kafka-manager-console/pom.xml b/kafka-manager-console/pom.xml index 2339dabd..02ee7e1c 100644 --- a/kafka-manager-console/pom.xml +++ b/kafka-manager-console/pom.xml @@ -8,7 +8,7 @@ kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-console/src/component/x-form/index.tsx b/kafka-manager-console/src/component/x-form/index.tsx index 20b7c421..9530f2bb 100755 --- a/kafka-manager-console/src/component/x-form/index.tsx +++ b/kafka-manager-console/src/component/x-form/index.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { Select, Input, InputNumber, Form, Switch, Checkbox, DatePicker, Radio, Upload, Button, Icon, Tooltip } from 'component/antd'; import Monacoeditor from 'component/editor/monacoEditor'; import { searchProps } from 'constants/table'; +import { version } from 'store/version'; import './index.less'; const TextArea = Input.TextArea; @@ -189,7 +190,7 @@ class XForm extends React.Component { case FormItemType.upload: return ( false} {...item.attrs}> - + {version.fileSuffix && {`请上传${version.fileSuffix}文件`}} ); } diff --git a/kafka-manager-console/src/constants/table.ts b/kafka-manager-console/src/constants/table.ts index 8a148407..3028e78d 100644 --- a/kafka-manager-console/src/constants/table.ts +++ b/kafka-manager-console/src/constants/table.ts @@ -19,7 +19,7 @@ export const cellStyle = { overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', - cursor: 'pointer', + // cursor: 'pointer', }; export const searchProps = { diff --git a/kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx b/kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx index dd0df49a..5605a372 100644 --- a/kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx +++ b/kafka-manager-console/src/container/admin/cluster-detail/cluster-consumer.tsx @@ -38,7 +38,7 @@ export class ClusterConsumer extends SearchAndFilterContainer { key: 'operation', width: '10%', render: (t: string, item: IOffset) => { - return ( this.getConsumeDetails(item)}>详情); + return ( this.getConsumeDetails(item)}>消费详情); }, }]; private xFormModal: IXFormWrapper; @@ -110,7 +110,7 @@ export class ClusterConsumer extends SearchAndFilterContainer { /> this.handleDetailsOk()} onCancel={() => this.handleDetailsCancel()} diff --git a/kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx b/kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx index 9aab6cf9..7b7aaae7 100644 --- a/kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx +++ b/kafka-manager-console/src/container/admin/cluster-detail/cluster-topic.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import Url from 'lib/url-parser'; import { region } from 'store'; import { admin } from 'store/admin'; -import { topic } from 'store/topic'; +import { app } from 'store/app'; import { Table, notification, Tooltip, Popconfirm } from 'antd'; import { pagination, cellStyle } from 'constants/table'; import { observer } from 'mobx-react'; @@ -56,8 +56,6 @@ export class ClusterTopic extends SearchAndFilterContainer { public expandPartition(item: IClusterTopics) { // getTopicBasicInfo admin.getTopicsBasicInfo(item.clusterId, item.topicName).then(data => { - console.log(admin.topicsBasic); - console.log(admin.basicInfo); this.clusterTopicsFrom = item; this.setState({ expandVisible: true, @@ -114,6 +112,7 @@ export class ClusterTopic extends SearchAndFilterContainer { public componentDidMount() { admin.getClusterTopics(this.clusterId); + app.getAdminAppList() } public renderClusterTopicList() { diff --git a/kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx b/kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx index 24b90c5e..6aaa2e78 100644 --- a/kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx +++ b/kafka-manager-console/src/container/admin/cluster-detail/exclusive-cluster.tsx @@ -159,7 +159,6 @@ export class ExclusiveCluster extends SearchAndFilterContainer { public handleDeleteRegion = (record: IBrokersRegions) => { const filterRegion = admin.logicalClusters.filter(item => item.regionIdList.includes(record.id)); - if (!filterRegion) { return; } @@ -335,6 +334,7 @@ export class ExclusiveCluster extends SearchAndFilterContainer { {this.renderSearch('', '请输入Region名称/broker ID')} {this.renderRegion()} + {this.renderDeleteRegionModal()} ); } diff --git a/kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx b/kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx index 93a58703..b0ae63f4 100644 --- a/kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx +++ b/kafka-manager-console/src/container/admin/cluster-detail/logical-cluster.tsx @@ -40,15 +40,15 @@ export class LogicalCluster extends SearchAndFilterContainer { key: 'logicalClusterId', }, { - title: '逻辑集群中文名称', + title: '逻辑集群名称', dataIndex: 'logicalClusterName', key: 'logicalClusterName', width: '150px' }, { - title: '逻辑集群英文名称', - dataIndex: 'logicalClusterName', - key: 'logicalClusterName1', + title: '逻辑集群标识', + dataIndex: 'logicalClusterIdentification', + key: 'logicalClusterIdentification', width: '150px' }, { diff --git a/kafka-manager-console/src/container/admin/cluster-list/index.tsx b/kafka-manager-console/src/container/admin/cluster-list/index.tsx index 97d6cb5d..63ccd93e 100644 --- a/kafka-manager-console/src/container/admin/cluster-list/index.tsx +++ b/kafka-manager-console/src/container/admin/cluster-list/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Modal, Table, Button, notification, message, Tooltip, Icon, Popconfirm, Alert } from 'component/antd'; +import { Modal, Table, Button, notification, message, Tooltip, Icon, Popconfirm, Alert, Popover } from 'component/antd'; import { wrapper } from 'store'; import { observer } from 'mobx-react'; import { IXFormWrapper, IMetaData, IRegister } from 'types/base-type'; @@ -58,7 +58,7 @@ export class ClusterList extends SearchAndFilterContainer { message: '请输入zookeeper地址', }], attrs: { - placeholder: '请输入zookeeper地址', + placeholder: '请输入zookeeper地址,例如:192.168.0.1:2181,192.168.0.2:2181/logi-kafka', rows: 2, disabled: item ? true : false, }, @@ -72,7 +72,7 @@ export class ClusterList extends SearchAndFilterContainer { message: '请输入bootstrapServers', }], attrs: { - placeholder: '请输入bootstrapServers', + placeholder: '请输入bootstrapServers,例如:192.168.1.1:9092,192.168.1.2:9092', rows: 2, disabled: item ? true : false, }, @@ -131,7 +131,7 @@ export class ClusterList extends SearchAndFilterContainer { { "security.protocol": "SASL_PLAINTEXT", "sasl.mechanism": "PLAIN", - "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"xxxxxx\" password=\"xxxxxx\";" + "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\\"xxxxxx\\" password=\\"xxxxxx\\";" }`, rows: 8, }, @@ -271,11 +271,13 @@ export class ClusterList extends SearchAndFilterContainer { cancelText="取消" okText="确认" > - - {item.status === 1 ? '暂停监控' : '开始监控'} - + + + {item.status === 1 ? '暂停监控' : '开始监控'} + + 删除 diff --git a/kafka-manager-console/src/container/admin/individual-bill.tsx b/kafka-manager-console/src/container/admin/individual-bill.tsx index ef43a616..8524b3de 100644 --- a/kafka-manager-console/src/container/admin/individual-bill.tsx +++ b/kafka-manager-console/src/container/admin/individual-bill.tsx @@ -79,7 +79,7 @@ export class IndividualBill extends React.Component { } public renderTableList() { - const adminUrl=`${urlPrefix}/admin/bill-detail` + const adminUrl = `${urlPrefix}/admin/bill-detail` return ( ); } - + public renderChart() { return (
- this.chart = ref } getChartData={this.getData.bind(this, null)} /> + this.chart = ref} getChartData={this.getData.bind(this, null)} />
); } @@ -132,7 +132,7 @@ export class IndividualBill extends React.Component { <>
- 账单趋势  - } + } key="1" > {this.renderDatePick()} diff --git a/kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx b/kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx index 50e9ce32..3e5dd0b7 100644 --- a/kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx +++ b/kafka-manager-console/src/container/alarm/add-alarm/filter-form.tsx @@ -11,6 +11,7 @@ import { filterKeys } from 'constants/strategy'; import { VirtualScrollSelect } from 'component/virtual-scroll-select'; import { IsNotNaN } from 'lib/utils'; import { searchProps } from 'constants/table'; +import { toJS } from 'mobx'; interface IDynamicProps { form?: any; @@ -33,6 +34,7 @@ export class DynamicSetFilter extends React.Component { public monitorType: string = null; public clusterId: number = null; public clusterName: string = null; + public clusterIdentification: string | number = null; public topicName: string = null; public consumerGroup: string = null; public location: string = null; @@ -45,16 +47,18 @@ export class DynamicSetFilter extends React.Component { this.props.form.validateFields((err: Error, values: any) => { if (!err) { monitorType = values.monitorType; - const index = cluster.clusterData.findIndex(item => item.clusterId === values.cluster); + const index = cluster.clusterData.findIndex(item => item.clusterIdentification === values.cluster); if (index > -1) { + values.clusterIdentification = cluster.clusterData[index].clusterIdentification; values.clusterName = cluster.clusterData[index].clusterName; } for (const key of Object.keys(values)) { if (filterKeys.indexOf(key) > -1) { // 只有这几种值可以设置 filterList.push({ - tkey: key === 'clusterName' ? 'cluster' : key, // 传参需要将clusterName转成cluster + tkey: key === 'clusterName' ? 'cluster' : key, // clusterIdentification topt: '=', tval: [values[key]], + clusterIdentification: values.clusterIdentification }); } } @@ -74,13 +78,13 @@ export class DynamicSetFilter extends React.Component { public resetFormValue( monitorType: string = null, - clusterId: number = null, + clusterIdentification: any = null, topicName: string = null, consumerGroup: string = null, location: string = null) { const { setFieldsValue } = this.props.form; setFieldsValue({ - cluster: clusterId, + cluster: clusterIdentification, topic: topicName, consumerGroup, location, @@ -88,18 +92,18 @@ export class DynamicSetFilter extends React.Component { }); } - public getClusterId = (clusterName: string) => { + public getClusterId = async (clusterIdentification: any) => { let clusterId = null; - const index = cluster.clusterData.findIndex(item => item.clusterName === clusterName); + const index = cluster.clusterData.findIndex(item => item.clusterIdentification === clusterIdentification); if (index > -1) { clusterId = cluster.clusterData[index].clusterId; } if (clusterId) { - cluster.getClusterMetaTopics(clusterId); + await cluster.getClusterMetaTopics(clusterId); this.clusterId = clusterId; return this.clusterId; - } - return this.clusterId = clusterName as any; + }; + return this.clusterId = clusterId as any; } public async initFormValue(monitorRule: IRequestParams) { @@ -108,17 +112,19 @@ export class DynamicSetFilter extends React.Component { const topicFilter = strategyFilterList.filter(item => item.tkey === 'topic')[0]; const consumerFilter = strategyFilterList.filter(item => item.tkey === 'consumerGroup')[0]; - const clusterName = clusterFilter ? clusterFilter.tval[0] : null; + const clusterIdentification = clusterFilter ? clusterFilter.tval[0] : null; const topic = topicFilter ? topicFilter.tval[0] : null; const consumerGroup = consumerFilter ? consumerFilter.tval[0] : null; const location: string = null; const monitorType = monitorRule.strategyExpressionList[0].metric; alarm.changeMonitorStrategyType(monitorType); - - await this.getClusterId(clusterName); + //增加clusterIdentification替代原来的clusterName + this.clusterIdentification = clusterIdentification; + await this.getClusterId(this.clusterIdentification); + // await this.handleSelectChange(topic, 'topic'); await this.handleSelectChange(consumerGroup, 'consumerGroup'); - this.resetFormValue(monitorType, this.clusterId, topic, consumerGroup, location); + this.resetFormValue(monitorType, this.clusterIdentification, topic, consumerGroup, location); } public clearFormData() { @@ -130,11 +136,12 @@ export class DynamicSetFilter extends React.Component { this.resetFormValue(); } - public async handleClusterChange(e: number) { - this.clusterId = e; + public async handleClusterChange(e: any) { + this.clusterIdentification = e; this.topicName = null; topic.setLoading(true); - await cluster.getClusterMetaTopics(e); + const clusterId = await this.getClusterId(e); + await cluster.getClusterMetaTopics(clusterId); this.resetFormValue(this.monitorType, e, null, this.consumerGroup, this.location); topic.setLoading(false); } @@ -170,7 +177,7 @@ export class DynamicSetFilter extends React.Component { } this.consumerGroup = null; this.location = null; - this.resetFormValue(this.monitorType, this.clusterId, this.topicName); + this.resetFormValue(this.monitorType, this.clusterIdentification, this.topicName); topic.setLoading(false); } @@ -213,17 +220,24 @@ export class DynamicSetFilter extends React.Component { }, rules: [{ required: true, message: '请选择监控指标' }], } as IVritualScrollSelect; + const clusterData = toJS(cluster.clusterData); + const options = clusterData?.length ? clusterData.map(item => { + return { + label: `${item.clusterName}${item.description ? '(' + item.description + ')' : ''}`, + value: item.clusterIdentification + } + }) : null; const clusterItem = { label: '集群', - options: cluster.clusterData, - defaultValue: this.clusterId, + options, + defaultValue: this.clusterIdentification, rules: [{ required: true, message: '请选择集群' }], attrs: { placeholder: '请选择集群', - className: 'middle-size', + className: 'large-size', disabled: this.isDetailPage, - onChange: (e: number) => this.handleClusterChange(e), + onChange: (e: any) => this.handleClusterChange(e), }, key: 'cluster', } as unknown as IVritualScrollSelect; @@ -241,7 +255,7 @@ export class DynamicSetFilter extends React.Component { }), attrs: { placeholder: '请选择Topic', - className: 'middle-size', + className: 'large-size', disabled: this.isDetailPage, onChange: (e: string) => this.handleSelectChange(e, 'topic'), }, @@ -329,7 +343,7 @@ export class DynamicSetFilter extends React.Component { key={v.value || v.key || index} value={v.value} > - {v.label.length > 25 ? + {v.label?.length > 25 ? {v.label} : v.label} diff --git a/kafka-manager-console/src/container/alarm/add-alarm/index.less b/kafka-manager-console/src/container/alarm/add-alarm/index.less index 9946c0c1..11d9b3a3 100644 --- a/kafka-manager-console/src/container/alarm/add-alarm/index.less +++ b/kafka-manager-console/src/container/alarm/add-alarm/index.less @@ -43,21 +43,23 @@ Icon { margin-left: 8px; } + .ant-form-item-label { + // padding-left: 10px; + width: 118px; + text-align: right !important; + } &.type-form { - padding-top: 10px; + padding-top: 10px; .ant-form{ min-width: 755px; } .ant-form-item { - width: 30%; + width: 45%; min-width: 360px; } - .ant-form-item-label { - padding-left: 10px; - } .ant-form-item-control { - width: 220px; + width: 300px; } } diff --git a/kafka-manager-console/src/container/alarm/add-alarm/index.tsx b/kafka-manager-console/src/container/alarm/add-alarm/index.tsx index ae201823..590c5847 100644 --- a/kafka-manager-console/src/container/alarm/add-alarm/index.tsx +++ b/kafka-manager-console/src/container/alarm/add-alarm/index.tsx @@ -12,7 +12,6 @@ import { alarm } from 'store/alarm'; import { app } from 'store/app'; import Url from 'lib/url-parser'; import { IStrategyExpression, IRequestParams } from 'types/alarm'; - @observer export class AddAlarm extends SearchAndFilterContainer { public isDetailPage = window.location.pathname.includes('/alarm-detail'); // 判断是否为详情 @@ -90,8 +89,8 @@ export class AddAlarm extends SearchAndFilterContainer { const filterObj = this.typeForm.getFormData().filterObj; // tslint:disable-next-line:max-line-length if (!actionValue || !timeValue || !typeValue || !strategyList.length || !filterObj || !filterObj.filterList.length) { - message.error('请正确填写必填项'); - return null; + message.error('请正确填写必填项'); + return null; } if (filterObj.monitorType === 'online-kafka-topic-throttled') { @@ -101,13 +100,17 @@ export class AddAlarm extends SearchAndFilterContainer { tval: [typeValue.app], }); } + this.id && filterObj.filterList.forEach((item: any) => { + if (item.tkey === 'cluster') { + item.tval = [item.clusterIdentification] + } + }) strategyList = strategyList.map((row: IStrategyExpression) => { return { ...row, metric: filterObj.monitorType, }; }); - return { appId: typeValue.app, name: typeValue.alarmName, @@ -129,7 +132,7 @@ export class AddAlarm extends SearchAndFilterContainer { public renderAlarmStrategy() { return (
- 报警策略 + 报警策略
this.strategyForm = form} />
@@ -139,9 +142,9 @@ export class AddAlarm extends SearchAndFilterContainer { public renderTimeForm() { return ( - <> - this.timeForm = form} /> - + <> + this.timeForm = form} /> + ); } @@ -164,7 +167,7 @@ export class AddAlarm extends SearchAndFilterContainer { {this.renderAlarmStrategy()} {this.renderTimeForm()} this.actionForm = actionForm} /> -
+
); } diff --git a/kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx b/kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx index 1852c468..677462fd 100644 --- a/kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx +++ b/kafka-manager-console/src/container/alarm/add-alarm/strategy-form.tsx @@ -5,6 +5,7 @@ import { IStringMap } from 'types/base-type'; import { IRequestParams } from 'types/alarm'; import { IFormSelect, IFormItem, FormItemType } from 'component/x-form'; import { searchProps } from 'constants/table'; +import { alarm } from 'store/alarm'; interface IDynamicProps { form: any; @@ -27,6 +28,7 @@ class DynamicSetStrategy extends React.Component { public crudList = [] as ICRUDItem[]; public state = { shouldUpdate: false, + monitorType: alarm.monitorType }; public componentDidMount() { @@ -130,7 +132,7 @@ class DynamicSetStrategy extends React.Component { if (lineValue.func === 'happen' && paramsArray.length > 1 && paramsArray[0] < paramsArray[1]) { strategyList = []; // 清空赋值 - return message.error('周期值应大于次数') ; + return message.error('周期值应大于次数'); } lineValue.params = paramsArray.join(','); @@ -292,8 +294,39 @@ class DynamicSetStrategy extends React.Component { } return element; } - - public renderFormList(row: ICRUDItem) { + public unit(monitorType: string) { + let element = null; + switch (monitorType) { + case 'online-kafka-topic-msgIn': + element = "条/秒" + break; + case 'online-kafka-topic-bytesIn': + element = "字节/秒" + break; + case 'online-kafka-topic-bytesRejected': + element = "字节/秒" + break; + case 'online-kafka-topic-produce-throttled': + element = "1表示被限流" + break; + case 'online-kafka-topic-fetch-throttled': + element = "1表示被限流" + break; + case 'online-kafka-consumer-maxLag': + element = "条" + break; + case 'online-kafka-consumer-lag': + element = "条" + break; + case 'online-kafka-consumer-maxDelayTime': + element = "秒" + break; + } + return ( + {element} + ) + } + public renderFormList(row: ICRUDItem, monitorType: string) { const key = row.id; const funcType = row.func; @@ -309,6 +342,7 @@ class DynamicSetStrategy extends React.Component { key: key + '-func', } as IFormSelect)} {this.getFuncItem(row)} + {row.func !== 'c_avg_rate_abs' && row.func !== 'pdiff' ? this.unit(monitorType) : null} ); } @@ -340,8 +374,8 @@ class DynamicSetStrategy extends React.Component {
{crudList.map((row, index) => { return ( -
- {this.renderFormList(row)} +
+ {this.renderFormList(row, alarm.monitorType)} { crudList.length > 1 ? ( -
- 基本信息 -
- this.$form = form} - formData={formData} - formMap={xTypeFormMap} - layout="inline" - /> -
-
-
- 选择指标 -
- this.filterForm = form} /> -
-
+
+ 基本信息 +
+ this.$form = form} + formData={formData} + formMap={xTypeFormMap} + layout="inline" + /> +
+
+
+ 选择指标 +
+ this.filterForm = form} /> +
+
); } diff --git a/kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx b/kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx index 49a25a3c..84c17703 100644 --- a/kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx +++ b/kafka-manager-console/src/container/cluster/cluster-detail/cluster-overview.tsx @@ -31,11 +31,11 @@ export class ClusterOverview extends React.Component { const content = this.props.basicInfo as IBasicInfo; const clusterContent = [{ value: content.clusterName, - label: '集群中文名称', + label: '集群名称', }, { - value: content.clusterName, - label: '集群英文名称', + value: content.clusterIdentification, + label: '集群标识', }, { value: clusterTypeMap[content.mode], @@ -44,8 +44,8 @@ export class ClusterOverview extends React.Component { value: moment(content.gmtCreate).format(timeFormat), label: '接入时间', }, { - value: content.physicalClusterId, - label: '物理集群ID', + value: content.clusterId, + label: '集群ID', }]; const clusterInfo = [{ value: content.clusterVersion, diff --git a/kafka-manager-console/src/container/cluster/config.tsx b/kafka-manager-console/src/container/cluster/config.tsx index bbd03cb0..ca2ea880 100644 --- a/kafka-manager-console/src/container/cluster/config.tsx +++ b/kafka-manager-console/src/container/cluster/config.tsx @@ -13,32 +13,14 @@ const { confirm } = Modal; export const getClusterColumns = (urlPrefix: string) => { return [ { - title: '逻辑集群ID', + title: '集群ID', dataIndex: 'clusterId', key: 'clusterId', width: '9%', sorter: (a: IClusterData, b: IClusterData) => b.clusterId - a.clusterId, }, { - title: '逻辑集群中文名称', - dataIndex: 'clusterName', - key: 'clusterName', - width: '13%', - onCell: () => ({ - style: { - maxWidth: 120, - ...cellStyle, - }, - }), - sorter: (a: IClusterData, b: IClusterData) => a.clusterName.charCodeAt(0) - b.clusterName.charCodeAt(0), - render: (text: string, record: IClusterData) => ( - - {text} - - ), - }, - { - title: '逻辑集群英文名称', + title: '集群名称', dataIndex: 'clusterName', key: 'clusterName', width: '13%', @@ -55,6 +37,24 @@ export const getClusterColumns = (urlPrefix: string) => { ), }, + // { + // title: '逻辑集群英文名称', + // dataIndex: 'clusterName', + // key: 'clusterName', + // width: '13%', + // onCell: () => ({ + // style: { + // maxWidth: 120, + // ...cellStyle, + // }, + // }), + // sorter: (a: IClusterData, b: IClusterData) => a.clusterName.charCodeAt(0) - b.clusterName.charCodeAt(0), + // render: (text: string, record: IClusterData) => ( + // + // {text} + // + // ), + // }, { title: 'Topic数量', dataIndex: 'topicNum', diff --git a/kafka-manager-console/src/container/cluster/my-cluster.tsx b/kafka-manager-console/src/container/cluster/my-cluster.tsx index 7fc2f666..3c54763a 100644 --- a/kafka-manager-console/src/container/cluster/my-cluster.tsx +++ b/kafka-manager-console/src/container/cluster/my-cluster.tsx @@ -78,7 +78,7 @@ export class MyCluster extends SearchAndFilterContainer { rules: [ { required: true, - pattern: /^.{5,}.$/, + pattern: /^.{4,}.$/, message: '请输入至少5个字符', }, ], @@ -160,7 +160,7 @@ export class MyCluster extends SearchAndFilterContainer { data = searchKey ? origin.filter((item: IClusterData) => (item.clusterName !== undefined && item.clusterName !== null) && item.clusterName.toLowerCase().includes(searchKey as string), - ) : origin ; + ) : origin; return data; } diff --git a/kafka-manager-console/src/container/drawer/data-migration.tsx b/kafka-manager-console/src/container/drawer/data-migration.tsx index 0743476b..28353004 100644 --- a/kafka-manager-console/src/container/drawer/data-migration.tsx +++ b/kafka-manager-console/src/container/drawer/data-migration.tsx @@ -127,7 +127,7 @@ class DataMigrationFormTable extends React.Component { key: 'retentionTime', // originalRetentionTime width: '132px', sorter: (a: IRenderData, b: IRenderData) => b.retentionTime - a.retentionTime, - render: (time: any) => transMSecondToHour(time), + render: (time: any) => transMSecondToHour(time), }, { title: 'BrokerID', dataIndex: 'brokerIdList', @@ -254,7 +254,7 @@ class DataMigrationFormTable extends React.Component { dataSource={this.props.data} columns={columns} pagination={false} - scroll={{y: 520}} + scroll={{ y: 520 }} className="migration-table" /> @@ -316,7 +316,7 @@ export class InfoForm extends React.Component { {getFieldDecorator('description', { initialValue: '', - rules: [{ required: true, message: '请输入至少5个字符', pattern: /^.{5,}.$/ }], + rules: [{ required: true, message: '请输入至少5个字符', pattern: /^.{4,}.$/ }], })( , )} diff --git a/kafka-manager-console/src/container/modal/admin/cluster.ts b/kafka-manager-console/src/container/modal/admin/cluster.ts index ccf1aa54..cea987f6 100644 --- a/kafka-manager-console/src/container/modal/admin/cluster.ts +++ b/kafka-manager-console/src/container/modal/admin/cluster.ts @@ -23,13 +23,22 @@ export const showEditClusterTopic = (item: IClusterTopics) => { { key: 'appId', label: '应用ID', + type: 'select', + options: app.adminAppData.map(item => { + return { + label: item.appId, + value: item.appId, + }; + }), rules: [{ required: true, - message: '请输入应用ID', + // message: '请输入应用ID', + // message: '请输入应用ID,应用名称只支持字母、数字、下划线、短划线,长度限制在3-64字符', + // pattern: /[_a-zA-Z0-9_-]{3,64}$/, }], attrs: { placeholder: '请输入应用ID', - disabled: true, + // disabled: true, }, }, { @@ -104,7 +113,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl } const updateFormModal = (isShow: boolean) => { const formMap = wrapper.xFormWrapper.formMap; - isShow ? formMap.splice(2, 0, + isShow ? formMap.splice(3, 0, { key: 'appId', label: '所属应用', @@ -119,7 +128,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl attrs: { placeholder: '请选择所属应用', }, - }) : formMap.splice(2, 1); + }) : formMap.splice(3, 1); const formData = wrapper.xFormWrapper.formData; wrapper.ref && wrapper.ref.updateFormMap$(formMap, formData || {}); }; @@ -129,30 +138,30 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl formMap: [ { key: 'logicalClusterName', - label: '逻辑集群中文名称', + label: '逻辑集群名称', // defaultValue:'', - rules: [{ - required: true, - message: '请输入逻辑集群中文名称,支持中文、字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间', // 不能以下划线(_)和短划线(-)开头和结尾 + rules: [{ + required: true, + message: '请输入逻辑集群名称,支持中文、字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间', // 不能以下划线(_)和短划线(-)开头和结尾 pattern: /^[a-zA-Z0-9_\-\u4e00-\u9fa5]{3,128}$/g, //(?!(_|\-))(?!.*?(_|\-)$) }], attrs: { // disabled: record ? true : false, - placeholder:'请输入逻辑集群中文名称' + placeholder: '请输入逻辑集群名称' }, }, { - key: 'logicalClusterName1', - label: '逻辑集群英文名称', + key: 'logicalClusterIdentification', + label: '逻辑集群标识', // defaultValue:'', - rules: [{ - required: true, - message: '请输入逻辑集群英文名称,支持字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间', //不能以下划线(_)和短划线(-)开头和结尾 - pattern:/^[a-zA-Z0-9_\-]{3,128}$/g, //(?!(_|\-))(?!.*?(_|\-)$) + rules: [{ + required: true, + message: '请输入逻辑集群标识,支持字母、数字、下划线(_)和短划线(-)组成,长度在3-128字符之间', //不能以下划线(_)和短划线(-)开头和结尾 + pattern: /^[a-zA-Z0-9_\-]{3,128}$/g, //(?!(_|\-))(?!.*?(_|\-)$) }], attrs: { disabled: record ? true : false, - placeholder:'请输入逻辑集群英文名称,创建后无法修改' + placeholder: '请输入逻辑集标识,创建后无法修改' }, }, { @@ -233,7 +242,7 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl id: record ? record.logicalClusterId : '', mode: value.mode, name: value.logicalClusterName, - englishName:value.logicalClusterEName, // 存储逻辑集群英文名称 + identification: value.logicalClusterIdentification, regionIdList: value.regionIdList, } as INewLogical; if (record) { @@ -246,7 +255,25 @@ export const showLogicalClusterOpModal = (clusterId: number, record?: ILogicalCl }); }, }; - + if (record && record.mode != 0) { + isShow = true; + let formMap: any = xFormModal.formMap + formMap.splice(3, 0, { + key: 'appId', + label: '所属应用', + rules: [{ required: true, message: '请选择所属应用' }], + type: 'select', + options: app.adminAppData.map(item => { + return { + label: item.name, + value: item.appId, + }; + }), + attrs: { + placeholder: '请选择所属应用', + }, + }) + } wrapper.open(xFormModal); }; diff --git a/kafka-manager-console/src/container/modal/admin/expand-partition.tsx b/kafka-manager-console/src/container/modal/admin/expand-partition.tsx index 89133734..dfb51ba9 100644 --- a/kafka-manager-console/src/container/modal/admin/expand-partition.tsx +++ b/kafka-manager-console/src/container/modal/admin/expand-partition.tsx @@ -50,7 +50,10 @@ class CustomForm extends React.Component { notification.success({ message: '扩分成功' }); this.props.form.resetFields(); admin.getClusterTopics(this.props.clusterId); - }); + }).catch(err => { + notification.error({ message: '扩分成功' }); + + }) } }); } @@ -93,7 +96,7 @@ class CustomForm extends React.Component { {/* 运维管控-topic信息-扩分区操作 */} {getFieldDecorator('regionNameList', { - initialValue: admin.topicsBasic ? admin.topicsBasic.regionNameList : '', + initialValue: admin.topicsBasic && admin.topicsBasic.regionNameList.length > 0 ? admin.topicsBasic.regionNameList.join(',') : ' ', rules: [{ required: true, message: '请输入所属region' }], })()} diff --git a/kafka-manager-console/src/container/modal/admin/task.ts b/kafka-manager-console/src/container/modal/admin/task.ts index 8b9e5086..be240f7a 100644 --- a/kafka-manager-console/src/container/modal/admin/task.ts +++ b/kafka-manager-console/src/container/modal/admin/task.ts @@ -186,10 +186,10 @@ export const createMigrationTasks = () => { label: '初始限流', rules: [{ required: true, - message: '请输入初始限流', + message: '请输入初始限流,并按照:“限流上限>初始限流>限流下限”的大小顺序', }], attrs: { - placeholder: '请输入初始限流', + placeholder: '请输入初始限流,并按照:“限流上限>初始限流>限流下限”的大小顺序', suffix: 'MB/s', }, }, @@ -198,10 +198,10 @@ export const createMigrationTasks = () => { label: '限流上限', rules: [{ required: true, - message: '请输入限流上限', + message: '请输入限流上限,并按照:“限流上限>初始限流>限流下限”的大小顺序', }], attrs: { - placeholder: '请输入限流上限', + placeholder: '请输入限流上限,并按照:“限流上限>初始限流>限流下限”的大小顺序', suffix: 'MB/s', }, }, @@ -210,10 +210,10 @@ export const createMigrationTasks = () => { label: '限流下限', rules: [{ required: true, - message: '请输入限流下限', + message: '请输入限流下限,并按照:“限流上限>初始限流>限流下限”的大小顺序', }], attrs: { - placeholder: '请输入限流下限', + placeholder: '请输入限流下限,并按照:“限流上限>初始限流>限流下限”的大小顺序', suffix: 'MB/s', }, }, @@ -224,7 +224,7 @@ export const createMigrationTasks = () => { rules: [{ required: false, message: '请输入至少5个字符', - pattern: /^.{5,}.$/, + pattern: /^.{4,}.$/, }], attrs: { placeholder: '请输入备注', diff --git a/kafka-manager-console/src/container/modal/app.tsx b/kafka-manager-console/src/container/modal/app.tsx index 26becc73..bda37418 100644 --- a/kafka-manager-console/src/container/modal/app.tsx +++ b/kafka-manager-console/src/container/modal/app.tsx @@ -29,7 +29,7 @@ export const showEditModal = (record?: IAppItem, from?: string, isDisabled?: boo rules: [{ required: isDisabled ? false : true, message: '应用名称只支持中文、字母、数字、下划线、短划线,长度限制在3-64字符', - pattern: /[\u4e00-\u9fa5_a-zA-Z0-9_-]{3,64}/, + pattern: /[\u4e00-\u9fa5_a-zA-Z0-9_-]{3,64}$/, }], attrs: { disabled: isDisabled }, }, { diff --git a/kafka-manager-console/src/container/modal/cluster.tsx b/kafka-manager-console/src/container/modal/cluster.tsx index 23cb48ba..8ea048ef 100644 --- a/kafka-manager-console/src/container/modal/cluster.tsx +++ b/kafka-manager-console/src/container/modal/cluster.tsx @@ -29,7 +29,7 @@ export const showCpacityModal = (item: IClusterData) => { key: 'description', label: '申请原因', type: 'text_area', - rules: [{ required: true, pattern: /^.{5,}.$/, message: '请输入至少5个字符' }], + rules: [{ required: true, pattern: /^.{4,}.$/, message: '请输入至少5个字符' }], attrs: { placeholder: '请输入至少5个字符', }, @@ -44,12 +44,12 @@ export const showCpacityModal = (item: IClusterData) => { type: value.type, applicant: users.currentUser.username, description: value.description, - extensions: JSON.stringify({clusterId: item.clusterId}), + extensions: JSON.stringify({ clusterId: item.clusterId }), }; cluster.applyCpacity(cpacityParams).then(data => { notification.success({ message: `申请${value.type === 5 ? '扩容' : '缩容'}成功`, - }); + }); window.location.href = `${urlPrefix}/user/order-detail/?orderId=${data.id}®ion=${region.currentRegion}`; }); }, diff --git a/kafka-manager-console/src/container/modal/topic.tsx b/kafka-manager-console/src/container/modal/topic.tsx index e4c47f14..7053a497 100644 --- a/kafka-manager-console/src/container/modal/topic.tsx +++ b/kafka-manager-console/src/container/modal/topic.tsx @@ -22,7 +22,7 @@ export const applyTopic = () => { formMap: [ { key: 'clusterId', - label: '所属逻辑集群:', + label: '所属集群:', type: 'select', options: cluster.clusterData, rules: [{ required: true, message: '请选择' }], @@ -75,7 +75,7 @@ export const applyTopic = () => { key: 'description', label: '申请原因', type: 'text_area', - rules: [{ required: true, pattern: /^.{5,}.$/s, message: '请输入至少5个字符' }], + rules: [{ required: true, pattern: /^.{4,}.$/s, message: '请输入至少5个字符' }], attrs: { placeholder: `概要描述Topic的数据源, Topic数据的生产者/消费者, Topic的申请原因及备注信息等。(最多100个字) 例如: @@ -180,13 +180,14 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu const isConsume = item.access === 0 || item.access === 2; const xFormModal = { formMap: [ + // { + // key: 'clusterName', + // label: '逻辑集群名称', + // rules: [{ required: true, message: '' }], + // attrs: { disabled: true }, + // invisible: !item.hasOwnProperty('clusterName'), + // }, { - key: 'clusterName', - label: '逻辑集群名称', - rules: [{ required: true, message: '' }], - attrs: { disabled: true }, - invisible: !item.hasOwnProperty('clusterName'), - }, { key: 'topicName', label: 'Topic名称', rules: [{ required: true, message: '' }], @@ -225,7 +226,7 @@ export const showApplyQuatoModal = (item: ITopic | IAppsIdInfo, record: IQuotaQu key: 'description', label: '申请原因', type: 'text_area', - rules: [{ required: true, pattern: /^.{5,}.$/, message: quotaRemarks }], + rules: [{ required: true, pattern: /^.{4,}.$/, message: quotaRemarks }], attrs: { placeholder: quotaRemarks, }, @@ -292,13 +293,15 @@ const updateFormModal = (appId: string) => { export const showTopicApplyQuatoModal = (item: ITopic) => { const xFormModal = { formMap: [ + // { + // key: 'clusterName', + // label: '逻辑集群名称', + // rules: [{ required: true, message: '' }], + // attrs: { disabled: true }, + // defaultValue: item.clusterName, + // // invisible: !item.hasOwnProperty('clusterName'), + // }, { - key: 'clusterName', - label: '逻辑集群名称', - rules: [{ required: true, message: '' }], - attrs: { disabled: true }, - // invisible: !item.hasOwnProperty('clusterName'), - }, { key: 'topicName', label: 'Topic名称', rules: [{ required: true, message: '' }], @@ -530,7 +533,7 @@ const showAllPermission = (appId: string, item: ITopic, access: number) => { rules: [{ required: true, validator: (rule: any, value: string, callback: any) => { - const regexp = /^.{5,}.$/; + const regexp = /^.{4,}.$/; value = value.trim(); if (!regexp.test(value)) { callback('请输入至少5个字符'); @@ -629,7 +632,7 @@ export const showPermissionModal = (item: ITopic) => { rules: [{ required: true, validator: (rule: any, value: string, callback: any) => { - const regexp = /^.{5,}.$/; + const regexp = /^.{4,}.$/; value = value.trim(); if (!regexp.test(value)) { callback('请输入至少5个字符'); @@ -678,7 +681,7 @@ export const showTopicEditModal = (item: ITopic) => { key: 'description', label: '备注', type: 'text_area', - rules: [{ required: false }, { pattern: /^.{5,}.$/, message: '请输入至少5个字符' }], + rules: [{ required: false }, { pattern: /^.{4,}.$/, message: '请输入至少5个字符' }], }, ], formData: { diff --git a/kafka-manager-console/src/container/topic/config.tsx b/kafka-manager-console/src/container/topic/config.tsx index a845cec1..8485ec42 100644 --- a/kafka-manager-console/src/container/topic/config.tsx +++ b/kafka-manager-console/src/container/topic/config.tsx @@ -85,7 +85,6 @@ export const applyQuotaQuery = (item: ITopic) => { }; export const applyTopicQuotaQuery = async (item: ITopic) => { - console.log(item) await app.getTopicAppQuota(item.clusterId, item.topicName); await showTopicApplyQuatoModal(item); }; @@ -142,7 +141,7 @@ export const getAllTopicColumns = (urlPrefix: string) => { {text} ); }, diff --git a/kafka-manager-console/src/container/topic/topic-all.tsx b/kafka-manager-console/src/container/topic/topic-all.tsx index 19bdc709..59456660 100644 --- a/kafka-manager-console/src/container/topic/topic-all.tsx +++ b/kafka-manager-console/src/container/topic/topic-all.tsx @@ -60,7 +60,7 @@ export class AllTopic extends SearchAndFilterContainer { if (cluster.allActive !== -1 || searchKey !== '') { data = origin.filter(d => ((d.topicName !== undefined && d.topicName !== null) && d.topicName.toLowerCase().includes(searchKey as string) - || ((d.appPrincipals !== undefined && d.appPrincipals !== null) && d.appPrincipals.toLowerCase().includes(searchKey as string))) + || ((d.appPrincipals !== undefined && d.appPrincipals !== null) && d.appPrincipals.toLowerCase().includes(searchKey as string))) && (cluster.allActive === -1 || d.clusterId === cluster.allActive), ); } else { diff --git a/kafka-manager-console/src/container/topic/topic-detail/base-information.tsx b/kafka-manager-console/src/container/topic/topic-detail/base-information.tsx index 48a58f36..a9d91a2f 100644 --- a/kafka-manager-console/src/container/topic/topic-detail/base-information.tsx +++ b/kafka-manager-console/src/container/topic/topic-detail/base-information.tsx @@ -69,7 +69,7 @@ export class BaseInformation extends React.Component { label: '压缩格式', value: baseInfo.topicCodeC, }, { - label: '所属物理集群ID', + label: '集群ID', value: baseInfo.clusterId, }, { label: '所属region', diff --git a/kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx b/kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx index d7bb90b6..5a10b666 100644 --- a/kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx +++ b/kafka-manager-console/src/container/topic/topic-detail/bill-information.tsx @@ -95,23 +95,23 @@ export class BillInformation extends SearchAndFilterContainer { } public render() { - return( + return ( <> -
-
    -
  • 账单信息  +
    +
      +
    • 账单信息  - - -
    • - {this.renderDatePick()} -
    - {this.renderChart()} -
    + // tslint:disable-next-line:max-line-length + href="https://github.com/didi/kafka-manager" + target="_blank" + > + + +
  • + {this.renderDatePick()} +
+ {this.renderChart()} +
); } diff --git a/kafka-manager-console/src/container/topic/topic-detail/index.tsx b/kafka-manager-console/src/container/topic/topic-detail/index.tsx index 451e5382..0220341b 100644 --- a/kafka-manager-console/src/container/topic/topic-detail/index.tsx +++ b/kafka-manager-console/src/container/topic/topic-detail/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import './index.less'; import { wrapper, region } from 'store'; -import { Tabs, PageHeader, Button, notification, Drawer, message, Icon } from 'antd'; +import { Tabs, PageHeader, Button, notification, Drawer, message, Icon, Spin } from 'antd'; import { observer } from 'mobx-react'; import { BaseInformation } from './base-information'; import { StatusChart } from './status-chart'; @@ -44,6 +44,7 @@ export class TopicDetail extends React.Component { drawerVisible: false, infoVisible: false, infoTopicList: [] as IInfoData[], + isExecutionBtn: false }; private $formRef: any; @@ -54,7 +55,7 @@ export class TopicDetail extends React.Component { const url = Url(); this.clusterId = Number(url.search.clusterId); this.needAuth = url.search.needAuth; - this.clusterName = url.search.clusterName; + this.clusterName = decodeURI(decodeURI(url.search.clusterName)); this.topicName = url.search.topic; const isPhysical = Url().search.hasOwnProperty('isPhysicalClusterId'); this.isPhysicalTrue = isPhysical ? '&isPhysicalClusterId=true' : ''; @@ -197,7 +198,9 @@ export class TopicDetail extends React.Component { formData={formData} formMap={formMap} /> - + {infoVisible ? this.renderInfo() : null} @@ -243,7 +246,11 @@ export class TopicDetail extends React.Component { ); } + // 执行加载图标 + public antIcon = + public drawerSubmit = (value: any) => { + this.setState({ isExecutionBtn: true }) this.$formRef.validateFields((error: Error, result: any) => { if (error) { return; @@ -253,9 +260,12 @@ export class TopicDetail extends React.Component { this.setState({ infoTopicList: data, infoVisible: true, + isExecutionBtn: false }); message.success('采样成功'); - }); + }).catch(err => { + this.setState({ isExecutionBtn: false }) + }) }); } @@ -315,6 +325,7 @@ export class TopicDetail extends React.Component { public componentDidMount() { topic.getTopicBasicInfo(this.clusterId, this.topicName); topic.getTopicBusiness(this.clusterId, this.topicName); + app.getAppList(); } public render() { @@ -326,7 +337,6 @@ export class TopicDetail extends React.Component { topicName: this.topicName, clusterName: this.clusterName } as ITopic; - app.getAppList(); return ( <> @@ -342,9 +352,9 @@ export class TopicDetail extends React.Component { {this.needAuth == "true" && } - - - {showEditBtn && } + + + {/* {showEditBtn && } */} } /> diff --git a/kafka-manager-console/src/container/topic/topic-mine.tsx b/kafka-manager-console/src/container/topic/topic-mine.tsx index c0a0b14a..d4f473d1 100644 --- a/kafka-manager-console/src/container/topic/topic-mine.tsx +++ b/kafka-manager-console/src/container/topic/topic-mine.tsx @@ -30,7 +30,7 @@ export class MineTopic extends SearchAndFilterContainer { if (cluster.active !== -1 || app.active !== '-1' || searchKey !== '') { data = origin.filter(d => ((d.topicName !== undefined && d.topicName !== null) && d.topicName.toLowerCase().includes(searchKey as string) - || ((d.appName !== undefined && d.appName !== null) && d.appName.toLowerCase().includes(searchKey as string))) + || ((d.appName !== undefined && d.appName !== null) && d.appName.toLowerCase().includes(searchKey as string))) && (cluster.active === -1 || d.clusterId === cluster.active) && (app.active === '-1' || d.appId === (app.active + '')), ); @@ -152,18 +152,18 @@ export class MineTopic extends SearchAndFilterContainer { public render() { return ( <> -
- this.handleTabKey(key)}> - - {this.renderOperationPanel(1)} - {this.renderMyTopicTable(this.getData(topic.mytopicData))} - - - {this.renderOperationPanel(2)} - {this.renderDeprecatedTopicTable(this.getData(topic.expireData))} - - -
+
+ this.handleTabKey(key)}> + + {this.renderOperationPanel(1)} + {this.renderMyTopicTable(this.getData(topic.mytopicData))} + + + {this.renderOperationPanel(2)} + {this.renderDeprecatedTopicTable(this.getData(topic.expireData))} + + +
); } diff --git a/kafka-manager-console/src/container/user-center/my-bill.tsx b/kafka-manager-console/src/container/user-center/my-bill.tsx index 3383861a..1449ef9a 100644 --- a/kafka-manager-console/src/container/user-center/my-bill.tsx +++ b/kafka-manager-console/src/container/user-center/my-bill.tsx @@ -79,7 +79,7 @@ export class MyBill extends React.Component { } public renderTableList() { - const userUrl=`${urlPrefix}/user/bill-detail` + const userUrl = `${urlPrefix}/user/bill-detail` return (
); } - + public renderChart() { return (
- this.chart = ref } getChartData={this.getData.bind(this, null)} /> + this.chart = ref} getChartData={this.getData.bind(this, null)} />
); } @@ -131,7 +131,7 @@ export class MyBill extends React.Component { <>
- 账单趋势  - } + } key="1" > {this.renderDatePick()} diff --git a/kafka-manager-console/src/lib/fetch.ts b/kafka-manager-console/src/lib/fetch.ts index 037b0787..ef307ccb 100644 --- a/kafka-manager-console/src/lib/fetch.ts +++ b/kafka-manager-console/src/lib/fetch.ts @@ -33,6 +33,7 @@ const checkStatus = (res: Response) => { }; const filter = (init: IInit) => (res: IRes) => { + if (res.code !== 0 && res.code !== 200) { if (!init.errorNoTips) { notification.error({ diff --git a/kafka-manager-console/src/store/alarm.ts b/kafka-manager-console/src/store/alarm.ts index 7139a42e..b3e004df 100644 --- a/kafka-manager-console/src/store/alarm.ts +++ b/kafka-manager-console/src/store/alarm.ts @@ -96,7 +96,8 @@ class Alarm { @action.bound public setMonitorType(data: IMonitorMetricType) { this.monitorTypeList = data.metricNames || []; - this.monitorType = this.monitorTypeList[0].metricName; + // this.monitorType = this.monitorTypeList[0].metricName; + this.monitorType = ''; } @action.bound diff --git a/kafka-manager-console/src/store/cluster.ts b/kafka-manager-console/src/store/cluster.ts index aabe41c9..7fb32793 100644 --- a/kafka-manager-console/src/store/cluster.ts +++ b/kafka-manager-console/src/store/cluster.ts @@ -21,7 +21,7 @@ class Cluster { public selectData: IClusterData[] = [{ value: -1, label: '所有集群', - } as IClusterData, + } as IClusterData, ]; @observable @@ -31,7 +31,7 @@ class Cluster { public selectAllData: IClusterData[] = [{ value: -1, label: '所有集群', - } as IClusterData, + } as IClusterData, ]; @observable @@ -59,7 +59,7 @@ class Cluster { public clusterMetrics: IClusterMetrics[] = []; @observable - public type: IOptionType = 'byteIn/byteOut' ; + public type: IOptionType = 'byteIn/byteOut'; @observable public clusterTopics: IClusterTopics[] = []; @@ -130,11 +130,11 @@ class Cluster { public setClusterCombos(data: IConfigInfo[]) { this.clusterComboList = data || []; this.clusterComboList = this.clusterComboList.map(item => { - return { - ...item, - label: item.message, - value: item.code, - }; + return { + ...item, + label: item.message, + value: item.code, + }; }); } @@ -148,7 +148,7 @@ class Cluster { value: item.code, }; }); - this.clusterMode = (this.clusterModes && this.clusterModes.filter(ele => ele.code !== 0) ) || []; // 去除 0 共享集群 + this.clusterMode = (this.clusterModes && this.clusterModes.filter(ele => ele.code !== 0)) || []; // 去除 0 共享集群 } @action.bound @@ -158,7 +158,7 @@ class Cluster { @action.bound public setClusterDetailRealTime(data: IClusterReal) { - this.clusterRealData = data; + this.clusterRealData = data; this.setRealLoading(false); } @@ -192,9 +192,9 @@ class Cluster { @action.bound public setClusterDetailThrottles(data: IThrottles[]) { this.clustersThrottles = data ? data.map((item, index) => { - item.key = index; - return item; - }) : []; + item.key = index; + return item; + }) : []; } @action.bound diff --git a/kafka-manager-console/src/types/alarm.ts b/kafka-manager-console/src/types/alarm.ts index 3c4ddbd6..124282b0 100644 --- a/kafka-manager-console/src/types/alarm.ts +++ b/kafka-manager-console/src/types/alarm.ts @@ -19,6 +19,7 @@ export interface IStrategyFilter { tkey: string; topt: string; tval: string[]; + clusterIdentification?: string; } export interface IRequestParams { appId: string; diff --git a/kafka-manager-console/src/types/base-type.ts b/kafka-manager-console/src/types/base-type.ts index 5cfbb999..1170a696 100644 --- a/kafka-manager-console/src/types/base-type.ts +++ b/kafka-manager-console/src/types/base-type.ts @@ -23,6 +23,7 @@ export interface IBtn { } export interface IClusterData { + clusterIdentification: any; clusterId: number; mode: number; clusterName: string; @@ -598,10 +599,12 @@ export interface IClusterReal { } export interface IBasicInfo { + clusterIdentification: any; bootstrapServers: string; clusterId: number; mode: number; clusterName: string; + clusterNameCn: string; clusterVersion: string; gmtCreate: number; gmtModify: number; @@ -920,8 +923,9 @@ export interface INewLogical { mode: number; name: string; logicalClusterName?: string; - logicalClusterEName?: string; + logicalClusterNameCn?: string; regionIdList: number[]; + logicalClusterIdentification?:string } export interface IPartitionsLocation { diff --git a/kafka-manager-core/pom.xml b/kafka-manager-core/pom.xml index 2360dffd..81675a43 100644 --- a/kafka-manager-core/pom.xml +++ b/kafka-manager-core/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.xiaojukeji.kafka kafka-manager-core - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/LogicalClusterMetadataManager.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/LogicalClusterMetadataManager.java index 72bdcb76..5cd81581 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/LogicalClusterMetadataManager.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/LogicalClusterMetadataManager.java @@ -69,6 +69,19 @@ public class LogicalClusterMetadataManager { return LOGICAL_CLUSTER_ID_BROKER_ID_MAP.getOrDefault(logicClusterId, new HashSet<>()); } + public Long getTopicLogicalClusterId(Long physicalClusterId, String topicName) { + if (!LOADED.get()) { + flush(); + } + + Map logicalClusterIdMap = TOPIC_LOGICAL_MAP.get(physicalClusterId); + if (ValidateUtils.isNull(logicalClusterIdMap)) { + return null; + } + + return logicalClusterIdMap.get(topicName); + } + public LogicalClusterDO getTopicLogicalCluster(Long physicalClusterId, String topicName) { if (!LOADED.get()) { flush(); diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/PhysicalClusterMetadataManager.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/PhysicalClusterMetadataManager.java index 345f7b9c..59453919 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/PhysicalClusterMetadataManager.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/cache/PhysicalClusterMetadataManager.java @@ -4,9 +4,11 @@ import com.xiaojukeji.kafka.manager.common.bizenum.KafkaBrokerRoleEnum; import com.xiaojukeji.kafka.manager.common.constant.Constant; import com.xiaojukeji.kafka.manager.common.constant.KafkaConstant; import com.xiaojukeji.kafka.manager.common.entity.KafkaVersion; +import com.xiaojukeji.kafka.manager.common.utils.JsonUtils; import com.xiaojukeji.kafka.manager.common.utils.ListUtils; import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO; import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils; +import com.xiaojukeji.kafka.manager.common.utils.jmx.JmxConfig; import com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers.BrokerMetadata; import com.xiaojukeji.kafka.manager.common.zookeeper.znode.ControllerData; import com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers.TopicMetadata; @@ -118,8 +120,15 @@ public class PhysicalClusterMetadataManager { return; } + JmxConfig jmxConfig = null; + try { + jmxConfig = JsonUtils.stringToObj(clusterDO.getJmxProperties(), JmxConfig.class); + } catch (Exception e) { + LOGGER.error("class=PhysicalClusterMetadataManager||method=addNew||clusterDO={}||msg=parse jmx properties failed", JsonUtils.toJSONString(clusterDO)); + } + //增加Broker监控 - BrokerStateListener brokerListener = new BrokerStateListener(clusterDO.getId(), zkConfig, configUtils.getJmxMaxConn()); + BrokerStateListener brokerListener = new BrokerStateListener(clusterDO.getId(), zkConfig, jmxConfig); brokerListener.init(); zkConfig.watchChildren(ZkPathUtil.BROKER_IDS_ROOT, brokerListener); @@ -280,7 +289,7 @@ public class PhysicalClusterMetadataManager { //---------------------------Broker元信息相关-------------- - public static void putBrokerMetadata(Long clusterId, Integer brokerId, BrokerMetadata brokerMetadata, Integer jmxMaxConn) { + public static void putBrokerMetadata(Long clusterId, Integer brokerId, BrokerMetadata brokerMetadata, JmxConfig jmxConfig) { Map metadataMap = BROKER_METADATA_MAP.get(clusterId); if (metadataMap == null) { return; @@ -288,7 +297,7 @@ public class PhysicalClusterMetadataManager { metadataMap.put(brokerId, brokerMetadata); Map jmxMap = JMX_CONNECTOR_MAP.getOrDefault(clusterId, new ConcurrentHashMap<>()); - jmxMap.put(brokerId, new JmxConnectorWrap(brokerMetadata.getHost(), brokerMetadata.getJmxPort(), jmxMaxConn)); + jmxMap.put(brokerId, new JmxConnectorWrap(brokerMetadata.getHost(), brokerMetadata.getJmxPort(), jmxConfig)); JMX_CONNECTOR_MAP.put(clusterId, jmxMap); Map versionMap = KAFKA_VERSION_MAP.getOrDefault(clusterId, new ConcurrentHashMap<>()); diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/ClusterServiceImpl.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/ClusterServiceImpl.java index 9f9727e1..93b90d2f 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/ClusterServiceImpl.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/ClusterServiceImpl.java @@ -203,6 +203,7 @@ public class ClusterServiceImpl implements ClusterService { zk.close(); } } catch (Throwable t) { + return false; } } return true; diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/LogicalClusterServiceImpl.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/LogicalClusterServiceImpl.java index 5b2fb703..9a6f40be 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/LogicalClusterServiceImpl.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/service/impl/LogicalClusterServiceImpl.java @@ -113,6 +113,7 @@ public class LogicalClusterServiceImpl implements LogicalClusterService { LogicalCluster logicalCluster = new LogicalCluster(); logicalCluster.setLogicalClusterId(logicalClusterDO.getId()); logicalCluster.setLogicalClusterName(logicalClusterDO.getName()); + logicalCluster.setLogicalClusterIdentification(logicalClusterDO.getIdentification()); logicalCluster.setClusterVersion( physicalClusterMetadataManager.getKafkaVersion( logicalClusterDO.getClusterId(), diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/utils/ConfigUtils.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/utils/ConfigUtils.java index 53e9a2ba..2c2cc253 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/utils/ConfigUtils.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/utils/ConfigUtils.java @@ -13,9 +13,6 @@ public class ConfigUtils { @Value(value = "${custom.idc}") private String idc; - @Value("${custom.jmx.max-conn}") - private Integer jmxMaxConn; - @Value(value = "${spring.profiles.active}") private String kafkaManagerEnv; @@ -30,14 +27,6 @@ public class ConfigUtils { this.idc = idc; } - public Integer getJmxMaxConn() { - return jmxMaxConn; - } - - public void setJmxMaxConn(Integer jmxMaxConn) { - this.jmxMaxConn = jmxMaxConn; - } - public String getKafkaManagerEnv() { return kafkaManagerEnv; } diff --git a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/zookeeper/BrokerStateListener.java b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/zookeeper/BrokerStateListener.java index 16a185e0..a94ec9de 100644 --- a/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/zookeeper/BrokerStateListener.java +++ b/kafka-manager-core/src/main/java/com/xiaojukeji/kafka/manager/service/zookeeper/BrokerStateListener.java @@ -1,5 +1,6 @@ package com.xiaojukeji.kafka.manager.service.zookeeper; +import com.xiaojukeji.kafka.manager.common.utils.jmx.JmxConfig; import com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers.BrokerMetadata; import com.xiaojukeji.kafka.manager.common.zookeeper.StateChangeListener; import com.xiaojukeji.kafka.manager.common.zookeeper.ZkConfigImpl; @@ -22,12 +23,12 @@ public class BrokerStateListener implements StateChangeListener { private ZkConfigImpl zkConfig; - private Integer jmxMaxConn; + private JmxConfig jmxConfig; - public BrokerStateListener(Long clusterId, ZkConfigImpl zkConfig, Integer jmxMaxConn) { + public BrokerStateListener(Long clusterId, ZkConfigImpl zkConfig, JmxConfig jmxConfig) { this.clusterId = clusterId; this.zkConfig = zkConfig; - this.jmxMaxConn = jmxMaxConn; + this.jmxConfig = jmxConfig; } @Override @@ -84,7 +85,7 @@ public class BrokerStateListener implements StateChangeListener { } brokerMetadata.setClusterId(clusterId); brokerMetadata.setBrokerId(brokerId); - PhysicalClusterMetadataManager.putBrokerMetadata(clusterId, brokerId, brokerMetadata, jmxMaxConn); + PhysicalClusterMetadataManager.putBrokerMetadata(clusterId, brokerId, brokerMetadata, jmxConfig); } catch (Exception e) { LOGGER.error("add broker failed, clusterId:{} brokerMetadata:{}.", clusterId, brokerMetadata, e); } diff --git a/kafka-manager-dao/pom.xml b/kafka-manager-dao/pom.xml index 41122856..8b30c431 100644 --- a/kafka-manager-dao/pom.xml +++ b/kafka-manager-dao/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kafka-manager-dao - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-dao/src/main/resources/mapper/ClusterDao.xml b/kafka-manager-dao/src/main/resources/mapper/ClusterDao.xml index a03eb6e0..53b90293 100644 --- a/kafka-manager-dao/src/main/resources/mapper/ClusterDao.xml +++ b/kafka-manager-dao/src/main/resources/mapper/ClusterDao.xml @@ -12,6 +12,7 @@ + INSERT INTO cluster ( - cluster_name, zookeeper, bootstrap_servers, security_properties + cluster_name, zookeeper, bootstrap_servers, security_properties, jmx_properties ) VALUES ( - #{clusterName}, #{zookeeper}, #{bootstrapServers}, #{securityProperties} + #{clusterName}, #{zookeeper}, #{bootstrapServers}, #{securityProperties}, #{jmxProperties} ) @@ -30,6 +31,7 @@ cluster_name=#{clusterName}, bootstrap_servers=#{bootstrapServers}, security_properties=#{securityProperties}, + jmx_properties=#{jmxProperties}, status=#{status} WHERE id = #{id} diff --git a/kafka-manager-dao/src/main/resources/mapper/LogicalClusterDao.xml b/kafka-manager-dao/src/main/resources/mapper/LogicalClusterDao.xml index b4478067..eef0b79f 100644 --- a/kafka-manager-dao/src/main/resources/mapper/LogicalClusterDao.xml +++ b/kafka-manager-dao/src/main/resources/mapper/LogicalClusterDao.xml @@ -1,24 +1,25 @@ - - - - + + + + - - - - - - + + + + + + + INSERT INTO logical_cluster - (name, app_id, cluster_id, region_list, mode, description) + (name, identification, app_id, cluster_id, region_list, mode, description) VALUES - (#{name}, #{appId}, #{clusterId}, #{regionList}, #{mode}, #{description}) + (#{name}, #{identification}, #{appId}, #{clusterId}, #{regionList}, #{mode}, #{description}) @@ -27,7 +28,8 @@ UPDATE logical_cluster SET - + name=#{name}, + cluster_id=#{clusterId}, region_list=#{regionList}, description=#{description}, diff --git a/kafka-manager-extends/kafka-manager-account/pom.xml b/kafka-manager-extends/kafka-manager-account/pom.xml index 3d129969..a3cb47fb 100644 --- a/kafka-manager-extends/kafka-manager-account/pom.xml +++ b/kafka-manager-extends/kafka-manager-account/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kafka-manager-account - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-extends/kafka-manager-bpm/pom.xml b/kafka-manager-extends/kafka-manager-bpm/pom.xml index 6a670849..c8ecf459 100644 --- a/kafka-manager-extends/kafka-manager-bpm/pom.xml +++ b/kafka-manager-extends/kafka-manager-bpm/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kafka-manager-bpm - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-extends/kafka-manager-kcm/pom.xml b/kafka-manager-extends/kafka-manager-kcm/pom.xml index 4e087dd1..741f0f12 100644 --- a/kafka-manager-extends/kafka-manager-kcm/pom.xml +++ b/kafka-manager-extends/kafka-manager-kcm/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kafka-manager-kcm - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-extends/kafka-manager-monitor/pom.xml b/kafka-manager-extends/kafka-manager-monitor/pom.xml index 9d198a49..0948a190 100644 --- a/kafka-manager-extends/kafka-manager-monitor/pom.xml +++ b/kafka-manager-extends/kafka-manager-monitor/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.xiaojukeji.kafka kafka-manager-monitor - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/N9eConverter.java b/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/N9eConverter.java index 7735caf8..c69ae906 100644 --- a/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/N9eConverter.java +++ b/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/N9eConverter.java @@ -4,6 +4,7 @@ import com.xiaojukeji.kafka.manager.common.utils.ListUtils; import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils; import com.xiaojukeji.kafka.manager.monitor.common.entry.*; import com.xiaojukeji.kafka.manager.monitor.component.n9e.entry.*; +import com.xiaojukeji.kafka.manager.monitor.component.n9e.entry.bizenum.CategoryEnum; import java.util.*; @@ -44,7 +45,7 @@ public class N9eConverter { if (!ValidateUtils.isNull(strategy.getId())) { n9eStrategy.setId(strategy.getId().intValue()); } - n9eStrategy.setCategory(1); + n9eStrategy.setCategory(CategoryEnum.DEVICE_INDEPENDENT.getCode()); n9eStrategy.setName(strategy.getName()); n9eStrategy.setNid(monitorN9eNid); n9eStrategy.setExcl_nid(new ArrayList<>()); @@ -77,7 +78,13 @@ public class N9eConverter { n9eStrategy.setRecovery_notify(0); StrategyAction strategyAction = strategy.getStrategyActionList().get(0); - n9eStrategy.setConverge(ListUtils.string2IntList(strategyAction.getConverge())); + + // 单位转换, 夜莺的单位是秒, KM前端的单位是分钟 + List convergeList = ListUtils.string2IntList(strategyAction.getConverge()); + if (!ValidateUtils.isEmptyList(convergeList)) { + convergeList.set(0, convergeList.get(0) * 60); + } + n9eStrategy.setConverge(convergeList); List notifyGroups = new ArrayList<>(); for (String name: ListUtils.string2StrList(strategyAction.getNotifyGroup())) { @@ -167,7 +174,13 @@ public class N9eConverter { } strategyAction.setNotifyGroup(ListUtils.strList2String(notifyGroups)); - strategyAction.setConverge(ListUtils.intList2String(n9eStrategy.getConverge())); + // 单位转换, 夜莺的单位是秒, KM前端的单位是分钟 + List convergeList = n9eStrategy.getConverge(); + if (!ValidateUtils.isEmptyList(convergeList)) { + convergeList.set(0, convergeList.get(0) / 60); + } + strategyAction.setConverge(ListUtils.intList2String(convergeList)); + strategyAction.setCallback(n9eStrategy.getCallback()); strategy.setStrategyActionList(Arrays.asList(strategyAction)); diff --git a/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/entry/bizenum/CategoryEnum.java b/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/entry/bizenum/CategoryEnum.java new file mode 100644 index 00000000..9695c757 --- /dev/null +++ b/kafka-manager-extends/kafka-manager-monitor/src/main/java/com/xiaojukeji/kafka/manager/monitor/component/n9e/entry/bizenum/CategoryEnum.java @@ -0,0 +1,23 @@ +package com.xiaojukeji.kafka.manager.monitor.component.n9e.entry.bizenum; + +public enum CategoryEnum { + DEVICE_RELATED(1, "设备相关"), + DEVICE_INDEPENDENT(2, "设备无关"), + ; + private int code; + + private String msg; + + CategoryEnum(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/kafka-manager-extends/kafka-manager-notify/pom.xml b/kafka-manager-extends/kafka-manager-notify/pom.xml index c15dba32..a2fd2c4b 100644 --- a/kafka-manager-extends/kafka-manager-notify/pom.xml +++ b/kafka-manager-extends/kafka-manager-notify/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.xiaojukeji.kafka kafka-manager-notify - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-extends/kafka-manager-openapi/pom.xml b/kafka-manager-extends/kafka-manager-openapi/pom.xml index a0c4c277..caaa1242 100644 --- a/kafka-manager-extends/kafka-manager-openapi/pom.xml +++ b/kafka-manager-extends/kafka-manager-openapi/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kafka-manager-openapi - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} ../../pom.xml diff --git a/kafka-manager-task/pom.xml b/kafka-manager-task/pom.xml index 86c06a99..8927ef8e 100644 --- a/kafka-manager-task/pom.xml +++ b/kafka-manager-task/pom.xml @@ -5,13 +5,13 @@ 4.0.0 com.xiaojukeji.kafka kafka-manager-task - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkCommunityTopicMetrics2Monitor.java b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkCommunityTopicMetrics2Monitor.java index e8df775b..e2ac74a9 100644 --- a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkCommunityTopicMetrics2Monitor.java +++ b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkCommunityTopicMetrics2Monitor.java @@ -73,7 +73,7 @@ public class SinkCommunityTopicMetrics2Monitor extends AbstractScheduledTask MonitorSinkConstant.MONITOR_SYSTEM_SINK_THRESHOLD) { abstractMonitor.sinkMetrics(metricSinkPoints); metricSinkPoints.clear(); diff --git a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkConsumerMetrics2Monitor.java b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkConsumerMetrics2Monitor.java index 3b5f0ad4..4ca276f9 100644 --- a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkConsumerMetrics2Monitor.java +++ b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkConsumerMetrics2Monitor.java @@ -64,7 +64,7 @@ public class SinkConsumerMetrics2Monitor implements ApplicationListener MonitorSinkConstant.MONITOR_SYSTEM_SINK_THRESHOLD) { abstractMonitor.sinkMetrics(metricSinkPoints); metricSinkPoints.clear(); diff --git a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkTopicThrottledMetrics2Monitor.java b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkTopicThrottledMetrics2Monitor.java index c4871905..fb95947c 100644 --- a/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkTopicThrottledMetrics2Monitor.java +++ b/kafka-manager-task/src/main/java/com/xiaojukeji/kafka/manager/task/listener/SinkTopicThrottledMetrics2Monitor.java @@ -57,7 +57,7 @@ public class SinkTopicThrottledMetrics2Monitor implements ApplicationListener 4.0.0 kafka-manager-web - 2.1.0-SNAPSHOT + ${kafka-manager.revision} jar kafka-manager com.xiaojukeji.kafka - 2.1.0-SNAPSHOT + ${kafka-manager.revision} diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalAccountController.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalAccountController.java index 91a0dbaf..9b35ec87 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalAccountController.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalAccountController.java @@ -40,8 +40,7 @@ public class NormalAccountController { public Result> searchOnJobStaffByKeyWord(@RequestParam("keyWord") String keyWord) { List staffList = accountService.searchAccountByPrefix(keyWord); if (ValidateUtils.isEmptyList(staffList)) { - LOGGER.info("class=NormalAccountController||method=searchOnJobStaffByKeyWord||keyWord={}||msg=staffList is empty!" - ,keyWord); + LOGGER.info("class=NormalAccountController||method=searchOnJobStaffByKeyWord||keyWord={}||msg=staffList is empty!", keyWord); return new Result<>(); } List voList = new ArrayList<>(); diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalTopicController.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalTopicController.java index efc0eec8..6e59816b 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalTopicController.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/normal/NormalTopicController.java @@ -69,7 +69,8 @@ public class NormalTopicController { } return new Result<>(TopicModelConverter.convert2TopicBasicVO( topicService.getTopicBasicDTO(physicalClusterId, topicName), - clusterService.getById(physicalClusterId) + clusterService.getById(physicalClusterId), + logicalClusterMetadataManager.getTopicLogicalClusterId(physicalClusterId, topicName) )); } diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/op/OpUtilsController.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/op/OpUtilsController.java index c7b36cba..6d9e7a74 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/op/OpUtilsController.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/op/OpUtilsController.java @@ -166,7 +166,7 @@ public class OpUtilsController { if (!ResultStatus.SUCCESS.equals(rs)) { return Result.buildFrom(rs); } - topicManagerService.modifyTopic(dto.getClusterId(), dto.getTopicName(), dto.getDescription(), operator); + topicManagerService.modifyTopicByOp(dto.getClusterId(), dto.getTopicName(), dto.getAppId(), dto.getDescription(), operator); return new Result(); } diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/ClusterModelConverter.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/ClusterModelConverter.java index 9c76a8e5..d92967dd 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/ClusterModelConverter.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/ClusterModelConverter.java @@ -55,6 +55,7 @@ public class ClusterModelConverter { CopyUtils.copyProperties(vo, logicalCluster); vo.setClusterId(logicalCluster.getLogicalClusterId()); vo.setClusterName(logicalCluster.getLogicalClusterName()); + vo.setClusterIdentification(logicalCluster.getLogicalClusterIdentification()); return vo; } @@ -78,9 +79,8 @@ public class ClusterModelConverter { ClusterDO clusterDO = new ClusterDO(); CopyUtils.copyProperties(clusterDO, reqObj); clusterDO.setId(reqObj.getClusterId()); - clusterDO.setSecurityProperties( - ValidateUtils.isNull(clusterDO.getSecurityProperties())? "": clusterDO.getSecurityProperties() - ); + clusterDO.setSecurityProperties(ValidateUtils.isNull(reqObj.getSecurityProperties())? "": reqObj.getSecurityProperties()); + clusterDO.setJmxProperties(ValidateUtils.isNull(reqObj.getJmxProperties())? "": reqObj.getJmxProperties()); return clusterDO; } diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/LogicalClusterModelConverter.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/LogicalClusterModelConverter.java index 3067aa12..afdf0f03 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/LogicalClusterModelConverter.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/LogicalClusterModelConverter.java @@ -21,6 +21,7 @@ public class LogicalClusterModelConverter { LogicalClusterVO vo = new LogicalClusterVO(); vo.setLogicalClusterId(logicalClusterDO.getId()); vo.setLogicalClusterName(logicalClusterDO.getName()); + vo.setLogicalClusterIdentification(logicalClusterDO.getIdentification()); vo.setPhysicalClusterId(logicalClusterDO.getClusterId()); vo.setMode(logicalClusterDO.getMode()); vo.setRegionIdList(ListUtils.string2LongList(logicalClusterDO.getRegionList())); @@ -45,6 +46,7 @@ public class LogicalClusterModelConverter { public static LogicalClusterDO convert2LogicalClusterDO(LogicalClusterDTO dto) { LogicalClusterDO logicalClusterDO = new LogicalClusterDO(); logicalClusterDO.setName(dto.getName()); + logicalClusterDO.setIdentification(dto.getIdentification()); logicalClusterDO.setClusterId(dto.getClusterId()); logicalClusterDO.setRegionList(ListUtils.longList2String(dto.getRegionIdList())); logicalClusterDO.setMode(dto.getMode()); diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/TopicModelConverter.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/TopicModelConverter.java index 133ac019..4e28ca8b 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/TopicModelConverter.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/converters/TopicModelConverter.java @@ -22,9 +22,9 @@ import java.util.List; * @date 2017/6/1. */ public class TopicModelConverter { - public static TopicBasicVO convert2TopicBasicVO(TopicBasicDTO dto, ClusterDO clusterDO) { + public static TopicBasicVO convert2TopicBasicVO(TopicBasicDTO dto, ClusterDO clusterDO, Long logicalClusterId) { TopicBasicVO vo = new TopicBasicVO(); - vo.setClusterId(dto.getClusterId()); + vo.setClusterId(logicalClusterId); vo.setAppId(dto.getAppId()); vo.setAppName(dto.getAppName()); vo.setPartitionNum(dto.getPartitionNum()); diff --git a/kafka-manager-web/src/main/resources/application.yml b/kafka-manager-web/src/main/resources/application.yml index 6d7d9bec..73773981 100644 --- a/kafka-manager-web/src/main/resources/application.yml +++ b/kafka-manager-web/src/main/resources/application.yml @@ -11,7 +11,7 @@ spring: name: kafkamanager datasource: kafka-manager: - jdbc-url: jdbc:mysql://127.0.0.1:3306/kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8 + jdbc-url: jdbc:mysql://127.0.0.1:3306/logi_kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8 username: admin password: admin driver-class-name: com.mysql.jdbc.Driver diff --git a/pom.xml b/pom.xml index d5e74d61..7165880e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.xiaojukeji.kafka kafka-manager pom - 2.1.0-SNAPSHOT + ${kafka-manager.revision} org.springframework.boot @@ -16,11 +16,10 @@ - 2.0.0-SNAPSHOT + 2.2.0-SNAPSHOT 2.7.0 1.5.13 - true true 1.8