From 7cf4a70b486041ea1eec35ca8bf4f6f67743fa3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Wed, 22 Aug 2018 20:58:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:bug:=20eureka=20host=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-eureka/src/main/resources/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pigx-eureka/src/main/resources/bootstrap.yml b/pigx-eureka/src/main/resources/bootstrap.yml index 8f1cbe986..2c36ec856 100644 --- a/pigx-eureka/src/main/resources/bootstrap.yml +++ b/pigx-eureka/src/main/resources/bootstrap.yml @@ -13,7 +13,7 @@ spring: # 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway eureka: instance: - hostname: pigx-eureka + hostname: localhost prefer-ip-address: true client: register-with-eureka: false From caa923843e927fb84ba0b966191ee0441651a925 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Mon, 3 Sep 2018 12:56:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-config/src/main/resources/config/pigx-auth-dev.yml | 4 ++-- pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 4 ++-- pigx-config/src/main/resources/config/pigx-daemon-dev.yml | 6 +++--- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pigx-config/src/main/resources/config/pigx-auth-dev.yml b/pigx-config/src/main/resources/config/pigx-auth-dev.yml index f8a9b6464..0a9e9aee8 100644 --- a/pigx-config/src/main/resources/config/pigx-auth-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-auth-dev.yml @@ -4,5 +4,5 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 46304f871..108ad7d41 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -12,8 +12,8 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index effd2ac2c..2051c1515 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -13,12 +13,12 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false elasticjob: # 分布式任务协调依赖zookeeper zookeeper: - server-lists: 114.116.45.246:13181 + server-lists: 127.0.0.1:2181 namespace: pigx-daemon # 普通任务 simples: diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index 541b41bde..aff10bc63 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -12,8 +12,8 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: Bjyjht2017!@# - url: jdbc:mysql://114.116.30.176:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false # mybaits 模块配置 mybatis-plus: From 9f933f7d6eec3a19d1671d8bbbade64f9a8973e2 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Mon, 3 Sep 2018 13:36:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pigx-config/src/main/resources/config/pigx-auth-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-daemon-dev.yml | 2 +- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pigx-config/src/main/resources/config/pigx-auth-dev.yml b/pigx-config/src/main/resources/config/pigx-auth-dev.yml index 0a9e9aee8..8abdbf645 100644 --- a/pigx-config/src/main/resources/config/pigx-auth-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-auth-dev.yml @@ -4,5 +4,5 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 108ad7d41..19fde2cb1 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -12,7 +12,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false jackson: time-zone: GMT+8 diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index 2051c1515..892f6174e 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -13,7 +13,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false elasticjob: # 分布式任务协调依赖zookeeper diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index aff10bc63..bfa68b9c9 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -12,7 +12,7 @@ spring: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: root url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false # mybaits 模块配置 From 5f94fe8323f63c1fbdc4845cdb3c1046000ae819 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Tue, 4 Sep 2018 18:04:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?:memo:=20=E7=BC=96=E5=86=99=E6=96=87?= =?UTF-8?q?=E6=A1=A3:=E6=96=B0=E5=A2=9Eelastic-job=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E5=B9=B3=E5=8F=B0=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/md/catalog.md | 2 + doc/md/elastic-job-monitor-platform.md | 74 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 doc/md/elastic-job-monitor-platform.md diff --git a/doc/md/catalog.md b/doc/md/catalog.md index f9de413e8..3450b0ba5 100644 --- a/doc/md/catalog.md +++ b/doc/md/catalog.md @@ -7,3 +7,5 @@ > [代码生成使用](codegen.md) > [社交登录使用](social.md) + +> [任务监控平台搭建](elastic-job-monitor-platform.md) diff --git a/doc/md/elastic-job-monitor-platform.md b/doc/md/elastic-job-monitor-platform.md new file mode 100644 index 000000000..05e028c55 --- /dev/null +++ b/doc/md/elastic-job-monitor-platform.md @@ -0,0 +1,74 @@ +# Elastic-Job作业监控平台搭建 + +## 获取源码 +首先是上github下载elastic-job的源码,目前最新的地址如下: https://github.com/elasticjob/elastic-job-lite + +下载前要注意源码需要和你使用的elastic-job版本一致。 + +![20189416555](http://p7sojn4oj.bkt.clouddn.com/20189416555.png) + + +1. 在你喜欢的终端应用里执行以下命令: + +```bash +git clone https://github.com/elasticjob/elastic-job-lite.git +``` + +2. 下载完成以后cd到仓库 + +3. 以PigX所使用的2.1.5版本为例,执行以下命令切换到2.1.5标签的代码: + +```bash +git checkout 2.1.5 +``` + +## 编译源码 + +这个过程很简单,执行命令: + +```bash +mvn package -DskipTests +``` + +## 开始使用 + +1. 进入/elastic-job-lite/elastic-job-lite-console/target文件夹,有一个叫做```elastic-job-lite-console-2.1.5.tar.gz```的文件就是我们需要的了。 + +2. 解压之,执行bin目录下的start脚本,这货默认运行在```8899```端口,以用户名:```root```和密码:```root```进行登录 + +3. 知道大家可能看不懂,右上角切换一波语言吧! + +4. 以pigx最新的1.6.0的稳定版代码为例,查看配置中心下的```pigx-daemon-dev.yml```文件,与我们目前相关的配置文件如下: + +```yml +## 定时任务 +spring: + # 保存定时任务的数据源 + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.jdbc.Driver + username: root + password: root + url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false + elasticjob: + # 分布式任务协调依赖zookeeper + zookeeper: + server-lists: 127.0.0.1:2181 + namespace: pigx-daemon +``` + +通过全局配置-注册中心配置,填入以下参数: + +![201894174025](http://p7sojn4oj.bkt.clouddn.com/201894174025.png) + +然后修改全局配置-事件追踪数据源配置,填入以下参数: + +![20189417457](http://p7sojn4oj.bkt.clouddn.com/20189417457.png) + +在操作处点击连接,出现已连的字样表示连接成功。 + +![201894174634](http://p7sojn4oj.bkt.clouddn.com/201894174634.png) + +最终效果如下: + +![20189418110](http://p7sojn4oj.bkt.clouddn.com/20189418110.png) \ No newline at end of file