ChrisSamo632 commented on PR #6658:
URL: https://github.com/apache/nifi/pull/6658#issuecomment-1426428989

   @gresockj thanks for the feedback
   
   The "Sniff on Failure" error looks to be due to a bug in the new code - I'd 
not added the `Sniffer` into the `SniffOnFailureListener`, so I've corrected 
that.
   
   Are you connecting to Elasticsearch over `http` or `https` (8.x comes with 
TLS out of the box, but can be turned off)?
   
   I've tried to cater for both protocols in this code, but quite possible 
there's a problem there. The Sniffer only returns the hostname and port number 
(no protocol) so we have to tell it whether to use `http` or `https` when 
generating the host URL - for this, I'm using the "first" of the specified 
`HTTP_HOSTS` and checking whether it starts with `https://` (otherwise assuming 
it's `http://`) - I'll add a note to the `Sniffer` property to indicate that 
all `HTTP_HOSTS` must use the same protocol (which I suspect NiFi and probably 
Elasticsearch would struggle with anyway if they didn't).
   
   Looking at the IP in your error message, I'm guessing you're running 
Elasticsearch as a Docker container, is NiFi running in the same Docker network 
(although if NiFi can connect to the same Elasticsearch instance when the 
Sniffer is **not** configured, then I suspect it's not a networking issue)?
   
   The Sniffer uses the `Nodes Info` API in Elasticsearch, the only 
[pre-requisite](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html#cluster-nodes-info-api-prereqs)
 for use is that if Elasticsearch Security is enabled (default to `true` in 
8.x) then the user connecting must have the `monitor` or `manage` [cluster 
privilege](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-cluster)
 to successfully list the cluster nodes - I'll note this in the `Sniffer` 
property too. But I'd expect that to throw a `403` (or similar) error response 
rather than causing a connection timeout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to