我对 Nifi Web UI 有疑问。当我设置 nifi.web.http.host=luan-ht01 时,我无法通过公共 IP 在浏览器上访问 Nifi Web UI,例如:http://localhost:8080/nifi/ , http://107.113.193.160:8080 /尼菲。我只能通过主机名访问 Nifi Web。你有什么解决办法?非常感谢。
问问题
2230 次
2 回答
1
您的体验是预期的行为——当您明确设置主机名时,这就是 NiFi 将响应的地址。您可以将该属性值留空,以使 NiFi 在所有可用主机上做出响应(即localhost
,127.0.0.1
等)。在启动期间,该$NIFI_HOME/logs/nifi-app.log
文件将显示如下列表,枚举所有侦听主机。
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).
于 2019-07-01T18:03:36.387 回答
0
一种快速的解决方法是为您的 localhost IP 地址创建一个“别名”,以命名为您的域(当然,仅用于在本地环境中进行测试):
在基于 GNU/Linux 的系统上,只需编辑(使用sudo
特权)您的/etc/hosts
文件,然后为 localhost 添加另一行:
/etc/hosts
127.0.0.1 localhost
127.0.0.1 luan-ht01
在 Windows 系统中,hosts文件(通常)位于:
c:\Windows\System32\Drivers\etc\hosts
通过这样做,您现在可以将您的浏览器定向到http://luan-ht01:8080/nifi
并有望恢复您的 Web UI。
享受 ;)
于 2019-06-29T03:22:50.310 回答