MiNiFi-如何获取处理器列表和排队的流文件数量?

时间:2019-05-22 21:36:09

标签: apache-nifi apache-minifi

我想监视正在运行的MiNiFi流的状态,尤其是要获取处理器列表和每个处理器的排队流文件数。我正在尝试使用FlowStatus Script Query,例如:

$ ./minifi.sh flowStatus systemdiagnostics:processorstats
{"controllerServiceStatusList":null,"processorStatusList":null,"connectionStatusList":null,"remoteProcessGroupStatusList":null,"instanceStatus":null,"systemDiagnosticsStatus":{"garbageCollectionStatusList":null,"heapStatus":null,"contentRepositoryUsageList":null,"flowfileRepositoryUsage":null,"processorStatus":{"loadAverage":1.99,"availableProcessors":2}},"reportingTaskStatusList":null,"errorsGeneratingReport":[]}

$ ./minifi.sh flowStatus processor:all:health,stats,bulletins
{"controllerServiceStatusList":null,"processorStatusList":[],"connectionStatusList":null,"remoteProcessGroupStatusList":null,"instanceStatus":null,"systemDiagnosticsStatus":null,"reportingTaskStatusList":null,"errorsGeneratingReport":[]}

$ /minifi.sh flowStatus processor:MyProcessorName:health,stats,bulletins
{"controllerServiceStatusList":null,"processorStatusList":[],"connectionStatusList":null,"remoteProcessGroupStatusList":null,"instanceStatus":null,"systemDiagnosticsStatus":null,"reportingTaskStatusList":null,"errorsGeneratingReport":["Unable to get status for request 'processor:MyProcessorName:health,stats,bulletins' due to:org.apache.nifi.minifi.status.StatusRequestException: No processor with key MyProcessorName to report status on"]}

但是我只收到空值。我应该怎么做才能检索想要的数据(在config中启用某些选项?)?是否可以使用flowStatus查询?我正在运行的流包含多个处理器,那么为什么systemdiagnostics仅显示两个availableProcessors,为什么我不能使用flowStatus processor命令来获取任何处理器数据?

不幸的是,NiFi / MiNiFi文档非常差,所以我什至不确定我是否可以通过这种方式检索处理器数据(排队元素的数量和处理器列表)。如果没有,也许您知道其他方法吗?

1 个答案:

答案 0 :(得分:1)

在此MiNiFi实例上运行的流中是否有任何处理器?您提交的查询的每个响应均不显示处理器。实际上,第三个示例对此进行了明确说明-"Unable to get status for request 'processor:MyProcessorName:health,stats,bulletins' due to:org.apache.nifi.minifi.status.StatusRequestException: No processor with key MyProcessorName to report status on"