首页 > 其他分享 >XXL JOB DockerCompose部署

XXL JOB DockerCompose部署

时间:2024-11-13 20:56:45浏览次数:1  
标签:59 DockerCompose 16 admin JOB job XXL logback xxl

官网给的方式是 Docker 命令启动,但是用起来太麻烦了,所以用DockerCompose 简化部署

创建数据库,导入 SQL

SQL 脚本位置为/xxl-job/doc/db/tables_xxl_job.sql

https://raw.githubusercontent.com/xuxueli/xxl-job/refs/heads/master/doc/db/tables_xxl_job.sql

编写 DockerCompose

version: '3.7'
services:
  xxl-job:
    image: registry.cn-shanghai.aliyuncs.com/frbbs/xxl-job-admin:2.4.1
    container_name: xxl-job-admin
    restart: always
    ports:
      - "8080:8080"
    volumes:
      - ./application.yml:/config/application.yml:ro
      - /data/logs/xxl-job:/data/applogs

为了方便配置的修改,将配置独立成application.yml 了

编写 application.yml 配置

spring:
  datasource:
    url: jdbc:mysql://xxxx:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
    username: xxl_job
    password: xxx
    driver-class-name: com.mysql.jdbc.Driver
xxl:
  job:
    accessToken: xxxx

调度中心配置内容说明:

### 调度中心JDBC链接:链接地址请保持和 2.1章节 所创建的调度数据库的地址一致
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=root_pwd
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
### 报警邮箱
spring.mail.host=smtp.qq.com
spring.mail.port=25
[email protected]
spring.mail.password=xxx
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
### 调度中心通讯TOKEN [选填]:非空时启用;
xxl.job.accessToken=
### 调度中心国际化配置 [必填]: 默认为 "zh_CN"/中文简体, 可选范围为 "zh_CN"/中文简体, "zh_TC"/中文繁体 and "en"/英文;
xxl.job.i18n=zh_CN
## 调度线程池最大线程配置【必填】
xxl.job.triggerpool.fast.max=200
xxl.job.triggerpool.slow.max=100
### 调度中心日志表数据保存天数 [必填]:过期日志自动清理;限制大于等于7时生效,否则, 如-1,关闭自动清理功能;
xxl.job.logretentiondays=30

启动

docker-compose up -d && docker-compose logs -f

