gpt4 book ai didi

Docker:引起:java.nio.file.FileSystemException:./conf/flow.xml.gz:资源忙

转载 作者:行者123 更新时间:2023-12-02 18:21:03 30 4
gpt4 key购买 nike

我在 docker-compose.yml 文件中定义了 Nifi 容器。我将默认的 Nifi 端口从 8080 更改为 8181。它工作正常。但是,我无法将 flow.xml.gz 复制到 Nifi 容器。

  nifi:
image: xemuliam/nifi
network_mode: "host"
ports:
- "8181:8181"
expose:
- "8181"
environment:
- NIFI_WEB_HTTP_PORT=8181
- NIFI_WEB_HTTP_HOST=0.0.0.0
volumes:
- ./src/data_flow_engine/flow.xml.gz:/opt/nifi/conf/flow.xml.gz
- ./src/data_flow_engine/bootstrap.conf:/opt/nifi/conf/bootstrap.conf

当我注释掉 - ./src/data_flow_engine/flow.xml.gz:/opt/nifi/conf/flow.xml.gz 时,它运行良好。

这是错误信息:

2018-11-02 12:49:47,818 INFO [main] org.eclipse.jetty.server.Server Started @41290ms
nifi_1 | 2018-11-02 12:49:47,818 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
nifi_1 | org.apache.nifi.web.NiFiCoreException: Unable to start Flow Controller.
nifi_1 | at org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:88)
nifi_1 | at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:876)
nifi_1 | at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
nifi_1 | at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:839)
nifi_1 | at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
nifi_1 | at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
nifi_1 | at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
nifi_1 | at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
nifi_1 | at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
nifi_1 | at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
nifi_1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
nifi_1 | at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
nifi_1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
nifi_1 | at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
nifi_1 | at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:290)
nifi_1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
nifi_1 | at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
nifi_1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
nifi_1 | at org.eclipse.jetty.server.Server.start(Server.java:452)
nifi_1 | at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
nifi_1 | at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
nifi_1 | at org.eclipse.jetty.server.Server.doStart(Server.java:419)
nifi_1 | at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
nifi_1 | at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:777)
nifi_1 | at org.apache.nifi.NiFi.<init>(NiFi.java:157)
nifi_1 | at org.apache.nifi.NiFi.<init>(NiFi.java:71)
nifi_1 | at org.apache.nifi.NiFi.main(NiFi.java:292)
nifi_1 | Caused by: java.nio.file.FileSystemException: ./conf/flow.xml.gz: Resource busy
nifi_1 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
nifi_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
nifi_1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
nifi_1 | at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
nifi_1 | at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
nifi_1 | at java.nio.file.Files.deleteIfExists(Files.java:1165)
nifi_1 | at org.apache.nifi.persistence.StandardXMLFlowConfigurationDAO.save(StandardXMLFlowConfigurationDAO.java:165)
nifi_1 | at org.apache.nifi.controller.StandardFlowService.load(StandardFlowService.java:536)
nifi_1 | at org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:72)
nifi_1 | ... 33 common frames omitted
nifi_1 | 2018-11-02 12:49:47,819 INFO [Thread-1] org.apache.nifi.NiFi Initiating shutdown of Jetty web server...
nifi_1 | 2018-11-02 12:49:47,820 INFO [Thread-1] o.eclipse.jetty.server.AbstractConnector Stopped ServerConnector@41d0b71d{HTTP/1.1,[http/1.1]}{0.0.0.0:8181}
nifi_1 | 2018-11-02 12:49:47,823 INFO [Thread-1] org.eclipse.jetty.server.session Stopped scavenging

最佳答案

映射 flow.xml.gz 文件似乎不起作用(我用 apache/nifi-1.8.0 测试并得到与你相同的结果)。

将整个 /conf 目录映射到容器中对我有用。这是我正在使用的 docker-compose 文件:

version: "3.5"

services:
nifi:
image: apache/nifi:1.8.0
ports:
- "8181:8080"
environment:
- NIFI_WEB_HTTP_HOST=0.0.0.0
volumes:
- ./conf:/opt/nifi/nifi-current/conf/

在这种情况下,我的本地 ./conf 目录是一个完整的 NiFi 配置目录,包含:

conf
├── authorizers.xml
├── bootstrap-notification-services.xml
├── bootstrap.conf
├── flow.xml.gz
├── logback.xml
├── login-identity-providers.xml
├── nifi.properties
├── state-management.xml
└── zookeeper.properties

如果您还没有可用作起点的 conf 目录,您可以通过将其从与您正在使用的 Docker 镜像版本相对应的 Apache 项目提供的便利二进制文件中复制出来来获取它。在我的示例中,我使用了来自 nifi.apache.org 的 nifi-1.8.0.zip 中的 conf 目录。 .请注意,该目录中的某些文件是 NiFi 在运行时在该目录中创建的。

关于Docker:引起:java.nio.file.FileSystemException:./conf/flow.xml.gz:资源忙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53119670/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com