Search code examples
dockerapache-nifi

Running NiFi 2.0 using HTTP


I am trying to run a Docker container of Apache NiFi 2.0 using HTTP, but I am unable to do so

I have run this command:

docker run -d -p 8081:8081 -e NIFI_WEB_HTTP_PORT=8081 apache/nifi:2.0.0

But every time in logs, I get the following:

INFO [main] org.apache.nifi.web.server.JettyServer Started Server on https://18b74a249482:8443/nifi

A few days back, even running docker run -d -P apache/nifi:2.0.0 was working fine, but now it is not


Solution

  • I could not run the NiFi on HTTP, but could run it on HTTPS using the following steps:

    1. Set NIFI_WEB_HTTPS_HOST=0.0.0.0 in my Dockerfile as an environment variable
    2. Set NIFI_REMOTE_INPUT_HOST=0.0.0.0 in my Dockerfile as an environment variable
    3. Set CMD ["./bin/nifi.sh", "run"] in my Dockerfile
    4. Created a container using the image (local_nifi:v2.0.0) with the command docker run -d -p 8443:8443 local_nifi:v2.0.0
    5. Created an SSH tunnel with my local system (Windows) using ssh -L 0.0.0.0:8443:127.0.0.1:8443 <user>@<ip>
    6. Ran https://localhost:8443/nifi in my browser and input the generated username and password (run docker logs <container id> | grep Generated to acquire the credentials)