赞
踩
最近一直在研究kafka,没前端只有在后端操作,所以整理一些操作命令,具体可在kafka官网查看
1. 获取所有Connector的列表
```
curl -X GET -H "Content-Type:application/json" kafkacluster-connect-headless:8083/connectors|jq
```
2. 创建一个Connector
```
curl -s -X PUT -H "Content-Type:application/json" --DATE @source.json kafkacluster-connect-headless:8083/connectors/mm2name/config
mm2name为config路径下的source文件中定义的同步任务名字
3.暂停pause,恢复resume,重启restart
curl -s -X PUT -H "Content-Type:application/json" --DATE @source.json kafkacluster-connect-headless:8083/connectors/mm2name/pause
重启可用POST方法
4.查看任务状态
curl -X GET -H "Content-Type:application/json" kafkacluster-connect-headless:8083/connectors/mm2name/status | jq
去掉status可查看配置
5.删除
curl -X DELETE -H "Content-Type:application/json" kafkacluster-connect-headless:8083/connectors/mm2name
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。