package com.custom.samplejob;
import org.springframework.boot.CommandLineRunner;
import org.springframework.cloud.task.configuration.EnableTask;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableTask
public class TaskConfiguration {
@Bean
public CommandLineRunner commandLineRunner() {
return args -> {
System.out.println(args);
};
}
}
在当地的Maven Repo中放罐子。
mvn clean install
使用以下参数在Windows上本地运行自定义Docker-Compose,以运行弹簧云数据
com.custom:samplejob:0.0.1-SNAPSHOT
set HOST_MOUNT_PATH=C:\Users\user\.m2 (Local maven repository mounting)
set DOCKER_MOUNT_PATH=/root/.m2/
set DATAFLOW_VERSION=2.7.1
set SKIPPER_VERSION=2.6.1
docker-compose up
使用UI(UI下方)创建的任务并午餐任务。任务已成功启动。
app register --type task --name custom-task-trail-1 --uri maven://com.custom:samplejob:0.0.1-SNAPSHOT
这些是我在Docker-Compose终端中看到的日志,
http://localhost:9393/dashboard/#/tasks-jobs/tasks
但在任务执行列表中,它没有显示该任务执行的状态和启动日期和结束日期
可以帮助我解决这个问题,或者我在本地安装或任务Spring引导实现中缺少任何内容?
I在Docker桌面上启用了Kubernetes,并安装了Spring Data Flow服务器的顶部。 我尝试使用Docker Uri注册应用程序,并使用Jib-Maven-Plugin生成Docker映像。
现在它的作品在我的情况下示例任务应用程序。
在我的情况下,原因是云数据
dataflow-server | 2021-02-15 13:20:41.673 INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher : Preparing to run an application from com.custom:samplejob:jar:0.0.1-SNAPSHOT. This may take some time if the artifact must be downloaded from a remote host.
dataflow-server | 2021-02-15 13:20:41.693 INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher : Command to be executed: /usr/lib/jvm/jre-11.0.8/bin/java -jar /root/.m2/repository/com/custom/samplejob/0.0.1-SNAPSHOT/samplejob-0.0.1-SNAPSHOT.jar --name=dsdsds --spring.cloud.task.executionid=38
dataflow-server | 2021-02-15 13:20:41.702 INFO 1 --- [nio-9393-exec-9] o.s.c.d.spi.local.LocalTaskLauncher : launching task custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad
dataflow-server | Logs will be in /tmp/4921907601400/custom-task-trail-1-48794885-9a0a-4c46-a2a1-299bf91763ad
TASK_TASK_BATCH
TaskBatchExecutionListener