首页 > 解决方案 > 使用 Nifi API REST 创建控制器服务

问题描述

我正在尝试使用 nifi api rest 创建控制器服务,但我被阻止了,因为当我尝试时:

调用HTTP POST https://hostname/nifi-api/controller/controller-services

使用这个 json

{
  "revision": {
    "version": 0
  },
  "disconnectedNodeAcknowledged": false,
  "component": {
    "name": "DMCS_try",
    "type": "org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer",
    "bundle": {
      "group": "org.apache.nifi",
      "artifact": "nifi-distributed-cache-services-nar",
      "version": "1.9.0.3.4.1.1-4"
    },
    "state": "ENABLED",
    "properties": {
      "Port": "4555",
      "Maximum Cache Entries": "10000",
      "Eviction Strategy": null,
      "Persistence Directory": null,
      "SSL Context Service": null
    }
}
}

我得到了这个“错误”

Node XXXXXXXXX is unable to fulfill this request due to: Unable to modify the controller. Contact the system administrator. Contact the system administrator.

标签: apiapache-nifi

解决方案


控制器服务可以在两个不同的地方创建。一个地方是流程组的一部分,因此它们可以被处理器使用,另一个地方是控制器级别,供报告任务使用。

您指定的 URL 用于在控制器级别创建服务,因此无论您使用什么身份进行身份验证都需要修改控制器的权限(在 /controller 上写入)。错误消息是说您没有该权限。


推荐阅读