Cannot access Nifi Web UI after set nifi.web.http.host

4.4k Views Asked by At

I have a problem about Nifi Web UI. When I set nifi.web.http.host=luan-ht01, I could not access Nifi Web UI on browsers by public IP, example: http://localhost:8080/nifi/, http://107.113.193.160:8080/nifi. I only could access Nifi Web by host name. Do you have any solutions? Thank you very much.

2

There are 2 best solutions below

1
Andy On BEST ANSWER

Your experience is the expected behavior -- when you set the hostname explicitly, that is the address on which NiFi will respond. You can leave that property value blank to have NiFi respond on all available hosts, (i.e. localhost, 127.0.0.1, etc.). During startup, the $NIFI_HOME/logs/nifi-app.log file will show a listing like below, enumerating all listening hosts.

2378   │ 2019-06-18 14:25:20,738 INFO [main] org.apache.nifi.web.server.JettyServer NiFi has started. The UI is available at the following URLs:
2379   │ 2019-06-18 14:25:20,738 INFO [main] org.apache.nifi.web.server.JettyServer https://node1.nifi:9441/nifi
2381   │ 2019-06-18 14:25:20,740 INFO [main] org.apache.nifi.BootstrapListener Successfully initiated communication with Bootstrap
2382   │ 2019-06-18 14:25:20,740 INFO [main] org.apache.nifi.NiFi Controller initialization took 93674324706 nanoseconds (93 seconds).
1
Fisharp On

One quick work-around for you could be to create an "alias" for your localhost IP address to be named as your domain (just for testing purposes on your local environment, of course):

On GNU/Linux based systems, just edit (with sudo privileges) your /etc/hosts file, and add another line like that one for localhost:

/etc/hosts

127.0.0.1        localhost
127.0.0.1        luan-ht01

In Windows systems, the hosts file would (usually) be found at:

c:\Windows\System32\Drivers\etc\hosts

By doing so, you'll now be able to direct your browser to http://luan-ht01:8080/nifi and hopefully will be getting your web UI back.

Enjoy ;)