0

I'm trying to stand up a temporary NiFi server to support a proof of concept demo for a customer. For these types of short lived servers I like to use Docker when possible. I'm able to get the NiFi container up and running with out any issues but I can't figure out how to access its UI from the browser on a remote host. I've tried the following docker run variations:

docker run --name nifi \ -p 8080:8080 \ -d \ apache/nifi:latest


docker run --name nifi \ -p 8080:8080 \ -e NIFI_WEB_HTTP_PORT='8080' \ -d \ apache/nifi:latest


docker run --name nifi \ -p 8080:8080 \ -e NIFI_WEB_HTTP_HOST=${hostname-here} \ -e NIFI_WEB_HTTP_PORT='8080' \ -d \ apache/nifi:latest

My NiFi version is 1.8.0. I'm fairly certain that my problems are related to the host-headers blocker feature added to version 1.5.0. I've seen a few questions similar to mine but no solutions. Is it possible to access the NiFi UI from a remote host after version 1.5.0? Can host-headers blocker be disabled for a non-prod demo? Would a non-Docker install on my server present the same host-headers blocker issues? Should a use 1.4 for my demo and save myself a headache?

rennyB
  • 143
  • 3
  • 10

2 Answers2

1

While there was a bug around 1.5.0 surrounding the host headers in Docker that issue was resolved and, additionally, the host header check now is only enforced for secured environments (you will see a note about this in the logs on container startup).

The commands you provide in your question are all workable for accessing NiFi on the associated mapped port in each example and I have verified this in 1.6.0, 1.7.0, and 1.8.0. You may want to evaluate the network security settings of your remote machine in question (cloud provided instances, for example. will typically require explicit security groups exposing ports).

apiri
  • 1,635
  • 9
  • 15
  • I'll take a closer look at the docker host's security setting. I had dismissed this as a possibility due to other web apps working on the same docker instance without issue. Thanks for the suggestion, I'll comment again if I get it working. – rennyB Oct 29 '18 at 20:04
  • I'm embraced to say that I think my NiFi docker was working the whole time. It just takes a very long time to start up, even after the logs say jetty in running. Maybe 10 minutes in my case. When I run the application on my laptop it just takes seconds to start up. – rennyB Oct 29 '18 at 21:57
  • Hey @rennyB, unfortunately the container (and NiFi itself) do take a while to start on its initial run. There are several NARs (NiFi specific jars) that must get unpacked when first started which is common practice in container land. This is further exacerbated by slow/shared disks. Shipping the container with all these jars unpacked would greatly increase container size. – apiri Oct 29 '18 at 22:17
0

I had the same issue, I was not able to access the web ui remotely. Turns out the firewall issue. Disabling the firewalld & adding a custom firewall rule to allow docker network with port should solve the issue.

The docker-compose.yml is shared here

Maqbool Ahmed
  • 316
  • 2
  • 7