營銷型網(wǎng)站建設(shè)便宜數(shù)字營銷公司排行榜
分布式調(diào)度 Elastic-job
1.概述
1.1什么是任務調(diào)度
我們可以思考一下下面業(yè)務場景的解決方案:
- 某電商平臺需要每天上午10點,下午3點,晚上8點發(fā)放一批優(yōu)惠券
- 某銀行系統(tǒng)需要在信用卡到期還款日的前三天進行短信提醒
- 某財務系統(tǒng)需要在每天凌晨0:10分結(jié)算前一天的財務數(shù)據(jù),統(tǒng)計匯總
以上場景就是任務調(diào)度所需要解決的問題
任務調(diào)度是為了自動完成特定任務,在約定的特定時刻去執(zhí)行任務的過程
我們在之前騾窩窩項目的學習中,使用過 Spring 中提供的定時任務注解 @Scheduled
在業(yè)務類中方法中貼上這個注解
@Scheduled(cron = "0/20 * * * * ?")public void doWork(){//doSomething }
然后在啟動類上貼上@EnableScheduling
注解
1.2 為什么需要分布式調(diào)度
感覺Spring給我們提供的這個注解可以完成任務調(diào)度的功能,好像已經(jīng)完美解決問題了,為什么還需要分布式呢?
主要有如下這幾點原因:
1.單機處理極限:原本1分鐘內(nèi)需要處理1萬個訂單,但是現(xiàn)在需要1分鐘內(nèi)處理10萬個訂單;原來一個統(tǒng)計需要1小時,現(xiàn)在業(yè)務方需要10分鐘就統(tǒng)計出來。你也許會說,你也可以多線程、單機多進程處理。的確,多線程并行處理可以提高單位時間的處理效率,但是單機能力畢竟有限(主要是CPU、內(nèi)存和磁盤),始終會有單機處理不過來的情況。
2.高可用:單機版的定式任務調(diào)度只能在一臺機器上運行,如果程序或者系統(tǒng)出現(xiàn)異常就會導致功能不可用。雖然可以在單機程序?qū)崿F(xiàn)的足夠穩(wěn)定,但始終有機會遇到非程序引起的故障,而這個對于一個系統(tǒng)的核心功能來說是不可接受的。
3.防止重復執(zhí)行: 在單機模式下,定時任務是沒什么問題的。但當我們部署了多臺服務,同時又每臺服務又有定時任務時,若不進行合理的控制在同一時間,只有一個定時任務啟動執(zhí)行,這時,定時執(zhí)行的結(jié)果就可能存在混亂和錯誤了
這個時候就需要分布式的任務調(diào)度來實現(xiàn)了。
1.3 Elastic-Job 介紹
Elastic-Job 是一個分布式調(diào)度的解決方案,由當當網(wǎng)開源,它由兩個相互獨立的子項目 Elastic-job-Lite 和 Elastic-Job-Cloud 組成,使用Elastic-Job可以快速實現(xiàn)分布式任務調(diào)度。
Elastic-Job的地址: https://shardingsphere.apache.org/elasticjob/
功能列表:
-
分布式調(diào)度協(xié)調(diào)
在分布式環(huán)境中,任務能夠按照指定的調(diào)度策略執(zhí)行,并且能夠避免同一任務多實例重復執(zhí)行。
-
豐富的調(diào)度策略:
基于成熟的定時任務作業(yè)框架Quartz cron表達式執(zhí)行定時任務。
-
彈性拓容縮容
當集群中增加一個實例,它應當能夠被選舉被執(zhí)行任務;當集群減少一個實例時,他所執(zhí)行的任務能被轉(zhuǎn)移到別的示例中執(zhí)行。
-
失效轉(zhuǎn)移
某示例在任務執(zhí)行失敗后,會被轉(zhuǎn)移到其他實例執(zhí)行。
-
錯過執(zhí)行任務重觸發(fā)
若因某種原因?qū)е伦鳂I(yè)錯過執(zhí)行,自動記錄錯誤執(zhí)行的作業(yè),并在下次次作業(yè)完成后自動觸發(fā)。
-
支持并行調(diào)度
支持任務分片,任務分片是指將一個任務分成多個小任務在多個實例同時執(zhí)行。
-
作業(yè)分片一致性
當任務被分片后,保證同一分片在分布式環(huán)境中僅一個執(zhí)行實例。
-
支持作業(yè)生命周期操作
可以動態(tài)對任務進行開啟及停止操作。
-
豐富的作業(yè)類型
支持Simple、DataFlow、Script三種作業(yè)類型
系統(tǒng)架構(gòu)圖
2.Elastic-Job快速入門
2.1 環(huán)境搭建
2.1.1 版本要求
- JDK 要求1.7以上保本
- Maven 要求3.0.4及以上版本
- Zookeeper 要求采取3.4.6以上版本
2.1.2 Zookeeper安裝&運行
2.1.3 創(chuàng)建Maven項目
添加如下依賴
<dependency><groupId>com.dangdang</groupId><artifactId>elastic-job-lite-core</artifactId><version>2.1.5</version>
</dependency>
2.2 代碼實現(xiàn)
2.2.1 任務類
public class MyElasticJob implements SimpleJob {public void execute(ShardingContext shardingContext) {System.out.println("定時任務開始====>"+new Date());}
}
2.2.2 配置類
public class JobDemo {public static void main(String[] args) {new JobScheduler(createRegistryCenter(), createJobConfiguration()).init();}private static CoordinatorRegistryCenter createRegistryCenter() {//配置zk地址,調(diào)度任務的組名ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration("localhost:2181", "elastic-job-demo");zookeeperConfiguration.setSessionTimeoutMilliseconds(100);CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);regCenter.init();return regCenter;}private static LiteJobConfiguration createJobConfiguration() {// 定義作業(yè)核心配置JobCoreConfiguration simpleCoreConfig = JobCoreConfiguration.newBuilder("demoSimpleJob","0/3 * * * * ?",1).build();// 定義SIMPLE類型配置SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(simpleCoreConfig, MyElasticJob.class.getCanonicalName());// 定義Lite作業(yè)根配置LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).build();return simpleJobRootConfig;}
}
2.2.3 測試
- 運行單個程序,查看是否按照cron表達式的內(nèi)容進行任務的調(diào)度
- 運行多個程序,查看是否只會有一個實例進行任務調(diào)度
- 運行多個程序后,把正在進行任務調(diào)度的進程關(guān)掉,查看其它進程是否能繼續(xù)進行任務調(diào)度
3.SpringBoot集成Elastic-Job
3.1 添加Maven依賴
<groupId>cn.wolfcode</groupId><artifactId>elastic-job-springboot</artifactId><version>1.0.0</version><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.1.3.RELEASE</version></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>com.dangdang</groupId><artifactId>elastic-job-lite-spring</artifactId><version>2.1.5</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency></dependencies>
3.2 相關(guān)配置
因為配置中心的地址并不是固定的,所以我們應該把這個地址信息配置在配置文件中,所以在配置文件application.yml中添加配置如下:
elasticjob:zookeeper-url: localhost:2181group-name: elastic-job-group
zk注冊中心配置類:
@Configuration
public class RegistryCenterConfig {@Bean(initMethod = "init")public CoordinatorRegistryCenter createRegistryCenter(@Value("${elasticjob.zookeeper-url}") String zookeeperUrl,@Value("${elasticjob.group-name}") String groupName) {//zk的配置ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(zookeeperUrl,groupName);//設(shè)置zk超時時間zookeeperConfiguration.setSessionTimeoutMilliseconds(100);//創(chuàng)建注冊中心CoordinatorRegistryCenter zookeeperRegistryCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);return zookeeperRegistryCenter;}
}
任務調(diào)度配置類
@Configuration
public class ElasticJobConfig {@Autowiredprivate MyElasticJob myElasticJob;@Autowiredprivate CoordinatorRegistryCenter registryCenter;private static LiteJobConfiguration createJobConfiguration(final Class<? extends SimpleJob> jobClass,final String cron,final int shardingTotalCount,final String shardingItemParameters) {// 定義作業(yè)核心配置JobCoreConfiguration.Builder jobCoreConfigurationBuilder = JobCoreConfiguration.newBuilder(jobClass.getSimpleName(), cron, shardingTotalCount);if(!StringUtils.isEmpty(shardingItemParameters)){jobCoreConfigurationBuilder.shardingItemParameters(shardingItemParameters);}// 定義SIMPLE類型配置SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(jobCoreConfigurationBuilder.build(), MyElasticJob.class.getCanonicalName());// 定義Lite作業(yè)根配置LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(simpleJobConfig).overwrite(true).build();return simpleJobRootConfig;}@Bean(initMethod = "init")public SpringJobScheduler initSimpleElasticJob(){SpringJobScheduler springJobScheduler = new SpringJobScheduler(myElasticJob,registryCenter,createJobConfiguration(jobClass,"0/3 * * * * ?",1,null));return springJobScheduler;}
}
4.案例需求
需求:數(shù)據(jù)庫中有一些列的數(shù)據(jù),需要對這些數(shù)據(jù)進行備份操作,備份完之后,修改數(shù)據(jù)的狀態(tài),標記已經(jīng)備份了。
4.1 初始化數(shù)據(jù)
在數(shù)據(jù)庫中導入elastic-job-demo.sql
數(shù)據(jù)
4.2 集成Druid&MyBatis
4.2.1 添加依賴
<dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1.10</version></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>1.2.0</version></dependency><!--mysql驅(qū)動--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency>
4.2.2 添加配置
spring:datasource:url: jdbc:mysql://localhost:3306/elastic-job-demo?serverTimezone=GMT%2B8driverClassName: com.mysql.jdbc.Drivertype: com.alibaba.druid.pool.DruidDataSourceusername: rootpassword: admin
4.2.3 添加實體類
@Data
public class FileCustom {//唯一標識private Long id;//文件名private String name;//文件類型private String type;//文件內(nèi)容private String content;//是否已備份private Boolean backedUp = false;public FileCustom(){}public FileCustom(Long id, String name, String type, String content){this.id = id;this.name = name;this.type = type;this.content = content;}
}
4.2.4 添加Mapper處理類
@Mapper
public interface FileCustomMapper {@Select("select * from t_file_custom where backedUp = 0")List<FileCustom> selectAll();@Update("update t_file_custom set backedUp = #{state} where id = #{id}")int changeState(@Param("id") Long id, @Param("state")int state);
}
4.3 業(yè)務功能實現(xiàn)
4.3.1 添加任務類
@Component
public class FileCustomElasticJob implements SimpleJob {@Autowiredprivate FileCustomMapper fileCustomMapper;@Overridepublic void execute(ShardingContext shardingContext) {doWork();}private void doWork(){List<FileCustom> fileList = fileCustomMapper.selectAll();System.out.println("需要備份文件個數(shù):"+fileList.size());for(FileCustom fileCustom:fileList){backUpFile(fileCustom);}}private void backUpFile(FileCustom fileCustom){try {//模擬備份動作TimeUnit.SECONDS.sleep(1);} catch (InterruptedException e) {e.printStackTrace();}System.out.println("執(zhí)行文件備份====>"+fileCustom);fileCustomMapper.changeState(fileCustom.getId(),1);}
}
4.3.2 添加任務調(diào)度配置
在配置類中新增這個Bean
@Bean(initMethod = "init")public SpringJobScheduler initFileCustomElasticJob(FileCustomElasticJob fileCustomElasticJob){SpringJobScheduler springJobScheduler = new SpringJobScheduler(fileCustomElasticJob,registryCenter,createJobConfiguration(FileCustomElasticJob.class,"0 0/1 * * * ?",1,null));return springJobScheduler;}
4.4 測試&問題
為了高可用,我們會對這個項目做集群的操作,可以保證其中一臺掛了,另外一臺可以繼續(xù)工作.但是在集群的情況下,調(diào)度任務只在一臺機器上運行,如果單個任務調(diào)度比較耗時,耗資源的情況下,對這臺機器的消耗還是比較大的,
但是這個時候,其他機器卻是空閑著的.如何合理的利用集群的其他機器且如何讓任務執(zhí)行得更快些呢?這時候Elastic-Job提供了任務調(diào)度分片的功能.
5.分片概念
? 作業(yè)分片是指任務的分布式執(zhí)行,需要將一個任務拆分為多個獨立的任務項,然后由分布式的應用實例分別執(zhí)行某一個或者幾個分布項。
? 例如:Elastic-Job快速入門中文件備份的案例,現(xiàn)有兩臺服務器,每臺服務器分別跑一個應用實例。為了快速執(zhí)行作業(yè),那么可以講任務分成4片,每個應用實例都執(zhí)行兩片。作業(yè)遍歷數(shù)據(jù)邏輯應為:實例1查找text和image類型文件執(zhí)行備份,實例2查找radio和vedio類型文件執(zhí)行備份。如果由于服務器拓容應用實例數(shù)量增加為4,則作業(yè)遍歷數(shù)據(jù)的邏輯應為: 4個實例分別處理text,image,radio,video類型的文件。
? 可以看到,通過對任務的合理分片化,從而達到任務并行處理的效果.
分片項與業(yè)務處理解耦
? Elastic-Job并不直接提供數(shù)據(jù)處理的功能,框架只會將分片項分配至各個運行中的作業(yè)服務器,開發(fā)者需要自行處理分片項與真實數(shù)據(jù)的對應關(guān)系
最大限度利用資源
將分片項設(shè)置大于服務器的數(shù)據(jù),最好是大于服務器倍數(shù)的數(shù)量,作業(yè)將會合理利用分布式資源,動態(tài)的分配分片項.
? 例如: 3臺服務器,分成10片,則分片項結(jié)果為服務器A=0,1,2;服務器B=3,4,5;服務器C=6,7,8,9.如果 服務器C奔潰,則分片項分配結(jié)果為服務器A=0,1,2,3,4;服務器B=5,6,7,8,9.在不丟失分片項的情況下,最大限度利用現(xiàn)有的資源提高吞吐量.
6.案例改造成任務分片
6.1 配置類修改
在任務配置類中增加分片個數(shù)以及分片參數(shù).
@Bean(initMethod = "init")public SpringJobScheduler initFileCustomElasticJob(FileCustomElasticJob fileCustomElasticJob){SpringJobScheduler springJobScheduler = new SpringJobScheduler(fileCustomElasticJob,registryCenter,createJobConfiguration(FileCustomElasticJob.class,"0 0/1 * * * ?",4,"0=text,1=image,2=radio,3=vedio"));return springJobScheduler;}
6.2 新增作業(yè)分片邏輯
@Component
public class FileCustomElasticJob implements SimpleJob {@Autowiredprivate FileCustomMapper fileCustomMapper;@Overridepublic void execute(ShardingContext shardingContext) {doWork(shardingContext.getShardingParameter());}private void doWork(String fileType){List<FileCustom> fileList = fileCustomMapper.selecByType(fileType);System.out.println("類型為:"+fileType+",文件,需要備份個數(shù):"+fileList.size());for(FileCustom fileCustom:fileList){backUpFile(fileCustom);}}private void backUpFile(FileCustom fileCustom){try {//模擬備份動作TimeUnit.SECONDS.sleep(1);} catch (InterruptedException e) {e.printStackTrace();}System.out.println("執(zhí)行文件備份====>"+fileCustom);fileCustomMapper.changeState(fileCustom.getId(),1);}
}
6.3 Mapper類修改
@Mapper
public interface FileCustomMapper {@Select("select * from t_file_custom where backedUp = 0")List<FileCustom> selectAll();@Select("select * from t_file_custom where backedUp = 0 and type=#{fileType}")List<FileCustom> selecByType(String fileType);@Update("update t_file_custom set backedUp = #{state} where id = #{id}")int changeState(@Param("id") Long id, @Param("state")int state);
}
6.4 測試
- 只有一臺機器的情況下,任務分片是如何執(zhí)行的
- 有多臺機器的情況下,任務分片是如何執(zhí)行的
7.Dataflow 類型調(diào)度任務
Dataflow 類型的定時任務需要實現(xiàn) DataflowJob 接口,該接口提供2個方法供覆蓋,分別用于抓取(fetchData)和處理(processData)數(shù)據(jù),我們繼續(xù)對例子進行改造。
Dataflow類型用于處理數(shù)據(jù)流,他和SimpleJob不同,它以數(shù)據(jù)流的方式執(zhí)行,調(diào)用fetchData抓取數(shù)據(jù),知道抓取不到數(shù)據(jù)才停止作業(yè)。
7.1 任務類
@Component
public class FileDataflowJob implements DataflowJob<FileCustom> {@Autowiredprivate FileCustomMapper fileCustomMapper;@Overridepublic List<FileCustom> fetchData(ShardingContext shardingContext) {List<FileCustom> fileCustoms = fileCustomMapper.fetchData(2);System.out.println("抓取時間:"+new Date()+",個數(shù)"+fileCustoms.size());return fileCustoms;}@Overridepublic void processData(ShardingContext shardingContext, List<FileCustom> data) {for(FileCustom fileCustom:data){backUpFile(fileCustom);}}private void backUpFile(FileCustom fileCustom){try {//模擬備份動作TimeUnit.SECONDS.sleep(1);} catch (InterruptedException e) {e.printStackTrace();}System.out.println("執(zhí)行文件備份====>"+fileCustom);fileCustomMapper.changeState(fileCustom.getId(),1);}
}
7.2 配置類
@Configuration
public class ElasticJobConfig {@Autowiredprivate MyElasticJob myElasticJob;@Autowiredprivate CoordinatorRegistryCenter registryCenter;private static LiteJobConfiguration createJobConfiguration(final Class<? extends ElasticJob> jobClass,final String cron,final int shardingTotalCount,final String shardingItemParameters,boolean dataflowType) {// 定義作業(yè)核心配置JobCoreConfiguration.Builder jobCoreConfigurationBuilder = JobCoreConfiguration.newBuilder(jobClass.getSimpleName(), cron, shardingTotalCount);if(!StringUtils.isEmpty(shardingItemParameters)){jobCoreConfigurationBuilder.shardingItemParameters(shardingItemParameters);}JobTypeConfiguration jobConfig = null;if(dataflowType){jobConfig = new DataflowJobConfiguration(jobCoreConfigurationBuilder.build(),jobClass.getCanonicalName(),true);}else{// 定義SIMPLE類型配置jobConfig = new SimpleJobConfiguration(jobCoreConfigurationBuilder.build(), jobClass.getCanonicalName());}// 定義Lite作業(yè)根配置LiteJobConfiguration simpleJobRootConfig = LiteJobConfiguration.newBuilder(jobConfig).overwrite(true).build();return simpleJobRootConfig;}/*@Bean(initMethod = "init")public SpringJobScheduler initSimpleElasticJob(){SpringJobScheduler springJobScheduler = new SpringJobScheduler(myElasticJob,registryCenter,createJobConfiguration(MyElasticJob.class,"0/3 * * * * ?",1,null));return springJobScheduler;}*//*@Bean(initMethod = "init")public SpringJobScheduler initFileCustomElasticJob(FileCustomElasticJob fileCustomElasticJob){SpringJobScheduler springJobScheduler = new SpringJobScheduler(fileCustomElasticJob,registryCenter,createJobConfiguration(FileCustomElasticJob.class,"0 0/1 * * * ?",4,"0=text,1=image,2=radio,3=vedio",false));return springJobScheduler;}*/@Bean(initMethod = "init")public SpringJobScheduler iniDataflowElasticJob(FileDataflowJob fileDataflowJob){SpringJobScheduler springJobScheduler = new SpringJobScheduler(fileDataflowJob,registryCenter,createJobConfiguration(FileDataflowJob.class,"0 0/1 * * * ?",1,null,true));return springJobScheduler;}
}
7.3 測試
8.運維管理
8.1 事件追蹤
Elastic-Job-Lite在配置中提供了JobEventConfiguration,支持數(shù)據(jù)庫方式配置,會在數(shù)據(jù)庫中自動創(chuàng)建JOB_EXECUTION_LOG和JOB_STATUS_TRACE_LOG兩張表以及若干索引來近路作業(yè)的相關(guān)信息。
8.1.1 修改Elastic-Job配置類
在ElasticJobConfig配置類中注入DataSource
@Configuration
public class ElasticJobConfig {@Autowiredprivate DataSource dataSource;......
}
在任務配置中增加事件追蹤配置
@Bean(initMethod = "init")public SpringJobScheduler initFileCustomElasticJob(FileCustomElasticJob fileCustomElasticJob){//增加任務事件追蹤配置JobEventConfiguration jobEventConfiguration = new JobEventRdbConfiguration(dataSource);SpringJobScheduler springJobScheduler = new SpringJobScheduler(fileCustomElasticJob,registryCenter,createJobConfiguration(FileCustomElasticJob.class,"0 0/1 * * * ?",4,"0=text,1=image,2=radio,3=vedio",false),jobEventConfiguration);return springJobScheduler;}
8.1.2 日志信息表
啟動后會發(fā)現(xiàn)在elastic-job-demo數(shù)據(jù)庫中新增以下兩張表
job_execution_log
記錄每次作業(yè)的執(zhí)行歷史,分為兩個步驟:
1.作業(yè)開始執(zhí)行時間想數(shù)據(jù)庫插入數(shù)據(jù).
2.作業(yè)完成執(zhí)行時向數(shù)據(jù)庫更新數(shù)據(jù),更新is_success,complete_time和failure_cause(如果任務執(zhí)行失敗)
job_status_trace_log
記錄作業(yè)狀態(tài)變更痕跡表,可通過每次作業(yè)運行的task_id查詢作業(yè)狀態(tài)變化的生命軌跡和運行軌跡.
8.2 運維控制臺
elastic-job中提供了一個elastic-job-lite-console控制臺
設(shè)計理念
1.本 控制臺和Elastic-Job并無直接關(guān)系,是通過讀取Elastic-Job的注冊中心數(shù)據(jù)展示作業(yè)狀態(tài),或更新注冊中心數(shù)據(jù)修改全局配置。
2.控制臺只能控制任務本身是否運行,但不能控制作業(yè)進程的啟停,因為控制臺和作業(yè)本身服務器是完全分布式的,控制臺并不能控制作業(yè)服務器。
主要功能:
1.查看作業(yè)以及服務器狀態(tài)
2.快捷的修改以及刪除作業(yè)配置
3.啟用和禁用作業(yè)
4.跨注冊中心查看作業(yè)
5.查看作業(yè)運行軌跡和運行狀態(tài)
不支持項
1.添加作業(yè),因為作業(yè)都是在首次運行時自動添加,使用控制臺添加作業(yè)并無必要.直接在作業(yè)服務器啟動包含Elasitc-Job的作業(yè)進程即可。
8.2.1 搭建步驟
-
解壓縮
elastic-job-lite-console-2.1.5.tar
-
進入bin目錄,并執(zhí)行:
bin\start.bat
-
打開瀏覽器訪問
http://localhost:8899
用戶名: root 密碼: root,進入之后界面如下:
提供兩種用戶:管理員和訪客,管理員擁有全部操作權(quán)限,訪客僅擁有查看權(quán)限。默認管理員賬號和面膜是root/root,訪客用戶名和密碼是guest/guest,通過conf\auth.properties可以修改管理員以及訪客用戶名及密碼
8.2.2 配置及使用
-
配置注冊中心地址
先啟動zookeeper然后再注冊中心配置界面,點添加
點擊提交后,然后點連接(zookeeper必須處于啟動狀態(tài))
連接成功后,在作業(yè)緯度下可以顯示該命名空間作業(yè)名稱,分片數(shù)量及該作業(yè)的cron表達式等信息
在服務器緯度可以查看到服務器ip,當前運行的是實例數(shù),作業(yè)總數(shù)等信息。
添加數(shù)據(jù)庫連接之后可以查看任務的執(zhí)行結(jié)果
然后在作業(yè)歷史中就可以看到任務執(zhí)行歷史了。