微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 Docker Compose 部署 SCDF 应用程序的异常

如何解决使用 Docker Compose 部署 SCDF 应用程序的异常

我在 WSL 上的 Ubuntu 20.04 中使用 Docker Compose 运行 SCDF。我可以使用启动源/接收器创建和部署流而不会出现问题,但是在尝试部署自定义 Spring Cloud Stream 应用程序时,会发生以下情况,我不确定如何解决

dataflow:>app register --name order-source --type source --uri docker://*******/****:order-producer
Successfully registered application 'source:order-source'
dataflow:>stream create ordering-stream --deFinition "order-source | log"
Created new stream 'ordering-stream'
dataflow:>stream deploy ordering-stream

Command Failed org.springframework.cloud.dataflow.rest.client.DataFlowClientException: SkipperException
SkipperException
org.springframework.cloud.dataflow.rest.client.DataFlowClientException: SkipperException
    at org.springframework.cloud.dataflow.rest.client.VndErrorResponseErrorHandler.handleError(VndErrorResponseErrorHandler.java:65)
    at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:780)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:738)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:672)
    at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:416)
    at org.springframework.cloud.dataflow.rest.client.StreamTemplate.deploy(StreamTemplate.java:141)
    at org.springframework.cloud.dataflow.shell.command.StreamCommands.deployStream(StreamCommands.java:167)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282)
    at org.springframework.shell.core.SimpleExecutionStrategy.invoke(SimpleExecutionStrategy.java:68)
    at org.springframework.shell.core.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:59)
    at org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:134)
    at org.springframework.shell.core.jlineShell.promptLoop(jlineShell.java:533)
    at org.springframework.shell.core.jlineShell.run(jlineShell.java:179)
    at java.lang.Thread.run(Thread.java:748)

此船长服务器异常包括

 Caused by: java.io.IOException: Cannot run program "docker" (in directory "/tmp/1627185411996/ordering-stream.order-source-v1"): error=2,No such file or directory

如果有帮助,我可以包含详细的服务器输出

解决方法

我能够通过使用 Uri = file:///root/scdf/order-service-0.0.1-SNAPSHOT.jar 在本地引用应用程序的 jar 文件来解决问题。 docker-compose.yml 文件也需要与 jar 文件位于同一目录中(在本例中为 ~/scdf)。我仍然不确定为什么 Docker Hub Uri 引用失败,因为 docker 正在为 SCDF、Docker Compose 中的所有其他服务以及其他地方工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。