You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/17 06:44:55 UTC

[shardingsphere-elasticjob] branch master updated: Add schedule model and update elastic page (#1099)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new c34663d  Add schedule model and update elastic page (#1099)
c34663d is described below

commit c34663d7b27fc2319e06d7a8dbfadb77756e5b9c
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Jul 17 14:44:46 2020 +0800

    Add schedule model and update elastic page (#1099)
    
    * Add Schedule Model page
    
    * Update elastic schedule
---
 docs/content/dev-manual/lite-design.cn.md          |   6 +++
 docs/content/features/elastic.cn.md                |  51 +++++++++++++--------
 docs/content/features/elastic.en.md                |   4 +-
 docs/content/features/failover.cn.md               |   4 +-
 docs/content/features/failover.en.md               |   4 +-
 docs/content/features/jobt-ype.cn.md               |   4 +-
 docs/content/features/jobt-ype.en.md               |   4 +-
 docs/content/features/misfired.cn.md               |   4 +-
 docs/content/features/misfired.en.md               |   4 +-
 docs/content/features/resource.cn.md               |   4 +-
 docs/content/features/resource.en.md               |   4 +-
 docs/content/features/schedule-model.cn.md         |  19 ++++++++
 .../{elastic.en.md => schedule-model.en.md}        |   2 +-
 docs/static/img/elastic/ha.png                     | Bin 0 -> 204652 bytes
 docs/static/img/elastic/sacle-out.png              | Bin 0 -> 147035 bytes
 docs/static/img/elastic/sharding.png               | Bin 0 -> 142336 bytes
 16 files changed, 75 insertions(+), 39 deletions(-)

diff --git a/docs/content/dev-manual/lite-design.cn.md b/docs/content/dev-manual/lite-design.cn.md
index 92c27ab..d941851 100644
--- a/docs/content/dev-manual/lite-design.cn.md
+++ b/docs/content/dev-manual/lite-design.cn.md
@@ -5,6 +5,12 @@ weight = 1
 chapter = true
 +++
 
+## 分布式调度
+
+ElasticJob-Lite 并无作业调度中心节点,而是基于部署作业框架的程序在到达相应时间点时各自触发调度。
+
+注册中心仅用于作业注册和监控信息存储。而主作业节点仅用于处理分片和清理等功能。
+
 ## 弹性分布式实现
 
 * 第一台服务器上线触发主服务器选举。主服务器一旦下线,则重新触发选举,选举过程中阻塞,只有主服务器选举完成,才会执行其他任务。
diff --git a/docs/content/features/elastic.cn.md b/docs/content/features/elastic.cn.md
index d14eb08..c18b2fe 100644
--- a/docs/content/features/elastic.cn.md
+++ b/docs/content/features/elastic.cn.md
@@ -1,45 +1,56 @@
 +++
-pre = "<b>3.1. </b>"
+pre = "<b>3.2. </b>"
 title = "弹性调度"
-weight = 1
+weight = 2
 chapter = true
 +++
 
+弹性调度是 ElasticJob 最重要的功能,也是这款产品名称的由来。
+它是一款能够让任务通过分片进行水平扩展的任务处理系统。
+
 ## 分片
 
+ElasticJob 中任务分片项的概念,使得任务可以在分布式的环境下运行,每台任务服务器只运行分配给该服务器的分片。
+随着服务器的增加或宕机,ElasticJob 会近乎实时的感知服务器数量的变更,从而重新为分布式的任务服务器分配更加合理的任务分片项,使得任务可以随着资源的增加而提升效率。
+
 任务的分布式执行,需要将一个任务拆分为多个独立的任务项,然后由分布式的服务器分别执行某一个或几个分片项。
 
-例如:有一个遍历数据库某张表的作业,现有 2 台服务器。为了快速的执行作业,那么每台服务器应执行作业的 50%。
-为满足此需求,可将作业分成 2 片,每台服务器执行 1 片。作业遍历数据的逻辑应为:服务器 A 遍历 ID 以奇数结尾的数据;服务器 B 遍历 ID 以偶数结尾的数据。
-如果分成 10 片,则作业遍历数据的逻辑应为:每片分到的分片项应为 ID % 10,而服务器A被分配到分片项 0,1,2,3,4;服务器B被分配到分片项 5,6,7,8,9,直接的结果就是服务器A遍历 ID 以 0-4 结尾的数据;服务器 B 遍历 ID 以 5-9 结尾的数据。
+举例说明,如果作业分为 4 片,用两台服务器执行,则每个服务器分到 2 片,分别负责作业的 50% 的负载,如下图所示。
 
-### 分片项与业务处理解耦
+[分片作业](https://shardingsphere.apache.org/elasticjob/current/img/elastic/sharding.png)
 
-ElasticJob 并不直接提供数据处理的功能,框架只会将分片项分配至各个运行中的作业服务器,开发者需要自行处理分片项与真实数据的对应关系。
+### 分片项
 
-### 个性化参数
+ElasticJob 并不直接提供数据处理的功能,而是将分片项分配至各个运行中的作业服务器,开发者需要自行处理分片项与业务的对应关系。
+分片项为数字,始于 0 而终于分片总数减 1。
 
-个性化参数即 shardingItemParameter,可以和分片项匹配对应关系,用于将分片项的数字转换为更加可读的业务代码。
+### 个性化分片参数
 
-例如:按照地区水平拆分数据库,数据库A是北京的数据;数据库 B 是上海的数据;数据库 C 是广州的数据。
+个性化参数可以和分片项匹配对应关系,用于将分片项的数字转换为更加可读的业务代码。
+
+例如:按照地区水平拆分数据库,数据库 A 是北京的数据;数据库 B 是上海的数据;数据库 C 是广州的数据。
 如果仅按照分片项配置,开发者需要了解 0 表示北京;1 表示上海;2 表示广州。
 合理使用个性化参数可以让代码更可读,如果配置为 0=北京,1=上海,2=广州,那么代码中直接使用北京,上海,广州的枚举值即可完成分片项和业务逻辑的对应关系。
 
-## 分布式调度
+## 资源最大限度利用
 
-ElasticJob-Lite 并无作业调度中心节点,而是基于部署作业框架的程序在到达相应时间点时各自触发调度。
+ElasticJob 提供最灵活的方式,最大限度的提高执行作业的吞吐量。
+当新增加作业服务器时,ElasticJob 会通过注册中心的临时节点的变化感知到新服务器的存在,并在下次任务调度的时候重新分片,新的服务器会承载一部分作业分片,如下图所示。
 
-注册中心仅用于作业注册和监控信息存储。而主作业节点仅用于处理分片和清理等功能。
+[作业扩容](https://shardingsphere.apache.org/elasticjob/current/img/elastic/sacle-out.png)
 
-## 高可用
+将分片项设置为大于服务器的数量,最好是大于服务器倍数的数量,作业将会合理的利用分布式资源,动态的分配分片项。
 
-ElasticJob-Lite 提供最安全的方式执行作业。将分片总数设置为 1,并使用多于 1 台的服务器执行作业,作业将会以 1 主 n 从的方式执行。
+例如:3 台服务器,分成 10 片,则分片项分配结果为服务器 A = 0,1,2;服务器 B = 3,4,5;服务器 C = 6,7,8,9。
+如果服务器 C 崩溃,则分片项分配结果为服务器 A = 0,1,2,3,4; 服务器 B = 5,6,7,8,9。
+在不丢失分片项的情况下,最大限度的利用现有资源提高吞吐量。
 
-一旦执行作业的服务器崩溃,等待执行的服务器将会在下次作业启动时替补执行。开启失效转移功能效果更好,可以保证在本次作业执行时崩溃,备机立即启动替补执行。
+## 高可用
 
-## 最大限度利用资源
+当作业服务器在运行中宕机时,注册中心同样会通过临时节点感知,并将在下次运行时将分片转移至仍存活的服务器,以达到作业高可用的效果。
+本次由于服务器宕机而未执行完的作业,则可以通过失效转移的方式继续执行。如下图所示。
 
-ElasticJob-Lite 也提供最灵活的方式,最大限度的提高执行作业的吞吐量。将分片项设置为大于服务器的数量,最好是大于服务器倍数的数量,作业将会合理的利用分布式资源,动态的分配分片项。
+[作业高可用](https://shardingsphere.apache.org/elasticjob/current/img/elastic/ha.png)
 
-例如:3 台服务器,分成 10 片,则分片项分配结果为服务器 A=0,1,2;服务器 B=3,4,5;服务器 C=6,7,8,9。
-如果服务器 C 崩溃,则分片项分配结果为服务器 A=0,1,2,3,4;服务器 B=5,6,7,8,9。在不丢失分片项的情况下,最大限度的利用现有资源提高吞吐量。
+将分片总数设置为 1,并使用多于 1 台的服务器执行作业,作业将会以 1 主 n 从的方式执行。
+一旦执行作业的服务器崩溃,等待执行的服务器将会在下次作业启动时替补执行。开启失效转移功能效果更好,可以保证在本次作业执行时崩溃,备机立即启动替补执行。
diff --git a/docs/content/features/elastic.en.md b/docs/content/features/elastic.en.md
index 66f4df4..5c93f54 100644
--- a/docs/content/features/elastic.en.md
+++ b/docs/content/features/elastic.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.1. </b>"
+pre = "<b>3.2. </b>"
 title = "Elastic Schedule"
-weight = 1
+weight = 2
 chapter = true
 +++
 
diff --git a/docs/content/features/failover.cn.md b/docs/content/features/failover.cn.md
index 37f6192..ddcf043 100644
--- a/docs/content/features/failover.cn.md
+++ b/docs/content/features/failover.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.3. </b>"
+pre = "<b>3.4. </b>"
 title = "失效转移"
-weight = 3
+weight = 4
 chapter = true
 +++
 
diff --git a/docs/content/features/failover.en.md b/docs/content/features/failover.en.md
index c228768..db2ef99 100644
--- a/docs/content/features/failover.en.md
+++ b/docs/content/features/failover.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.3. </b>"
+pre = "<b>3.4. </b>"
 title = "Failover"
-weight = 3
+weight = 4
 chapter = true
 +++
 
diff --git a/docs/content/features/jobt-ype.cn.md b/docs/content/features/jobt-ype.cn.md
index 75f44fc..c8385fe 100644
--- a/docs/content/features/jobt-ype.cn.md
+++ b/docs/content/features/jobt-ype.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.5. </b>"
+pre = "<b>3.6. </b>"
 title = "作业开放生态"
-weight = 5
+weight = 6
 chapter = true
 +++
 
diff --git a/docs/content/features/jobt-ype.en.md b/docs/content/features/jobt-ype.en.md
index 2254dfe..d5b5d35 100644
--- a/docs/content/features/jobt-ype.en.md
+++ b/docs/content/features/jobt-ype.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.4. </b>"
+pre = "<b>3.6. </b>"
 title = "Job Open Ecosystem"
-weight = 4
+weight = 6
 chapter = true
 +++
 
diff --git a/docs/content/features/misfired.cn.md b/docs/content/features/misfired.cn.md
index f785023..e79bef2 100644
--- a/docs/content/features/misfired.cn.md
+++ b/docs/content/features/misfired.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.4. </b>"
+pre = "<b>3.5. </b>"
 title = "错过任务重执行"
-weight = 4
+weight = 5
 chapter = true
 +++
 
diff --git a/docs/content/features/misfired.en.md b/docs/content/features/misfired.en.md
index b20f9d6..2502553 100644
--- a/docs/content/features/misfired.en.md
+++ b/docs/content/features/misfired.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.4. </b>"
+pre = "<b>3.5. </b>"
 title = "Misfired"
-weight = 4
+weight = 5
 chapter = true
 +++
 
diff --git a/docs/content/features/resource.cn.md b/docs/content/features/resource.cn.md
index 281cb37..b0e95aa 100644
--- a/docs/content/features/resource.cn.md
+++ b/docs/content/features/resource.cn.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.2. </b>"
+pre = "<b>3.3. </b>"
 title = "资源分配"
-weight = 2
+weight = 3
 chapter = true
 +++
 
diff --git a/docs/content/features/resource.en.md b/docs/content/features/resource.en.md
index f5f6d90..c93adf5 100644
--- a/docs/content/features/resource.en.md
+++ b/docs/content/features/resource.en.md
@@ -1,7 +1,7 @@
 +++
-pre = "<b>3.2. </b>"
+pre = "<b>3.3. </b>"
 title = "Resource Assign"
-weight = 2
+weight = 3
 chapter = true
 +++
 
diff --git a/docs/content/features/schedule-model.cn.md b/docs/content/features/schedule-model.cn.md
new file mode 100644
index 0000000..c1f3746
--- /dev/null
+++ b/docs/content/features/schedule-model.cn.md
@@ -0,0 +1,19 @@
++++
+pre = "<b>3.1. </b>"
+title = "调度模型"
+weight = 1
+chapter = true
++++
+
+与大部分的作业平台不同,ElasticJob 的调度模型划分为支持线程级别调度的进程内调度 ElasticJob Lite,和进程级别调度的 ElasticJob Cloud。
+
+## 进程内调度
+
+ElasticJob Lite 是面向进程内的线程级调度框架。通过它,作业能够透明化的与业务应用系统相结合。
+它能够方便的与 Spring 、Dubbo 等 Java 框架配合使用,在作业中可自由使用 Spring 注入的 Bean,如数据源连接池、Dubbo 远程服务等,更加方便的贴合业务开发。
+
+## 进程级调度
+
+ElasticJob Cloud 拥有进程内调度和进程级别调度两种方式。
+由于 ElasticJob Cloud 能够对作业服务器的资源进行控制,因此其作业类型可划分为常驻任务和瞬时任务。
+常驻任务类似于 ElasticJob Lite,是进程内调度;瞬时任务则完全不同,它充分的利用了资源分配的削峰填谷能力,是进程级的调度,每次任务的会启动全新的进程处理。
diff --git a/docs/content/features/elastic.en.md b/docs/content/features/schedule-model.en.md
similarity index 69%
copy from docs/content/features/elastic.en.md
copy to docs/content/features/schedule-model.en.md
index 66f4df4..52cc904 100644
--- a/docs/content/features/elastic.en.md
+++ b/docs/content/features/schedule-model.en.md
@@ -1,6 +1,6 @@
 +++
 pre = "<b>3.1. </b>"
-title = "Elastic Schedule"
+title = "Schedule Model"
 weight = 1
 chapter = true
 +++
diff --git a/docs/static/img/elastic/ha.png b/docs/static/img/elastic/ha.png
new file mode 100644
index 0000000..c28dfb9
Binary files /dev/null and b/docs/static/img/elastic/ha.png differ
diff --git a/docs/static/img/elastic/sacle-out.png b/docs/static/img/elastic/sacle-out.png
new file mode 100644
index 0000000..3976d07
Binary files /dev/null and b/docs/static/img/elastic/sacle-out.png differ
diff --git a/docs/static/img/elastic/sharding.png b/docs/static/img/elastic/sharding.png
new file mode 100644
index 0000000..04af74f
Binary files /dev/null and b/docs/static/img/elastic/sharding.png differ