分散式任務調度系統xxl-job搭建(基於docker)
- 2020 年 2 月 24 日
- 筆記
一、簡介
XXL-JOB是一個輕量級分散式任務調度平台,其核心設計目標是開發迅速、學習簡單、輕量級、易擴展。現已開放源程式碼並接入多家公司線上產品線,開箱即用。
更多介紹,請訪問官網:
http://www.xuxueli.com/xxl-job/#/

接下來,本文將詳細介紹,如何安裝XXL-JOB
本文所使用的作業系統為: ubuntu-16.04.5-server-amd64
二、安裝MySQL(docker)
安裝方式
xxl-job 依賴 mysql,所以必須要安裝mysql才行!安裝mysql有2種方式:
1. 在線安裝或者編譯安裝
2. 使用docker
如果直接使用apt-get 在線安裝,使用以下命令:
apt-get install -y mysql-server
在安裝過程中,會提示輸出root密碼,注意:必須輸入密碼為 root_pwd,下面會介紹到!
注意:默認的配置文件是監聽127.0.0.1,因此還需要修改 /etc/mysql/mysql.conf.d/mysqld.cnf ,修改bind參數為0.0.0.0
安裝完成之後,mysql就啟動了!
基於docker安裝
本文主要介紹,如何使用docker安裝mysql。下載鏡像
docker pull mysql
默認是下載 latest 標籤的mysql,那麼版本是多少呢?訪問以下鏈接:
https://hub.docker.com/_/mysql/
可以發現,latest 對應的版本應該是 8.0.13

導入表
下載項目
訪問github地址:
https://github.com/xuxueli/xxl-job
查看releases版本
https://github.com/xuxueli/xxl-job/releases
最新版本是2.0.1,下載zip包

將zip包上傳至/opt 目錄下,然後進行解壓
cd /opt/apt-get install -y unzipunzip xxl-job-2.0.1.zip
進入db目錄,其中 tables_xxl_job.sql 就是我們要導入的sql文件
root@ubuntu:~# cd /opt/xxl-job-2.0.1/doc/db/ root@ubuntu:/opt/xxl-job-2.0.1/doc/db# ll total 28 drwxr-xr-x 2 root root 4096 Nov 9 09:58 ./ drwxr-xr-x 4 root root 4096 Nov 9 09:58 ../ -rw-r--r-- 1 root root 5241 Nov 9 09:58 tables_mysql(備份,請忽略).sql -rw-r--r-- 1 root root 9293 Nov 9 09:58 tables_xxl_job.sql
正式導入
先啟動mysql 鏡像,指定密碼為123456,映射目錄/opt,指定默認編碼為utf-8
注意:密碼不要包含感嘆號,否則會導致xxl-job啟動失敗!
docker run -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -v /opt:/opt mysql --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
輸出如下:
Initializing database 2019-01-21T07:22:17.704431Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. 2019-01-21T07:22:17.704535Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server in progress as process 26 2019-01-21T07:22:27.371624Z 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. 2019-01-21T07:22:35.750172Z 5 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750311Z 5 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750368Z 5 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750418Z 5 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750483Z 5 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750525Z 5 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750571Z 5 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750735Z 5 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:35.750780Z 5 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:39.791082Z 0 [System] [MY-013170] [Server] /usr/sbin/mysqld (mysqld 8.0.13) initializing of server has completed Database initialized MySQL init process in progress... 2019-01-21T07:22:43.384449Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. 2019-01-21T07:22:43.384578Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 77 MySQL init process in progress... MySQL init process in progress... MySQL init process in progress... mbind: Operation not permitted 2019-01-21T07:22:46.085694Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2019-01-21T07:22:46.088469Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2019-01-21T07:22:46.099211Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099334Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099389Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099437Z 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099499Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099541Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.099585Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.177538Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.177655Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:22:46.185438Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL. 2019-01-21T07:22:46.266527Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it. Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it. 2019-01-21T07:23:14.078178Z 10 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078298Z 10 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078352Z 10 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078400Z 10 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078569Z 10 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078638Z 10 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078686Z 10 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078889Z 10 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:14.078935Z 10 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:16.200048Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL. MySQL init process done. Ready for start up. 2019-01-21T07:23:17.239758Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. 2019-01-21T07:23:17.239874Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 1 2019-01-21T07:23:19.211647Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2019-01-21T07:23:19.214367Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2019-01-21T07:23:19.293300Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.293623Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.293818Z 0 [Warning] [MY-010315] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.293995Z 0 [Warning] [MY-010315] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.294464Z 0 [Warning] [MY-010323] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.294626Z 0 [Warning] [MY-010323] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.294793Z 0 [Warning] [MY-010311] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.311834Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.312036Z 0 [Warning] [MY-010330] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. 2019-01-21T07:23:19.398254Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL. 2019-01-21T07:23:19.549764Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock' bind-address: '::' port: 33060
如果有輸出:
/usr/sbin/mysqld: ready for connections. Version: '8.0.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
則表示,啟動mysql成功!可以看到版本確實是8.0.13
查看docker 進程
root@ubuntu:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3c28a71089b4 mysql "docker-entrypoint..." 44 seconds ago Up 43 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp kind_spence
進入docker,導入sql文件
root@ubuntu:~# docker exec -it 3c28a71089b4 /bin/bash root@3c28a71089b4:/# mysql -u root -p123456 mysql> exit;
查看 sql文件
root@3c28a71089b4:/# cat /opt/xxl-job-2.0.1/doc/db/tables_xxl_job.sql | head -3 CREATE database if NOT EXISTS `xxl-job` default character set utf8 collate utf8_general_ci; use `xxl-job`;
可以發現,它會判斷 xxl-job 資料庫是否存在,如果不存在,就會自動創建。
會自動切換到xxl-job 資料庫
導入sql 文件
mysql> source /opt/xxl-job-2.0.1/doc/db/tables_xxl_job.sql; Query OK, 1 row affected, 2 warnings (0.12 sec) ...
設置許可權
查看默認的授權列表

