1、 下载镜像
docker pull xuxueli/xxl-job-admin:2.2.0
2、 查看镜像
docker images
![](https://img.haomeiwen.com/i13001528/81d3c356ac2d4493.png)
3、 初始化数据库
Mysql脚本: https://github.com/xuxueli/xxl-job/blob/2.2.0/doc/db/tables_xxl_job.sql
4、 配置host
![](https://img.haomeiwen.com/i13001528/ad22b3ef192354f2.png)
5、 启动镜像
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://jeecg-boot-mysql:3306/xxl_job?Unicode=true&characterEncoding=UTF-8&useSSL=false --spring.datasource.username=root --spring.datasource.password=root --xxl.admin.login=false" ^
-p 9080:8080 --name xxl-job-admin ^
-d xuxueli/xxl-job-admin:2.2.0数据库的链接改成自己的配置
6、 访问管理后台
[http://127.0.0.1:9080/xxl-job-admin](http://127.0.0.1:9080/xxl-job-admin/toLogin)
admin/123456
7、 创建执行器和定时任务
(1)新增执行器
![](https://img.haomeiwen.com/i13001528/b101c0127c571cc2.png)
(2)新增定时任务
![](https://img.haomeiwen.com/i13001528/b49b1e88a6f3b56f.png)
(3)测试定时任务(前提微服务各个模块和定时任务服务端已启动)
![](https://img.haomeiwen.com/i13001528/d5a08996dd37ff65.png)
(4)执行结果如下所示
![](https://img.haomeiwen.com/i13001528/1fe3d636c4bfbba6.png)
网友评论