尝试使用下面的 REST API 远程运行 Flink 作业,但抛出错误
curl -X POST -H 'Content-Type: application/json' --data '
{
"type": "object",
"id": "urn:jsonschema:org:apache:flink:runtime:webmonitor:handlers:JarRunRequestBody",
"properties": {
"programArgsList" : {
"type" : "array",
"items" : [
"input-kafka-server": "****",
"input-kafka-topics": "****",
"input-job-name": "****"
}
}
}
' http://x.x.x.x:8081/jars/810ac968-5d5f-450d-aafc-22655238d617.jar/run
{“错误”:[“请求与预期格式 JarRunRequestBody 不匹配。”]}
您找到的 jar 运行处理程序的请求正文的描述here https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/rest_api.html is the JSON 模式规范 https://json-schema.org/jar 运行消息。您只需在请求中指定properties
而不是"type"
and "id"
字段。因此,您的请求应如下所示:
curl -X POST -H 'Content-Type: application/json' --data '
{
"programArgsList" : [
"--input-kafka-server",
"value-input-kafka-server",
"--input-kafka-topics",
"value-kafka-topics",
"--input-job-name",
"value-job-name"
],
"parallelism": 30
}
' http://x.x.x.x:8081/jars/810ac968-5d5f-450d-aafc-22655238d617.jar/run
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)