【问题标题】:Docker NiFi not connect with other network.Docker NiFi 无法与其他网络连接。
【发布时间】:2018-02-17 22:37:32
【问题描述】:

我设置了新的远程服务器(ubuntu 16.04.3)以在 docker 上使用 NiFi,如下所示。

$ curl -fsSL https://get.docker.com/ | sudo sh
$ docker pull apache/nifi
$ docker run --name nifi \
  -p 8080:8080 \
  -d \
  apache/nifi:latest

我使用 $ docker ps 检查了它 when I using $docker ps

但我无法使用http://xxx.xxx.xxx.xxx/nifi 访问 它是 ERR_CONNECTION_REFUSED。

我检查了80端口,但它已经打开了

在这种情况下我该怎么办?

【问题讨论】:

  • 你正在将 docker 容器端口映射到 8080,所以你必须在你的 url 中使用它:xxx.xxx.xxx.xxx:8080/nifi
  • 抱歉,我错过了端口号。但我已经尝试过 xxx.xxx.xxx.xxx:8080/nifi 但它没有用。我应该设置一些需求设置吗?

标签: docker apache-nifi


【解决方案1】:

作为新的安全检查的一部分,您必须告诉 NiFi 它应该期待哪个端口和主机名,使用 docker 执行此操作的最简单方法是传入适当的环境变量。
这些在readme on the apache/nifi Dockerhub page 中有概述,但为方便起见,我将它们粘贴在这里:

docker run --name nifi \
-p 8080:8080 \
-d \
-e NIFI_WEB_HTTP_PORT='8080' \
-e NIFI_WEB_HTTP_HOST='<your hostname or ip>' \
apache/nifi:latest

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-10
    • 1970-01-01
    • 1970-01-01
    • 2018-11-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多