mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 03:42:07 +08:00
集群信息中,补充ZK配置字段
This commit is contained in:
@@ -4,7 +4,12 @@
|
|||||||
|
|
||||||
### 6.2.0、升级至 `master` 版本
|
### 6.2.0、升级至 `master` 版本
|
||||||
|
|
||||||
暂无
|
**SQL 变更**
|
||||||
|
|
||||||
|
```sql
|
||||||
|
ALTER TABLE `ks_km_physical_cluster`
|
||||||
|
ADD COLUMN `zk_properties` TEXT NULL COMMENT 'ZK配置' AFTER `jmx_properties`;
|
||||||
|
```
|
||||||
|
|
||||||
### 6.2.1、升级至 `v3.0.0-beta.2`版本
|
### 6.2.1、升级至 `v3.0.0-beta.2`版本
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.xiaojukeji.know.streaming.km.common.bean.dto.cluster;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.xiaojukeji.know.streaming.km.common.bean.dto.BaseDTO;
|
import com.xiaojukeji.know.streaming.km.common.bean.dto.BaseDTO;
|
||||||
import com.xiaojukeji.know.streaming.km.common.bean.entity.config.JmxConfig;
|
import com.xiaojukeji.know.streaming.km.common.bean.entity.config.JmxConfig;
|
||||||
|
import com.xiaojukeji.know.streaming.km.common.bean.entity.config.ZKConfig;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -34,4 +35,8 @@ public class ClusterPhyBaseDTO extends BaseDTO {
|
|||||||
@NotNull(message = "jmxProperties不允许为空")
|
@NotNull(message = "jmxProperties不允许为空")
|
||||||
@ApiModelProperty(value="Jmx配置")
|
@ApiModelProperty(value="Jmx配置")
|
||||||
protected JmxConfig jmxProperties;
|
protected JmxConfig jmxProperties;
|
||||||
|
|
||||||
|
// TODO 前端页面增加时,需要加一个不为空的限制
|
||||||
|
@ApiModelProperty(value="ZK配置")
|
||||||
|
protected ZKConfig zkProperties;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,9 +53,16 @@ public class ClusterPhy implements Comparable<ClusterPhy>, EntifyIdInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* jmx配置
|
* jmx配置
|
||||||
|
* @see com.xiaojukeji.know.streaming.km.common.bean.entity.config.JmxConfig
|
||||||
*/
|
*/
|
||||||
private String jmxProperties;
|
private String jmxProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zk配置
|
||||||
|
* @see com.xiaojukeji.know.streaming.km.common.bean.entity.config.ZKConfig
|
||||||
|
*/
|
||||||
|
private String zkProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启ACL
|
* 开启ACL
|
||||||
* @see com.xiaojukeji.know.streaming.km.common.enums.cluster.ClusterAuthTypeEnum
|
* @see com.xiaojukeji.know.streaming.km.common.enums.cluster.ClusterAuthTypeEnum
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.xiaojukeji.know.streaming.km.common.bean.entity.config;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zengqiao
|
||||||
|
* @date 22/02/24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "ZK配置")
|
||||||
|
public class ZKConfig implements Serializable {
|
||||||
|
@ApiModelProperty(value="ZK的jmx配置")
|
||||||
|
private JmxConfig jmxConfig;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="ZK是否开启secure", example = "false")
|
||||||
|
private Boolean openSecure = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="ZK的Session超时时间", example = "15000")
|
||||||
|
private Long sessionTimeoutUnitMs = 15000L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="ZK的Request超时时间", example = "5000")
|
||||||
|
private Long requestTimeoutUnitMs = 5000L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="ZK的Request超时时间")
|
||||||
|
private Properties otherProps = new Properties();
|
||||||
|
}
|
||||||
@@ -41,6 +41,11 @@ public class ClusterPhyPO extends BasePO {
|
|||||||
*/
|
*/
|
||||||
private String jmxProperties;
|
private String jmxProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zk配置
|
||||||
|
*/
|
||||||
|
private String zkProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证类型
|
* 认证类型
|
||||||
* @see com.xiaojukeji.know.streaming.km.common.enums.cluster.ClusterAuthTypeEnum
|
* @see com.xiaojukeji.know.streaming.km.common.enums.cluster.ClusterAuthTypeEnum
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class ClusterPhyBaseVO extends BaseTimeVO {
|
|||||||
@ApiModelProperty(value="Jmx配置", example = "{}")
|
@ApiModelProperty(value="Jmx配置", example = "{}")
|
||||||
protected String jmxProperties;
|
protected String jmxProperties;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="ZK配置", example = "{}")
|
||||||
|
protected String zkProperties;
|
||||||
|
|
||||||
@ApiModelProperty(value="描述", example = "测试")
|
@ApiModelProperty(value="描述", example = "测试")
|
||||||
protected String description;
|
protected String description;
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ public class ClusterConverter {
|
|||||||
ClusterPhyPO clusterPhyPO = ConvertUtil.obj2Obj(dto, ClusterPhyPO.class);
|
ClusterPhyPO clusterPhyPO = ConvertUtil.obj2Obj(dto, ClusterPhyPO.class);
|
||||||
clusterPhyPO.setClientProperties(ConvertUtil.obj2Json(dto.getClientProperties()));
|
clusterPhyPO.setClientProperties(ConvertUtil.obj2Json(dto.getClientProperties()));
|
||||||
clusterPhyPO.setJmxProperties(ConvertUtil.obj2Json(dto.getJmxProperties()));
|
clusterPhyPO.setJmxProperties(ConvertUtil.obj2Json(dto.getJmxProperties()));
|
||||||
|
if (ValidateUtils.isNull(dto.getZkProperties())) {
|
||||||
|
clusterPhyPO.setZkProperties("");
|
||||||
|
} else {
|
||||||
|
clusterPhyPO.setZkProperties(ConvertUtil.obj2Json(dto.getZkProperties()));
|
||||||
|
}
|
||||||
clusterPhyPO.setRunState(
|
clusterPhyPO.setRunState(
|
||||||
ValidateUtils.isBlank(dto.getZookeeper())?
|
ValidateUtils.isBlank(dto.getZookeeper())?
|
||||||
ClusterRunStateEnum.RUN_RAFT.getRunState() :
|
ClusterRunStateEnum.RUN_RAFT.getRunState() :
|
||||||
@@ -32,6 +37,11 @@ public class ClusterConverter {
|
|||||||
ClusterPhyPO clusterPhyPO = ConvertUtil.obj2Obj(dto, ClusterPhyPO.class);
|
ClusterPhyPO clusterPhyPO = ConvertUtil.obj2Obj(dto, ClusterPhyPO.class);
|
||||||
clusterPhyPO.setClientProperties(ConvertUtil.obj2Json(dto.getClientProperties()));
|
clusterPhyPO.setClientProperties(ConvertUtil.obj2Json(dto.getClientProperties()));
|
||||||
clusterPhyPO.setJmxProperties(ConvertUtil.obj2Json(dto.getJmxProperties()));
|
clusterPhyPO.setJmxProperties(ConvertUtil.obj2Json(dto.getJmxProperties()));
|
||||||
|
if (ValidateUtils.isNull(dto.getZkProperties())) {
|
||||||
|
clusterPhyPO.setZkProperties("");
|
||||||
|
} else {
|
||||||
|
clusterPhyPO.setZkProperties(ConvertUtil.obj2Json(dto.getZkProperties()));
|
||||||
|
}
|
||||||
clusterPhyPO.setRunState(
|
clusterPhyPO.setRunState(
|
||||||
ValidateUtils.isBlank(dto.getZookeeper())?
|
ValidateUtils.isBlank(dto.getZookeeper())?
|
||||||
ClusterRunStateEnum.RUN_RAFT.getRunState() :
|
ClusterRunStateEnum.RUN_RAFT.getRunState() :
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ CREATE TABLE `ks_km_physical_cluster` (
|
|||||||
`kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'kafka版本',
|
`kafka_version` varchar(32) NOT NULL DEFAULT '' COMMENT 'kafka版本',
|
||||||
`client_properties` text COMMENT 'Kafka客户端配置',
|
`client_properties` text COMMENT 'Kafka客户端配置',
|
||||||
`jmx_properties` text COMMENT 'JMX配置',
|
`jmx_properties` text COMMENT 'JMX配置',
|
||||||
|
`zk_properties` text COMMENT 'ZK配置',
|
||||||
`description` text COMMENT '备注',
|
`description` text COMMENT '备注',
|
||||||
`auth_type` int(11) NOT NULL DEFAULT '0' COMMENT '认证类型,-1未知,0:无认证,',
|
`auth_type` int(11) NOT NULL DEFAULT '0' COMMENT '认证类型,-1未知,0:无认证,',
|
||||||
`run_state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '运行状态, 0表示未监控, 1监控中,有ZK,2:监控中,无ZK',
|
`run_state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '运行状态, 0表示未监控, 1监控中,有ZK,2:监控中,无ZK',
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<result column="kafka_version" property="kafkaVersion" />
|
<result column="kafka_version" property="kafkaVersion" />
|
||||||
<result column="client_properties" property="clientProperties" />
|
<result column="client_properties" property="clientProperties" />
|
||||||
<result column="jmx_properties" property="jmxProperties" />
|
<result column="jmx_properties" property="jmxProperties" />
|
||||||
|
<result column="zk_properties" property="zkProperties" />
|
||||||
<result column="auth_type" property="authType" />
|
<result column="auth_type" property="authType" />
|
||||||
<result column="run_state" property="runState" />
|
<result column="run_state" property="runState" />
|
||||||
<result column="description" property="description" />
|
<result column="description" property="description" />
|
||||||
@@ -23,8 +24,8 @@
|
|||||||
useGeneratedKeys="true"
|
useGeneratedKeys="true"
|
||||||
keyProperty="id">
|
keyProperty="id">
|
||||||
INSERT INTO ks_km_physical_cluster
|
INSERT INTO ks_km_physical_cluster
|
||||||
(name, zookeeper, bootstrap_servers, kafka_version, client_properties, jmx_properties, description, auth_type, run_state)
|
(name, zookeeper, bootstrap_servers, kafka_version, client_properties, jmx_properties, zk_properties, description, auth_type, run_state)
|
||||||
VALUES
|
VALUES
|
||||||
(#{name}, #{zookeeper}, #{bootstrapServers}, #{kafkaVersion}, #{clientProperties}, #{jmxProperties}, #{description}, #{authType}, #{runState})
|
(#{name}, #{zookeeper}, #{bootstrapServers}, #{kafkaVersion}, #{clientProperties}, #{jmxProperties}, #{zkProperties}, #{description}, #{authType}, #{runState})
|
||||||
</insert>
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user