Elastic-Job 配置介绍
作业配置
与Spring容器配合使用作业,可以将作业Bean配置为Spring Bean,可在作业中通过依赖注入使用Spring容器管理的数据源等对象。可用placeholder占位符从属性文件中取值。
Spring命名空间配置
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright - Alibaba Group.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:job="http://www.dangdang.com/schema/ddframe/job"
xsi:schemaLocation="http://www.dangdang.com/schema/ddframe/job http://www.dangdang.com/schema/ddframe/job/job.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd"> <job:simple id="virtualInstanceChargeJobTrigger" job-ref="virtualInstanceChargeJob" registry-center-ref="zookeeperRegistryCenter" cron="*/30 * * * * ?" sharding-total-count="" />
</beans>
job:simple命名空间属性详细说明
| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 |
|---|---|---|---|---|
| id | String | 是 |
作业名称 | |
| class | String | 否 | 作业实现类,需实现ElasticJob接口,脚本型作业不需要配置 |
|
| registry-center-ref | String | 是 |
注册中心Bean的引用,需引用reg:zookeeper的声明 |
|
| cron | String | 是 |
cron表达式,用于配置作业触发时间 |
|
| sharding-total-count | int | 是 |
作业分片总数 | |
| sharding-item-parameters | String | 否 | 分片序列号和参数用等号分隔,多个键值对用逗号分隔 分片序列号从 0开始,不可大于或等于作业分片总数如: 0=a,1=b,2=c |
|
| job-parameter | String | 否 | 作业自定义参数 可以配置多个相同的作业,但是用不同的参数作为不同的调度实例 |
|
| monitor-execution | boolean | 否 | true | 监控作业运行时状态 每次作业执行时间和间隔时间均非常短的情况,建议不监控作业运行时状态以提升效率。因为是瞬时状态,所以无必要监控。请用户自行增加数据堆积监控。并且不能保证数据重复选取,应在作业中实现幂等性。 每次作业执行时间和间隔时间均较长的情况,建议监控作业运行时状态,可保证数据不会重复选取。 |
| monitor-port | int | 否 | -1 | 作业监控端口 建议配置作业监控端口, 方便开发者dump作业信息。 使用方法: echo “dump” | nc 127.0.0.1 9888 |
| max-time-diff-seconds | int | 否 | -1 | 最大允许的本机与注册中心的时间误差秒数 如果时间误差超过配置秒数则作业启动时将抛异常 配置为 -1表示不校验时间误差 |
| failover | boolean | 否 | false | 是否开启失效转移 仅 monitorExecution开启,失效转移才有效 |
| misfire | boolean | 否 | true | 是否开启错过任务重新执行 |
| job-sharding-strategy-class | String | 否 | true | 作业分片策略实现类全路径 默认使用平均分配策略 详情参见:作业分片策略 |
| description | String | 否 | 作业描述信息 | |
| disabled | boolean | 否 | false | 作业是否禁止启动 可用于部署作业时,先禁止启动,部署结束后统一启动 |
| overwrite | boolean | 否 | false | 本地配置是否可覆盖注册中心配置 如果可覆盖,每次启动作业都以本地配置为准 |
Elastic-Job 配置介绍的更多相关文章
- 什么是blob,mysql blob大小配置介绍
什么是blob,mysql blob大小配置介绍 作者: 字体:[增加 减小] 类型:转载 BLOB (binary large object),二进制大对象,是一个可以存储二进制文件的容器.在计 ...
- ecshop 工作流程加载配置介绍
ecshop 工作流程加载配置介绍 分类: ecshop2014-09-14 09:36 729人阅读 评论(2) 收藏 举报 模板引擎工作流 这里简单介绍下echsop工作流程: 首先,你会发现一般 ...
- Window VNC远程控制LINUX:VNC详细配置介绍
Window VNC远程控制LINUX:VNC详细配置介绍 //---------------------------------------vnc linux下的详细配置 1.VNC的启动/停止/重 ...
- ASP.NET Core 运行原理解剖[2]:Hosting补充之配置介绍
在上一章中,我们介绍了 ASP.NET Core 的启动过程,主要是对 WebHost 源码的探索.而本文则是对上文的一个补充,更加偏向于实战,详细的介绍一下我们在实际开发中需要对 Hosting 做 ...
- Elastic Stack-Elasticsearch使用介绍(五)
一.前言 前4篇将Elasticsearch用法的API和原理方面东西介绍了一下,相信大家对Elasticsearch有了一定的认知,接下我们主要从索引的建立到后期的一些优化做一些介绍: 二. ...
- prometheus 配置介绍
prometheus 配置介绍 prometheus 配置分global.alerting.rule_files.scrape_configs 1.global(全局配置) scrape_interv ...
- Centos 7 磁盘阵列配置介绍(RAID)
转自:https://blog.51cto.com/gaowenlong/2086918 Centos 7 磁盘阵列配置介绍每当我们提到磁盘阵列,相信广大管理员并不陌生,比如我们一般安装服务器系统的时 ...
- LINUX服务器搭建和常用配置介绍
服务器搭建 : 搭建私有CA服务器 : http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_011_ca.html搭建samba服务器 : h ...
- Nginx 日志格式配置介绍
Nginx日志格式配置介绍 by:授客 QQ:1033553122 测试环境 CentOS 6.5-x86_64 nginx-1.10.0 配置例子 log_format main '$ ...
- Tsung MQTT协议简介及MQTT xml文档配置介绍
MQTT协议简介及MQTT xml文档配置介绍 by:授客 QQ:1033553122 1. MQTT协议介绍 MQTT(Message Queuing Telemetry Transport,消息队 ...
随机推荐
- vee-validate的使用
官网地址:http://vee-validate.logaretm.com/ 这是一个插件Vue.js可以验证输入字段,显示错误,在一个简单而强大的方法.学习vee-validate,首先可以去阅读官 ...
- HTML5_新标签
HTML5 是定义 HTML 标准的最新版本. 是一个新版本的 HTML 语言,具有新的元素,属性,行为, 是一个技术及,允许更多样化和强大的网站和应用程序 优势: 跨平台: 通吃 MAC PC Li ...
- 架构.Net 到 Linux
nginx + .net core + mysql + radis + rabbitmq
- linux下安装前端程序员必备软件
startx进入桌面后,ctrl+alt+t调出终端.安装完成以后重启在软件ubuntu软件中找到软件启动或通过终端输入命令找到,锁定到启动器. 1.首先安装chrome(64位) cd /tm ...
- 转载Alpine Linux常用命令
Alpine Linux常用命令 目录 一:Alpine Linux开启SSH远程登陆 1.简介: 2.配置 3.配置命令 4.重启服务 二:Alpine Linux源管理 1.简介 2.国内源简介: ...
- linux svn权限
svnserve -d -r /opt/svn //启动 创建仓库 svnadmin create /u02/svn/davesvn ...
- ambari卸载集群
#1.删除hdp.repo和hdp-util.repo cd /etc/yum.repos.d/ rm -rf hdp* rm -rf HDP* #rm -rf ambari* #2.删除安装包 #用 ...
- php协议流
文件包含漏洞结合php协议流的特性,使得漏洞利用效率更高,下面的内容主要讲解协议流的使用. 0x00 测试环境: php版本: 5.2,5.3,5.5,7.0等web服务: apache2OS系统: ...
- Spring Boot(三):AOP&日志操作&异常处理
一.AOP:HttpAspect.java 二.操作日志 在HttpAspect.java中调用org.slf4j.Logger.org.slf4j.LoggerFactory 三.异常处理 1.定义 ...
- 《图解HTTP》读书笔记(二:各种协议与HTTP协议之间的关系)
涉及到DNS协议.TCP协议.IP协议,话不多说,上图: