Quick distributed timed task xxl-job

Quick distributed timed task xxl-job

Need to install linux server environment: jdk1.8, docker

Installation Steps Address:  linux Quick Install the JDK    ,  install docker in linux in  
1.docker install mysql database
website https://hub.docker.com/_/mysql?tab=tags
find the version of mysql, pull mirroring
command: docker pull mysql: 5.7
by containers mirror operation
command: docker run --name mysql-master --privileged = true -v / home / mysql / master-data: / var / lib / mysql -p 3306: 3306 -e MYSQL_ROOT_PASSWORD = root - d mysql: 5.7

2. Locate docker image information xxl-job-admin choose 2.1.0 version
URL: https://hub.docker.com/r/xuxueli/xxl-job-admin/tags
pulling Mirror command: docker pull xuxueli / xxl-job-admin: 2.1.0

3. Download xxl-job source, URL https://gitee.com/xuxueli0323/xxl-job/tree/2.1.0

4. Locate the source code in the database scripts xxl-job \ doc \ db \ tables_xxl_job.sql, executed in the database, create databases and tables

5.启动xxl-job-admin容器 ,命令如下:
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://192.168.0.88:3306/xxl_job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=root --spring.datasource.driver-class-name=com.mysql.jdbc.Driver" -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin:2.1.0

6. Control Center access to the address: http: //192.168.88.129: 8080 / xxl -job-admin ( the executor will be used to address, as a callback address)
default login account "admin / 123456", run the following login interface As shown in FIG.
This, xxl-job-admin deployment is complete.

7. Web site, https: //gitee.com/xkcoding/spring-boot-demo download the client code.
Importing spring-boot-demo-task- xxl-job project to IDEA

8. Modify application.yml profile.
8.1 address ip address the ip linux write.
8.2 Fill actuator ip, when you start locally, write the actuator ip ip local computer, the command ipconfig ipv4 address. When the start linux, linux write the ip, ip addr command

 9. In the web console, adding configure actuators, consistent with the above noted configuration. Select to perform manual entry address.

Note: When linux is installed on a virtual machine vmware, etc., have more virtual NICs, you can not use auto-enrollment, the actuator can not find or ip address.

10. Add a task.

11. The timer will trigger the execution of code here.

This rapid completion of the deployment of distributed regular tasks xxl-job 

 

Guess you like

Origin www.cnblogs.com/itbac/p/11909269.html