0
votes

So I am having difficulties sending a curl request to Hive. I want to take the json flow-file that I have created and send it as a command to Hive but I keep getting errors when I try to configure InvokeHTTP processor. For reference here is my workflow as it currently stands. Replace Text-> Update Attributes - > InvokeHTTP->Put processor

I have tried mostly to get InvokeHTTP processor to work. The configurations that I have are: 1.HTTP Method: POST 2.Remote URL: ${https://hive-prod-1.sample_text/alert} 3.SSL Context Service: StandardSSLContext Service 4.Proxy Type: https -Content-type: application/json

I then added a property 5.curl: curl-XPOST-H"Authorization: Bearer xWJbexxxxxxxx -H "Content-Type: application/json'

I am not sure if my configuration is incorrect or if there is another issue going on.

When I tried to use/configure ExecuteStreamCommand: 1.Command Arguments: curl-XPOST-H"Authorization xxxxx -H "Content-type: application/json 2.Command Path: application/json Argument Delimiter: ;

Again, I am not sure if the configuration if correct for either of these processors or if it has something to do with a cert. When I run it I also get the error message 'java.lang.illegalstateexception: trustmanagerfactory =is not initialized.

1

1 Answers

1
votes

It sounds as if you have not successfully/completely configured the SSLContextService which is required for InvokeHTTP when connecting to a service which uses TLS. Your Hive instance is protected with TLS, so you need to obtain the public certificate of the Hive instance (you can do this via a browser, using openssl s_client, etc.), load the public certificate into a Java Keystore (JKS) formatted truststore file as a trustedCertEntry, and then point the SSLContextService to that truststore file. For more information, look at the first section of Tomas Zezula's article on NiFi SSL configuration.