Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

What is the Hostname when using Apache NiFi in Cloudera for ListenHTTP/HandleHTTPRequest processors?

avatar
New Contributor

Hi! I am new in using Apache NiFi in Cloudera DataFlow. I am using NiFi 1.25.0.

I made a flow in local that listens to port 80 for HTTP requests and the hostname was ofc localhost but when trying to replicate it in Cloudera I don't know what hostname I have to use. Some say it is one of the nodes that the cluster has but my cluster have 4 nodes (which one to use?).

Is there a way to know what hostname I have to use to be able to reach the endpoint hosted in Cloudera by using Postman from my PC? Do I have to make some cluster/port forwarding/network configuration?

Thank you guys!

4 REPLIES 4

avatar
Community Manager

@carlosst Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @SAMSAL @MattWho  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Super Guru

Hi,

I dont think there is hostname property under ListenHttp and if there was at some point it probably got removed later on.  Regarding the hostname under HandleHttpRequest, its basically to specify which node you would like to receive the request on in case of cluster. If you specify certain node it will only allow connection to that node only however if you leave it empty  as the description says it will bind to all which mean you can send request using any node host name.

Hope that helps.

avatar
Master Mentor

@carlosst 

With a NiFi cluster, each node runs its ow copy of the flow.json.gz into memory on startup.
As such processors like listeners will when started create a listener on each node.

http://{NiFi node hostname}:{port}/contentListener

There is no property to set  the hostname as NiFi uses the hostname unique to each NiFi node here.  All you configure is the port (must be an unused, non-privileged (>1024) ) and Base path (default set to "contentListener").

So any requests received by the listener on a specific node will be processed by that specific node unless you programmatically via your flow redistributed those requests to other nodes via load balanced configured connection.

What is commonly done here is to have an external load-balancer in front of your NiFi cluster that handles distributing requests across all your listeners running on the different cluster nodes. 

NOTE: when using an external load-balancer in front of NiFi's UI URL, you must configured session affinity (sticky sessions) in that load balancer.  This is not necessary if you are only using the external LB for endpoints like listener since those end points do not use token based authentication)

Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

avatar
Community Manager

@carlosst Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: