XXL-JOB部署

DevOps Tool评论1,987字数 552阅读1分50秒阅读模式

环境

  • Maven3+
  • Jdk1.8+
  • Mysql5.7+

部署

  • maven https://devops.ubuntu.ltd/743.html
  • jdk  https://devops.ubuntu.ltd/186.html
  • mysql https://devops.ubuntu.ltd/84.html

初始化数据库

[centos@us-prod-sre-jumpserver-1 db]$ mysql -uroot -p
Enter password: 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)
mysql> create database xxl_job;
Query OK, 1 row affected (0.01 sec)
mysql> source /home/centos/xxl-job/doc/db/tables_xxl_job.sql
Query OK, 1 row affected, 1 warning (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected, 7 warnings (0.02 sec)

Query OK, 0 rows affected, 7 warnings (0.02 sec)

Query OK, 0 rows affected, 4 warnings (0.02 sec)

Query OK, 0 rows affected, 2 warnings (0.02 sec)

Query OK, 0 rows affected, 1 warning (0.02 sec)

Query OK, 0 rows affected, 2 warnings (0.02 sec)

Query OK, 0 rows affected, 2 warnings (0.02 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

安装XXL-JOB

下载源码
git clone https://github.com/xuxueli/xxl-job.git
修改数据库

/xxl-job/xxl-job-admin/src/main/resources/application.properties

### 调度中心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
spring.mail.username=xxx@qq.com
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
打包xxl_job
[centos@us-prod-sre-jumpserver-1 xxl-job]$ pwd
/home/centos/xxl-job
[centos@us-prod-sre-jumpserver-1 xxl-job]$ mvn clean install
启动服务
[centos@us-prod-sre-jumpserver-1 target]$ pwd
/home/centos/xxl-job/xxl-job-admin/target
[centos@us-prod-sre-jumpserver-1 target]$ nohup java -jar xxl-job-admin-2.4.0-SNAPSHOT.jar &
[1] 14360
[centos@us-prod-sre-jumpserver-1 target]$ nohup: ignoring input and appending output to ‘nohup.out’

访问xxljob

调度中心访问地址:http://localhost:8080/xxl-job-admin (该地址执行器将会使用到,作为回调地址)

默认登录账号 “admin/123456”, 登录后运行界面如下图所示。

XXL-JOB部署XXL-JOB部署

 

继续阅读
 
DevOps
  • 本文由 DevOps 发表于 2022年8月9日 15:06:20
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
  • XXL-JO
端口查看 Tool

端口查看

查看udp端口 查询指定udp端口方法 netstat -u -a | grep ':50001' 查询指定udp端口方法 ss -u -a | grep ':50001' 查看tcp端口 查看指定t...
frp0.52.3 Tool

frp0.52.3

FRP 介绍 frp 是一个专注于内网穿透的高性能反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议,且支持 P2P 通信。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的...
SSL私有证书配置 Tool

SSL私有证书配置

一、生成证书 1.1 简述 一键生成私有证书脚本,兼容CentOS 7.9系统和Ubuntu 20.04.6以上系统,运行脚本加IP地址即可。 1.2 生成 在CentOS或Ubuntu系统上使用ro...

发表评论