移除topic 限流
This commit is contained in:
@@ -78,6 +78,8 @@ sh bin/shutdown.sh
|
||||
## 注意
|
||||
前后分离,直接启动后端如果未编译前端代码是没有前端页面的,可以先打包进行编译`sh package.sh`,然后再用idea启动,或者前端部分单独启动
|
||||
# 页面示例
|
||||
如果未启用ACL配置,不会显示ACL的菜单页面,所以导航栏上没有Acl这一项
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
@@ -157,6 +157,7 @@ public class TopicServiceImpl implements TopicService {
|
||||
tuple2 = topicConsole.configThrottle(topic, partitions);
|
||||
break;
|
||||
case OFF:
|
||||
tuple2 = topicConsole.clearThrottle(topic);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("switch is unknown.");
|
||||
|
||||
@@ -224,6 +224,16 @@ class TopicConsole(config: KafkaConfig) extends KafkaConsole(config: KafkaConfig
|
||||
}).asInstanceOf[(Boolean, String)]
|
||||
}
|
||||
|
||||
def clearThrottle(topic: String): (Boolean, String) = {
|
||||
withAdminClientAndCatchError(admin => {
|
||||
clearTopicLevelThrottles(admin, Collections.singleton(topic).asScala.toSet)
|
||||
(true, "")
|
||||
}, e => {
|
||||
log.error("clearThrottle error, ", e)
|
||||
(false, e.getMessage)
|
||||
}).asInstanceOf[(Boolean, String)]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current replica assignments for some topics.
|
||||
*
|
||||
|
||||
@@ -18,7 +18,23 @@
|
||||
:label-col="{ span: 5 }"
|
||||
:wrapper-col="{ span: 12 }"
|
||||
>
|
||||
<a-form-item label="选择分区">
|
||||
<a-form-item label="操作">
|
||||
<a-radio-group
|
||||
@change="onChange"
|
||||
v-decorator="[
|
||||
'operation',
|
||||
{
|
||||
initialValue: 'ON',
|
||||
rules: [{ required: true, message: '请选择一个操作!' }],
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-radio value="ON"> 配置限流 </a-radio>
|
||||
<a-radio value="OFF"> 移除所有分区限流配置 </a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="选择分区" v-show="showPartition">
|
||||
<a-select
|
||||
mode="multiple"
|
||||
option-filter-prop="children"
|
||||
@@ -36,20 +52,6 @@
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="操作">
|
||||
<a-radio-group
|
||||
v-decorator="[
|
||||
'operation',
|
||||
{
|
||||
initialValue: 'ON',
|
||||
rules: [{ required: true, message: '请选择一个操作!' }],
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-radio value="ON"> 开启限流配置 </a-radio>
|
||||
<a-radio value="OFF"> 移除限流配置 </a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<hr />
|
||||
<h4>说明:</h4>
|
||||
@@ -93,6 +95,7 @@ export default {
|
||||
loading: false,
|
||||
form: this.$form.createForm(this, { name: "RemoveThrottleForm" }),
|
||||
partitions: [],
|
||||
showPartition: true,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -100,6 +103,7 @@ export default {
|
||||
this.show = v;
|
||||
if (this.show) {
|
||||
this.getPartitionInfo();
|
||||
this.showPartition = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -128,7 +132,7 @@ export default {
|
||||
ok() {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
const data = Object.assign({}, values, {topic: this.topic});
|
||||
const data = Object.assign({}, values, { topic: this.topic });
|
||||
this.loading = true;
|
||||
request({
|
||||
url: KafkaTopicApi.configThrottle.url,
|
||||
@@ -149,6 +153,9 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
onChange(e) {
|
||||
this.showPartition = !(e.target.value == "OFF");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
<span style="color: red">运维->副本变更详情</span>
|
||||
处查看,也可以在那里将正在进行的任务取消。
|
||||
</p>
|
||||
<p>
|
||||
*如果是减少副本,不用限流。如果是增加副本数,副本同步的时候如果有大量消息需要同步,可能占用大量带宽,担心会影响集群的稳定,考虑是否开启限流。同步完成可以再把该topic的限流关毕。关闭操作可以点击
|
||||
限流按钮 处理。
|
||||
</p>
|
||||
</a-spin>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
Reference in New Issue
Block a user