1、下载
下载地址:https://github.com/xuxueli/xxl-job/
2、导入数据
将/xxl-job-master/doc/db/tables_xxl_job.sql导入MySQL数据库
3、修改配置文件
修改admin配置
./xxl-job/xxl-job-master/xxl-job-admin/src/main/resources/application.properties
server.port=9001
### xxl-job, datasource
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=xxxxxx
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
修改执行器配置
./xxl-job/xxl-job-master/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/resources/application.properties
server.port=8081
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:9001/xxl-job-admin
4、编译
mvn package
生成可jar包并运行:
./xxl-job/xxl-job-master/xxl-job-admin/target/xxl-job-admin-2.3.1-SNAPSHOT.jar
nohup java -jar xxl-job-admin-2.3.1-SNAPSHOT.jar &
./xxl-job/xxl-job-master/xxl-job-executor-samples/xxl-job-executor-sample-springboot/target/xxl-job-executor-sample-springboot-2.3.1-SNAPSHOT.jar
nohup java -jar xxl-job-executor-sample-springboot-2.3.1-SNAPSHOT.jar &
5、测试验证
http://192.168.1.38:9001/xxl-job-admin
默认登录账号为 “admin/123456”
版权归原作者 邓邓子2021 所有, 如有侵权,请联系我们删除。