Support Questions

Find answers, ask questions, and share your expertise

How to check on NiFi node health from an external system (e.g. load balancer)

avatar
Expert Contributor

Hi All,

How can an external system check on the health of the NiFi nodes in a cluster. For example, a load balancer that's pushing data to NiFi cluster nodes needs to know which nodes have NiFi up and running; what property/state/flag in the NiFi node can be leveraged to verify that the NiFi instance is running on the Node and can accept data from the load balancer.

Thanks

1 ACCEPTED SOLUTION

avatar
Rising Star

Hi @Raj B

One endpoint that gives a lot of metrics about current load, etc would be the system diagnostics REST endpoint. Depending on what else you're looking for (individual processor state, etc) there are other endpoints that might be useful.

REST documentation is available at https://nifi.apache.org/docs/nifi-docs/rest-api/ or from the help menu of a NiFi instance.

Thanks,

Bryan

View solution in original post

5 REPLIES 5

avatar
Rising Star

Hi @Raj B

One endpoint that gives a lot of metrics about current load, etc would be the system diagnostics REST endpoint. Depending on what else you're looking for (individual processor state, etc) there are other endpoints that might be useful.

REST documentation is available at https://nifi.apache.org/docs/nifi-docs/rest-api/ or from the help menu of a NiFi instance.

Thanks,

Bryan

avatar
Expert Contributor

Great, thanks @brosander

avatar
Rising Star

No problem, one thing to know about the REST api is that the url paths are all prefixed with /nifi-api

e.g.

For localhost 8080 system diagnostics, you'd want to hit:

http://localhost:8080/nifi-api/system-diagnostics

avatar
Expert Contributor

Hi @brosander, just want to clarify my understanding; if a GET request to the URL http://server:8080/nifi-api/system-diagnostics returns any data then the assumption is NiFi is up and running, and when no response is returned it is safe to conclude that NiFi on the node is not available. Is that right ?

Thanks

avatar
Expert Contributor

In case of a secure NiFi instance, you can check for heartbeat with this curl command below

curl 'https://<nifi-server>:8077/nifi-api/access/token' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'username=<username>&password=<password>' --compressed --insecure

if you get a token back, the NiFi instance is up and running.

Here is the link where this is posted/answered - https://community.hortonworks.com/questions/96713/nifi-api-unable-to-validate-the-access-token-error...