xxl-job-admin  | 
xxl-job-admin  |   .   ____          _            __ _ _
xxl-job-admin  |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
xxl-job-admin  | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
xxl-job-admin  |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
xxl-job-admin  |   '  |____| .__|_| |_|_| |_\__, | / / / /
xxl-job-admin  |  =========|_|==============|___/=/_/_/_/
xxl-job-admin  |  :: Spring Boot ::               (v2.7.18)
xxl-job-admin  |
xxl-job-admin  | 16:59:05.886 logback [main] INFO  c.x.job.admin.XxlJobAdminApplication - Starting XxlJobAdminApplication using Java 1.8.0_332 on 1a5e48b76b08 with PID 7 (/app.jar started by root in /)
xxl-job-admin  | 16:59:05.888 logback [main] INFO  c.x.job.admin.XxlJobAdminApplication - No active profile set, falling back to 1 default profile: "default"
xxl-job-admin  | 16:59:06.716 logback [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
xxl-job-admin  | 16:59:06.720 logback [main] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
xxl-job-admin  | 16:59:06.722 logback [main] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
xxl-job-admin  | 16:59:06.722 logback [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.83]
xxl-job-admin  | 16:59:06.802 logback [main] INFO  o.a.c.c.C.[.[.[/xxl-job-admin] - Initializing Spring embedded WebApplicationContext
xxl-job-admin  | 16:59:06.802 logback [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 749 ms
xxl-job-admin  | Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
xxl-job-admin  | 16:59:07.157 logback [main] INFO  c.x.j.a.c.scheduler.XxlJobScheduler - >>>>>>>>> init xxl-job admin success.
xxl-job-admin  | 16:59:07.168 logback [xxl-job, admin JobFailMonitorHelper] INFO  com.zaxxer.hikari.HikariDataSource - HikariCP - Starting...
xxl-job-admin  | 16:59:07.170 logback [xxl-job, admin JobFailMonitorHelper] WARN  c.z.hikari.util.DriverDataSource - Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.       
xxl-job-admin  | 16:59:07.288 logback [main] INFO  o.s.b.a.w.s.WelcomePageHandlerMapping - Adding welcome page template: index
xxl-job-admin  | 16:59:07.581 logback [main] INFO  o.s.b.a.e.web.EndpointLinksResolver - Exposing 1 endpoint(s) beneath base path '/actuator'
xxl-job-admin  | 16:59:07.594 logback [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
xxl-job-admin  | 16:59:07.605 logback [main] INFO  o.a.c.c.C.[.[.[/xxl-job-admin] - Initializing Spring DispatcherServlet 'dispatcherServlet'
xxl-job-admin  | 16:59:07.606 logback [main] INFO  o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
xxl-job-admin  | 16:59:07.607 logback [main] INFO  o.s.web.servlet.DispatcherServlet - Completed initialization in 1 ms
xxl-job-admin  | 16:59:07.607 logback [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '/xxl-job-admin'
xxl-job-admin  | 16:59:07.615 logback [main] INFO  c.x.job.admin.XxlJobAdminApplication - Started XxlJobAdminApplication in 1.973 seconds (JVM running for 2.393)
xxl-job-admin  | 16:59:07.692 logback [xxl-job, admin JobFailMonitorHelper] INFO  com.zaxxer.hikari.HikariDataSource - HikariCP - Start completed.
xxl-job-admin  | 16:59:12.000 logback [xxl-job, admin JobScheduleHelper#scheduleThread] INFO  c.x.j.a.c.thread.JobScheduleHelper - >>>>>>>>> init xxl-job admin scheduler success.
xxl-job-admin  | 16:59:41.367 logback [http-nio-8080-exec-1] INFO  o.a.tomcat.util.http.parser.Cookie - A cookie header was received [Hm_lvt_c081e53834443c7768dc0a2f554ab0b9=1728542906,1729482490,1730871693,1731034126;] that contained an invalid cookie. That cookie will be ignored.

如果没有报错的话,就是部署完成了;如果要升级,只需要修改 DockerCompose 配置的版本号即可

访问:http://localhost:8080/xxl-job-admin/

本文由博客一文多发平台 OpenWrite 发布!

标签:59,DockerCompose,16,admin,JOB,job,XXL,logback,xxl
From: https://www.cnblogs.com/gcdd1993/p/18544808

相关文章

  • flink job 提交到yarn 需要哪些配置文件 flink submit new job
    flinkjob提交到yarn需要哪些配置文件flinksubmitnewjob文章目录前言Standalone模式yarn模式前言本文介绍flink的任务提交模式。Standalone模式WebUI提交job打开flink的WebUI,在WebUI的SubmitNewJob提交jar包。Job参数:EntryClass:程序的入口,指定入口类(类的全限制名......
  • SpringBoot+ElasticJob实现分布式任务调度
    目录1相关简介2Zookeeper的Docker安装3Zookeeper的Windows版本安装4Zookeeper图形化客户端prettyZoo5示例代码6添加任务监听器7参考资料(感谢)1相关简介zookeeper:开源分布式应用程序协调服务下载地址:https://archive.apache.org/dist/zookeeper/2Zookeeper......
  • 线性规划-JobShopSchedulingLP
    usingSystem;usingGoogle.OrTools.LinearSolver;namespaceJobShopScheduingProblem{///<summary>///线性规划(LinearProgramming)///</summary>publicclassJobShopSchedulingLP{publicstaticvoidSolve()......
  • XXL-JOB docker 初始化
    一、因为xxl-job使用的是mysq数据库,所有在yaml文件中,需要优先启动mysqlversion:'3'services:mysql:image:mysql:8.0container_name:mysql8restart:alwaysenvironment:MYSQL_ROOT_PASSWORD:123456MYSQL_DATABASE:xxl_jobpo......
  • 剖析xxl-job任务调度及高可用机制
    xxl-job任务执行器调度的实现机制整体上来讲,就是在xxl-job-admin中通过调用任务执行器的HTTP接口,实现对任务执行器的调度。具体又可以分为2个层面进行剖析,如下:任务执行器侧:当在项目中引入xxl-job-core组件之后,如果是在Spring容器环境中,会通过XxlJobSpringExecutor组件的afterS......
  • IT界的大神-003- 史蒂夫·乔布斯 (Steve Jobs)
     史蒂夫·乔布斯(SteveJobs)史蒂夫·乔布斯(SteveJobs)是现代商业史上的杰出人物之一 |生平简介-出生与早年:乔布斯于1955年2月24日出生于美国加利福尼亚州旧金山。他是一个私生子,被保罗和克拉拉·乔布斯领养长大。乔布斯在1972年高中毕业后入读俄勒冈州波特兰的里德......
  • 手把手教你精通使用xxljob
    XXL-JOB是一个分布式任务调度平台,以下是其基本的使用方法XXL-JOB是一个轻量级、高效且易于使用的分布式任务调度框架,它由大众点评的许雪里(XXL)开源,旨在解决分布式环境下定时任务的执行难题。以下是XXL-JOB的一些核心特性和应用场景的详细介绍:1.基本介绍XXL-JOB起源于大众......
  • xxl-job分布式定时任务
    xxl-job分布式定时任务官方定义:xxl-job是一个开源的分布式任务调度平台。它的核心设计目标是开发迅速、学习简单、轻量级、易扩展。主要由调度中心和执行器两部分组成,调度中心负责管理调度信息,执行器负责接收调度请求并执行任务逻辑。主要特点:简单易用:支持通过web页......
  • 题解:CF1666J Job Lookup
    被迫来写篇题解。首先,第一个要求我们只需要在递归构造的时候保证子树对应区间连续即可,现在考虑第二个要求。就题目中的二叉树而言,想要确定其结构,我们只需要关注这段区间,即这棵子树根节点的编号,又因为子树区间连续,所以我们不难想到区间动态规划。设\(dp_{l,r}\)表示\(l\simr......
  • oracle数据库---PL/SQL、存储函数、存储过程、触发器、定时器job、备份
    PL/SQL什么是PL/SQLPL/SQL(Procedure Language/SQL)是Oracle对sql语言的过程化扩展,指在SQL命令语言中增加了过程处理语句(如分支、循环等),使SQL语言具有过程处理能力。把SQL语言的数据操纵能力与过程语言的数据处理能力结合起来,使得PLSQL面向过程但比过程语言简单......