mysql> select Host,User,authentication_string from mysql.user;+-----------+------------------+------------------------------------------------------------------------+ | Host | User | authentication_string | +-----------+------------------+------------------------------------------------------------------------+ | % | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | | localhost | root | $A$005$QCx{]2[26P-1f|wmEouH1rBifNJZVGQZiH9NBl3SgrUqB319vSHh7FHI96 | +-----------+------------------+------------------------------------------------------------------------+ 5 rows in set (0.00 sec)

可以發現,默認已經將root用戶設置了遠程訪問,也就是%的那條記錄。但是密碼和localhost的不一樣。
因此,需要修改密碼,並刷新許可權
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; mysql> flush privileges;
注意:不要使用以下命令,執行會直接報錯!
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
測試遠程連接
使用Navicat 新建一個mysql連接

點擊連接測試,效果如下:

注意:這裡必須能夠遠程訪問,因為待會由 xxl-job來連接,必須測試通過,否則會導致xxl-job啟動失敗!
三、安裝xxl-job
下載鏡像
docker pull xuxueli/xxl-job-admin
執行會報錯:
Using default tag: latest Error response from daemon: manifest for xuxueli/xxl-job-admin:latest not found
為什麼呢?因為官方沒有打 latest 的tag標籤,所以會提示下載失敗!那怎麼下載呢?必須制定版本才可以!
在上面的內容中,我們已經訪問了releases連接,最新版本是2.0.1
那麼下載命令為:
docker pull xuxueli/xxl-job-admin:2.0.1
啟動鏡像
注意:官方文檔,提到了2個命令
docker run -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin 和 docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-job?Unicode=true&characterEncoding=UTF-8" -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin -d xuxueli/xxl-job-admin
這2個命令,執行之後,是無法訪問8080頁面的!
正確的命令為:
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://192.168.0.162:3306/xxl-job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=123456" -p 8080:8080 -v /tmp:/data/applogs --name xxl-job-admin xuxueli/xxl-job-admin:2.0.1
上面的紅色部分,就是在官方的基礎上面改的!指定真實的mysql地址,以及用戶和密碼。根據實際情況修改!!!
注意:jdbc的地址不能是127.0.0.1,因為官方的鏡像沒有mysql。官方的jdbc命令只是單純的指定了資料庫為xxl-job,並沒有指定用戶名和密碼!
最後一個參數,是鏡像地址。注意:必須帶版本,否則無法啟動
啟動之後,輸出如下:
. ____ _ __ _ _ /\ / ___'_ __ _ _(_)_ __ __ _ ( ( )___ | '_ | '_| | '_ / _` | \/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |___, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v1.5.17.RELEASE) 14:27:30.705 logback [main] INFO c.x.job.admin.XxlJobAdminApplication - Starting XxlJobAdminApplication on ab6d93ba81f9 with PID 5 (/app.jar started by root in /) 14:27:30.797 logback [main] INFO c.x.job.admin.XxlJobAdminApplication - No active profile set, falling back to default profiles: default 14:27:39.762 logback [main] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@70f3863: startup date [Mon Jan 21 14:27:39 CST 2019]; root of context hierarchy 14:27:40.071 logback [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.3.6.Final 14:28:09.375 logback [main] INFO o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 8080 (http) 14:28:09.800 logback [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"] 14:28:10.001 logback [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] 14:28:10.002 logback [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.5.34 14:28:11.564 logback [localhost-startStop-1] INFO o.a.c.c.C.[.[.[/xxl-job-admin] - Initializing Spring embedded WebApplicationContext 14:28:11.565 logback [localhost-startStop-1] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 31803 ms 14:28:13.528 logback [localhost-startStop-1] INFO o.s.b.w.s.ServletRegistrationBean - Mapping servlet: 'dispatcherServlet' to [/] 14:28:13.617 logback [localhost-startStop-1] INFO o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/*] 14:28:13.619 logback [localhost-startStop-1] INFO o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 14:28:13.619 logback [localhost-startStop-1] INFO o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/*] 14:28:13.621 logback [localhost-startStop-1] INFO o.s.b.w.s.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/*] 14:28:28.676 logback [main] INFO o.s.s.quartz.SchedulerFactoryBean - Loading Quartz config from [class path resource [quartz.properties]] 14:28:28.987 logback [main] INFO org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor 14:28:28.994 logback [main] INFO org.quartz.simpl.SimpleThreadPool - Job execution threads will use class loader of thread: main 14:28:29.186 logback [main] INFO o.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 14:28:29.187 logback [main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.3.0 created. 14:28:29.288 logback [main] WARN o.a.tomcat.jdbc.pool.ConnectionPool - maxIdle is larger than maxActive, setting maxIdle to: 30 Mon Jan 21 14:28:31 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:31 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:31 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Mon Jan 21 14:28:32 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 14:28:32.600 logback [main] INFO o.s.s.quartz.LocalDataSourceJobStore - Using db table-based data access locking (synchronization). 14:28:32.605 logback [main] INFO o.s.s.quartz.LocalDataSourceJobStore - JobStoreCMT initialized. 14:28:32.607 logback [main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.3.0) 'getSchedulerFactoryBean' with instanceId 'ab6d93ba81f91548052108992' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 50 threads. Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is clustered. 14:28:32.608 logback [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'getSchedulerFactoryBean' initialized from an externally provided properties instance. 14:28:32.608 logback [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.3.0 14:28:32.614 logback [main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@2914dd79 14:28:33.031 logback [main] INFO c.x.r.r.p.XxlRpcProviderFactory - >>>>>>>>>>> xxl-rpc, provider factory add service success. serviceKey = com.xxl.job.core.biz.AdminBiz, serviceBean = class com.xxl.job.admin.service.impl.AdminBizImpl 14:28:33.236 logback [main] INFO org.eclipse.jetty.util.log - Logging initialized @78724ms 14:28:33.236 logback [main] INFO c.x.j.a.c.s.XxlJobDynamicScheduler - >>>>>>>>> init xxl-job admin success.
最後一行,輸出 init xxl-job admin success. 表示啟動成功!
訪問頁面
直接訪問:
http://192.168.0.162:8080
是沒有任何效果的!!!
真正的訪問地址為:
http://192.168.0.162:8080/xxl-job-admin
效果如下:
默認的用戶名和密碼,已經幫你輸入好了

點擊登錄,效果如下:

本文參考官方文檔:
http://www.xuxueli.com/xxl-job/#/
有很多坑呀,不能傻瓜示的照著敲命令,那樣是不行的!