源码去github下载下,先去执行sql新建几个表:
打开主要分为3个部分:
1,管理台
2,核心
3,执行例子
运行xxl-job-admin,成功后打开管理台
运行执行例子,我这边用的springboot的demo
配置application.properties后启动
# web port
server.port=8089
# no web
#spring.main.web-environment=false
# log config
logging.config=classpath:logback.xml
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
### xxl-job, access token
xxl.job.accessToken=1
### xxl-job executor appname
xxl.job.executor.appname=xxl-job-executor-sample
### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null
xxl.job.executor.address=
### xxl-job executor server-info
xxl.job.executor.ip=
xxl.job.executor.port=9998
### xxl-job executor log-path
xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler
### xxl-job executor log-retention-days
xxl.job.executor.logretentiondays=30
新增执行器,自动注入就好如果执行例子成功运行,能够自动注册
新增任务,注意任务与执行器是对应的,一个执行器可以有多个任务
启动任务:
查看日志,执行成功