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

casion pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-linkis-website.git


The following commit(s) were added to refs/heads/dev by this push:
     new f1490d7e57 多数据源文档说明完善 (#489)
f1490d7e57 is described below

commit f1490d7e573bbb2e742a6903662b82b3a0a8f8fb
Author: weixiao <[email protected]>
AuthorDate: Tue Aug 23 10:48:05 2022 +0800

    多数据源文档说明完善 (#489)
    
    add jdbc Multi data source document
---
 docs/engine-usage/jdbc.md                          |  42 ++++++++++++++++
 .../current/engine-usage/jdbc.md                   |  53 +++++++++++++++++++--
 .../EngineUsage/muti-data-source-usage.png         | Bin 0 -> 24484 bytes
 static/Images-zh/EngineUsage/muti-data-source.png  | Bin 0 -> 65562 bytes
 .../Images/EngineUsage/muti-data-source-usage.png  | Bin 0 -> 24484 bytes
 static/Images/EngineUsage/muti-data-source.png     | Bin 0 -> 65562 bytes
 6 files changed, 90 insertions(+), 5 deletions(-)

diff --git a/docs/engine-usage/jdbc.md b/docs/engine-usage/jdbc.md
index ba1b5cccde..3424779019 100644
--- a/docs/engine-usage/jdbc.md
+++ b/docs/engine-usage/jdbc.md
@@ -108,6 +108,48 @@ Figure 3-3 DataSource Manage
 
 Figure 3-4 DataSource Conn Test
 
+After the data source is completed, you can use the JDBC multi-data source 
switch to add, there are functional methods:
+1. Specify the data source name parameter through the interface parameter, as 
shown below:
+![](/Images/EngineUsage/muti-data-source.png)
+
+Parameter example:
+```json
+{
+    "executionContent": {"code": "show databases", "runType":  "jdbc"},
+    "params": {"variable": {}, "configuration": {"startup":{}, 
+    "runtime": 
+       { 
+               "dataSources": {"wds.linkis.engine.runtime.datasource": 
"test_mysql"
+       }
+    }}},
+    "source":  {"scriptPath": ""},
+    "labels": {
+        "engineType": "jdbc-4",
+        "userCreator": "linkis-IDE"
+    }
+}
+```
+
+Parameter: wds.linkis.engine.runtime.datasource is a configuration with a 
fixed name, do not modify the name definition arbitrarily
+
+2. Through the Scripts code submission entry of DSS, drop down and filter the 
data sources to be submitted, as shown in the following figure:
+   ![](/Images/EngineUsage/muti-data-source-usage.png)
+
+Currently dss-1.1.0 does not yet support drop-down selection of data source 
name, PR is under development, you can wait for subsequent releases or pay 
attention to related PRs:
+(https://github.com/WeBankFinTech/DataSphereStudio/issues/940)
+
+Function description of multiple data sources:
+
+1) In the previous version, the JDBC engine's support for data sources was not 
perfect, especially when used with Scripts, the jdbc script type can only bind 
a set of JDBC engine parameters of the console.
+   When we need to switch multiple data sources, we can only modify the 
connection parameters of the jdbc engine, which is troublesome.
+
+2) With the data source management, we introduce the multi-data source 
switching function of the JDBC engine, which can realize that only by setting 
the data source name, the job can be submitted to different JDBC services, and 
ordinary users do not need to
+   It maintains the connection information of the data source, avoids the 
complicated configuration, and also meets the security requirements of the data 
source connection password and other configurations.
+
+3) The data source set in the multi-data source management can be loaded by 
the JDBC engine only after it is published, and the data source that has not 
expired, otherwise, different types of exception prompts will be fed back to 
the user.
+
+4) The loading priority of jdbc engine parameters is: task submission 
parameters > select data source parameters > console JDBC engine parameters
+
 ## 4. JDBC EngineConn user settings
 
 JDBC user settings are mainly JDBC connection information, but it is 
recommended that users encrypt and manage this password and other information.
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/jdbc.md 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/jdbc.md
index 37a92ec23b..9dfbeda0d4 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/jdbc.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/engine-usage/jdbc.md
@@ -18,7 +18,7 @@ sidebar_position: 7
 ,或者按以下流程,手动编译部署
 
 
