Re: Determine cluster primary node using REST API

2021-01-25 Thread James McMahon
Thank you Bryan and thank you Uwe. Good points. I’ll look closely at Pierre Villard’s article. Jim On Mon, Jan 25, 2021 at 3:02 PM Bryan Bende wrote: > In order to query the cluster to determine which is a good node to run > your check on, you need to know a good node to query for the cluster >

Re: Determine cluster primary node using REST API

2021-01-25 Thread Bryan Bende
In order to query the cluster to determine which is a good node to run your check on, you need to know a good node to query for the cluster status :) The load balancer approach makes the most sense since your script only needs to know the host/port of the load balancer, and then it will forward to

Re: Determine cluster primary node using REST API

2021-01-25 Thread u...@moosheimer.com
James, This is generally a bad practice to do it this way. You should use a reverse proxy that also acts as a load balancer. This way you only have to address a single address:port and always have a connect (as long as at least one node is up). Pierre Villard has written a good blogpost about thi

Re: Determine cluster primary node using REST API

2021-01-25 Thread James McMahon
Let me follow-up: so if I understand you correctly Bryan, your point is that I should direct the curl to a specific IP (or node name), and that will guarantee that ListenHttp generates only a single flowfile. Great... I agree. But I’d still need to verify the destination node was active and health

Re: Determine cluster primary node using REST API

2021-01-25 Thread Bryan Bende
It makes sense to only run the check on one node, but it shouldn't matter which node. Whatever is making the request to ListenHTTP (sounds like curl), can send to any node, as long it only sends to one of them, then you only go through the check once and get one email. The REST API for getting the

Re: Determine cluster primary node using REST API

2021-01-25 Thread Jon Logan
The best way I've found for finding the REST API for various information is to use the Browser Network tab when using the UI. It's usually fairly obvious when poking around that, and you can recreate the API call. You can also "copy as bash" out of it in Chrome, but you may have to clean it up a bi

Re: Determine cluster primary node using REST API

2021-01-25 Thread James McMahon
Hello Bryan. We run on Primary only because we are doing an end-to-end verification that our pipeline is available at the top of each hour, across several nifi links in a lengthy processing chain. We only want that done through one Node, not all N nodes in the cluster. It generates an alert email t

Re: Determine cluster primary node using REST API

2021-01-25 Thread Bryan Bende
I know this doesn't really answer your question, but is there a reason you are setting ListenHttp to run on primary node only and not all nodes? Typically you'd use "primary node only" for a source processing that is pulling data from somewhere and you only want it to happen once, otherwise you'd

Determine cluster primary node using REST API

2021-01-24 Thread James McMahon
I have a NiFi cluster, nifi version 1.8.n. I need to use curl from a bash shell script on a remote host to query for the primary node of the cluster at that moment. I understand there may be a NiFi REST API call I can make to do this, but have little experience integrating such a call in bash. Does