環境:centos7、xxl-job2.2.0
1、下載xxl-job-executor執行器images、配置文件、執行文件
鏈接: https://pan.baidu.com/s/1lEyZr7pd06pnmdIUkbEouQ 提取碼: iujb
2、還原images
docker load -i xxl-job-executor.tar
3、修改配置文件 application.properties
# web port server.port=8081 # no web #spring.main.web-environment=false # log config logging.config=classpath:logback.xml ### xxl-job admin address list, such as "http://address" or "http://address01,http://address02" xxl.job.admin.addresses=http://100.98.100.234:31748/xxl-job-admin ### xxl-job, access token xxl.job.accessToken= ### xxl-job executor appname(這兒的appname就是頁面注冊時填的第一個appname) xxl.job.executor.appname=xxl-job-executor-sample ### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null xxl.job.executor.address= ### xxl-job executor server-info xxl.job.executor.ip=100.98.100.234 xxl.job.executor.port=9999 ### xxl-job executor log-path xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler ### xxl-job executor log-retention-days xxl.job.executor.logretentiondays=30
4、運行容器查看執行器注冊
[root@host-172-21-210-10 prod-xxl-job]# more zxfb.sh docker run -p 18081:8081 -p 9999:9999 \ -v /wj/prod-xxl-job/application.properties:/application.properties \ --name xxl-job-executor-sample-springboot -d kobedocker24/xxl-job-executor-sample-springboot:2.2.0
啟動前(新增執行器,注意appname,選擇自動注冊方式)
啟動后