-单独编译jdbc引擎 
+单独编译jdbc引擎
 
 ```
 ${linkis_code_dir}/linkis-engineconn-plugins/jdbc/
@@ -44,7 +44,7 @@ sh linkis-daemon.sh restart cg-engineplugin
 
 Linkis1.X是通过标签来进行的,所以需要在我们数据库中插入数据,插入的方式如下文所示。
 
-[EngineConnPlugin引擎插件安装](../deployment/engine-conn-plugin-installation) 
+[EngineConnPlugin引擎插件安装](../deployment/engine-conn-plugin-installation)
 
 
 ## 3.JDBC引擎的使用
@@ -53,7 +53,7 @@ Linkis1.X是通过标签来进行的,所以需要在我们数据库中插入
 
 您需要配置JDBC的连接信息,包括连接地址信息和用户名以及密码。
 
-![jdbc](https://user-images.githubusercontent.com/29391030/168045539-9cea6c44-56a9-4b14-86fb-1e65f937ae54.png)
  
+![jdbc](https://user-images.githubusercontent.com/29391030/168045539-9cea6c44-56a9-4b14-86fb-1e65f937ae54.png)
 
 图3-1 JDBC配置信息
 
@@ -121,8 +121,8 @@ JDBC的执行原理是通过加载JDBC的Driver然后提交sql到SQL的server去
 
 图3-2 JDBC的执行效果截图
 
-### 3.4 数据源管理
-Linkis 1.2.0后提供了数据源管理功能,我们可以在控制台管理不同的数据源。地址:登陆管理台-->数据源管理-->新增数据源
+### 3.4 多数据源支持
+从Linkis 1.2.0开始,提供了JDBC引擎多数据源的支持,我们首先可以在控制台管理不同的数据源。地址:登陆管理台-->数据源管理-->新增数据源
 
 ![](/Images-zh/EngineUsage/datasourcemanage.png)
 
@@ -132,6 +132,49 @@ Linkis 1.2.0后提供了数据源管理功能,我们可以在控制台管理
 
 图3-4 数据源连接测试
 
+数据源添加完成之后,就可以使用JDBC引擎的多数据源切换功能,有两种方式:
+1、通过接口参数指定数据源名称参数,如下图:
+![](/Images-zh/EngineUsage/muti-data-source.png)
+
+参数示例:
+```json
+{
+    "executionContent": {"code": "show databases", "runType":  "jdbc"},
+    "params": {"variable": {}, "configuration": {"startup":{}, 
+    "runtime": 
+       { 
+               "dataSources": {"wds.linkis.engine.runtime.datasource": 
"test_mysql"
+       }
+    }}},
+    "source":  {"scriptPath": ""},
+    "labels": {
+        "engineType": "jdbc-4",
+        "userCreator": "linkis-IDE"
+    }
+}
+```
+
+参数:wds.linkis.engine.runtime.datasource为固定名称的配置,不要随意修改名称定义
+
+2、通过DSS的Scripts代码提交入口下拉筛选需要提交的数据源,如下图:
+![](/Images-zh/EngineUsage/muti-data-source-usage.png)
+当前dss-1.1.0还暂不支持下拉选择数据源名称,PR在开发中,可以等后续发版或关注相关PR:
+(https://github.com/WeBankFinTech/DataSphereStudio/issues/940)
+
+
+多数据源的功能说明:
+
+1)在之前的版本中,JDBC引擎对数据源的支持不够完善,尤其是搭配Scripts使用的时候,jdbc脚本类型只能绑定控制台的一套JDBC引擎参数,
+当我们有多数据源的切换需求时,只能修改jdbc引擎的连接参数,比较麻烦。
+
+2)配合数据源管理,我们引入JDBC引擎的多数据源切换功能,可以实现只设置数据源名称,就可把作业提交到不同的JDBC服务之上,普通用户不需要
+维护数据源的连接信息,避免了配置繁琐,也满足了数据源连接密码等配置的安全性需要。
+
+3)多数据源管理中设置的数据源,只有发布之后,并且没有过期的数据源才能被JDBC引擎加载到,否则会反馈给用户不同类型的异常提示。
+
+4)jdbc引擎参数的加载优先级为:任务提交传参 > 选择数据源的参数 > 控制台JDBC引擎的参数
+
+
 ## 4.JDBC引擎的用户设置
 
 JDBC的用户设置是主要是的JDBC的连接信息,但是建议用户将此密码等信息进行加密管理。
diff --git a/static/Images-zh/EngineUsage/muti-data-source-usage.png 
b/static/Images-zh/EngineUsage/muti-data-source-usage.png
new file mode 100644
index 0000000000..cc017a5393
Binary files /dev/null and 
b/static/Images-zh/EngineUsage/muti-data-source-usage.png differ
diff --git a/static/Images-zh/EngineUsage/muti-data-source.png 
b/static/Images-zh/EngineUsage/muti-data-source.png
new file mode 100644
index 0000000000..4cc0f2b554
Binary files /dev/null and b/static/Images-zh/EngineUsage/muti-data-source.png 
differ
diff --git a/static/Images/EngineUsage/muti-data-source-usage.png 
b/static/Images/EngineUsage/muti-data-source-usage.png
new file mode 100644
index 0000000000..cc017a5393
Binary files /dev/null and 
b/static/Images/EngineUsage/muti-data-source-usage.png differ
diff --git a/static/Images/EngineUsage/muti-data-source.png 
b/static/Images/EngineUsage/muti-data-source.png
new file mode 100644
index 0000000000..4cc0f2b554
Binary files /dev/null and b/static/Images/EngineUsage/muti-data-source.png 
differ


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to