Spring 云数据流中使用不同于默认端口 (9393) 的组合任务

Composed Task using a different port than default (9393) in Spring Cloud Data Flow

我已经使用端口 8181 初始化了一个 Spring 数据流服务器,并且我一直在尝试 运行 使用这个特定服务器的组合任务。 当我尝试独立 运行 任务时,它们 运行 非常好,但是当我尝试 运行 它们在组合任务中时,它失败了。

详情如下:

正在初始化 Spring 云服务器:

java -jar spring-cloud-dataflow-server-local-1.5.2.RELEASE.jar \
    --spring.datasource.url=jdbc:mysql://0.0.0.0:3306/sdataflow \
    --spring.datasource.username=myUser\
    --spring.datasource.password=myPassword\
    --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver \
    --spring.cloud.dataflow.server.uri=http://0.0.0.0:8181 \
    --logging.level.org.springframework.cloud.task=DEBUG \
    --server.port=8181

运行 组合任务使用组合任务-运行ner:

java -jar composedtaskrunner-task-2.0.0.M1.jar --graph="A && B" --dataflow-server-uri="http://0.0.0.0:8181"

我也尝试过 运行 使用 UI 相同的组合任务,但我得到了完全相同的错误。出于某种原因,配置要求指向 http://localhost:9393 的资源。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataFlowOperations' defined in class path resource [org/springframework/cloud/dataflow/rest/client/config/DataFlowClientAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.dataflow.rest.client.DataFlowOperations]: Factory method 'dataFlowOperations' threw exception; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:9393": Unexpected end of file from server; nested exception is java.net.SocketException: Unexpected end of file from server
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean[=13=](AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.1.RELEASE.jar!/:2.0.1.RELEASE]
    at org.springframework.cloud.task.app.composedtaskrunner.ComposedtaskrunnerTaskApplication.main(ComposedtaskrunnerTaskApplication.java:29) [classes!/:2.0.0.M1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_172]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_172]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_172]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_172]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [composedtaskrunner-task-2.0.0.M1.jar:2.0.0.M1]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [composedtaskrunner-task-2.0.0.M1.jar:2.0.0.M1]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [composedtaskrunner-task-2.0.0.M1.jar:2.0.0.M1]

我们在 Composed Task Runner 的最新 1.1.1.RELEASE 中遇到了一个问题,其中 --dataflow-server-uri 属性 在运行时无法识别 [请参阅 spring-cloud-task-app-starters/composed-task-runner#39] .这很可能也是 2.0 M1 中的一个问题。我们将在下周的 2.0 GA (Dearborn.RELEASE) 中修复它。

同时,

您可以切换到 1.1.0.RELEASE(使用 --dataflow-server-uri 属性)或使用 DSL 中的完整形式 属性 --spring.cloud.dataflow.client.server-uri="http://0.0.0.0:8181"