You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/11/14 04:24:48 UTC

[incubator-streampark-website] branch dev updated: [Improve][Docs][User-Guide] Improve the deployment document of user-g… (#156)

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

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


The following commit(s) were added to refs/heads/dev by this push:
     new cf1e6eeb [Improve][Docs][User-Guide] Improve the deployment document of user-g… (#156)
cf1e6eeb is described below

commit cf1e6eeb14a39ec843404850aec595c05f5d3bcf
Author: Tyrantlucifer <ty...@apache.org>
AuthorDate: Mon Nov 14 12:24:43 2022 +0800

    [Improve][Docs][User-Guide] Improve the deployment document of user-g… (#156)
    
    * [Improve][Docs][User-Guide] Improve the deployment document of user-guide
    
    * [Improve][Docs][User-Guide] Add jdbc driver tips
---
 docs/user-guide/1-deployment.md                    | 77 +++++++++++++++-------
 .../current/user-guide/1-deployment.md             | 77 +++++++++++++++-------
 2 files changed, 106 insertions(+), 48 deletions(-)

diff --git a/docs/user-guide/1-deployment.md b/docs/user-guide/1-deployment.md
index f91dbf46..2303ea2d 100755
--- a/docs/user-guide/1-deployment.md
+++ b/docs/user-guide/1-deployment.md
@@ -51,6 +51,7 @@ You can directly download the compiled [**release package**](https://github.com/
 
 - Maven 3.6+
 - npm 7.11.2 ( https://nodejs.org/en/ )
+- pnpm (npm install -g pnpm)
 - JDK 1.8+
 
 ### Compile and package
@@ -154,7 +155,8 @@ streampark-console-service-1.2.1
 │    ├── streampark-jvm-profiler-1.0.0.jar       //jvm-profiler, flame graph related functions (internal use, users do not need to pay attention)
 │    └── streampark-flink-sqlclient-1.0.0.jar    //Flink SQl submit related functions (for internal use, users do not need to pay attention)
 ├── script
-│     ├── final                               // Complete ddl build table sql
+│     ├── schema                               // Complete ddl build table sql
+│     ├── data                               // The data sql of tables
 │     ├── upgrade                             // The sql of the upgrade part of each version (only the sql changes from the previous version to this version are recorded)
 ├── logs                                      //program log directory
 
@@ -167,10 +169,26 @@ In the installation process of versions before 1.2.1, there is no need to manual
 
 ```textmate
 ├── script
-│     ├── final                 // Complete ddl build table sql
-│     ├── upgrade               // The sql of the upgrade part of each version (only the sql changes from the previous version to this version are recorded)
+│     ├── schema                               // Complete ddl build table sql
+│     ├── data                               // The data sql of tables
+│     ├── upgrade                             // The sql of the upgrade part of each version (only the sql changes from the previous version to this version are recorded)
+```
+
+Execute the sql files that in `schema` folder to initialize the table structure
+
+##### Initialize table data
+
+In the installation process of versions before 1.2.1, there is no need to manually initialize data, just set the database information, and some column operations such as table creation and data initialization will be automatically completed. Versions after 1.2.1 (included) are not included. Automatic table creation and upgrade requires the user to manually execute ddl for initialization. The ddl description is as follows:
+
+```textmate
+├── script
+│     ├── schema                               // Complete ddl build table sql
+│     ├── data                               // The data sql of tables
+│     ├── upgrade                             // The sql of the upgrade part of each version (only the sql changes from the previous version to this version are recorded)
 ```
 
+Execute the sql files that in `data` folder to initialize the table data
+
 ##### Modify the configuration
 The installation and unpacking have been completed, and the next step is to prepare the data-related work
 
@@ -178,29 +196,40 @@ The installation and unpacking have been completed, and the next step is to prep
 Make sure to create a new database `streampark` in mysql that the deployment machine can connect to
 
 ###### Modify connection information
-Go to `conf`, modify `conf/application.yml`, find the datasource item, find the mysql configuration, and modify it to the corresponding information, as follows
+Go to `conf`, modify `conf/application.yml`, find the spring item, find the profiles.active configuration, and modify it to the corresponding information, as follows
+
+```yaml
+spring:
+  profiles.active: mysql #[h2,pgsql,mysql]
+  application.name: StreamPark
+  devtools.restart.enabled: false
+  mvc.pathmatch.matching-strategy: ant_path_matcher
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 500MB
+      max-request-size: 500MB
+  aop.proxy-target-class: true
+  messages.encoding: utf-8
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+  main:
+    allow-circular-references: true
+    banner-mode: off
+```
+
+After modify `conf/application.yml`, then modify the `config/application-mysql.yml` to change the config information of database as follows:
+
+**Tips: Because of license incompatibility between Apache project and mysql jdbc driver, so you should download mysql jdbc driver by yourself and put it in $STREAMPARK_HOME/lib**
 
 ```yaml
-datasource:
-  dynamic:
-    # Whether to open SQL log output, it is recommended to close the production environment, there is performance loss
-    p6spy: false
-    hikari:
-      connection-timeout: 30000
-      max-lifetime: 1800000
-      max-pool-size: 15
-      min-idle: 5
-      connection-test-query: select 1
-      pool-name: HikariCP-DS-POOL
-    # Configure the default data source
-    primary: primary
-    datasource:
-      # datasource-1, named primary
-      primary:
-        username: $user
-        password: $password
-        driver-class-name: com.mysql.cj.jdbc.Driver
-        url: jdbc: mysql://$host:$port/streampark?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
+spring:
+  datasource:
+    username: root
+    password: xxxx
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
 ```
 
 ###### Modify workspace
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/1-deployment.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/1-deployment.md
index 7e49ee48..3aae360e 100755
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/1-deployment.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/user-guide/1-deployment.md
@@ -51,6 +51,7 @@ export HADOOP_YARN_HOME=$HADOOP_HOME/../hadoop-yarn
 
 - Maven 3.6+
 - npm 7.11.2 ( https://nodejs.org/en/ )
+- pnpm (npm install -g pnpm)
 - JDK 1.8+
 
 ### 编译打包
@@ -155,7 +156,8 @@ streampark-console-service-1.2.1
 │    ├── streampark-jvm-profiler-1.0.0.jar       //jvm-profiler,火焰图相关功能 ( 内部使用,用户无需关注 )
 │    └── streampark-flink-sqlclient-1.0.0.jar    //Flink SQl 提交相关功能 ( 内部使用,用户无需关注 )
 ├── script
-│     ├── final                               // 完整的ddl建表sql
+│     ├── schema                               // 完整的ddl建表sql
+│     ├── data                               // 完整的dml插入数据sql
 │     ├── upgrade                             // 每个版本升级部分的sql(只记录从上个版本到本次版本的sql变化)
 ├── logs                                      //程序 log 目录
 
@@ -168,10 +170,26 @@ streampark-console-service-1.2.1
 
 ```textmate
 ├── script
-│     ├── final                 // 完整的ddl建表sql
-│     ├── upgrade               // 每个版本升级部分的sql(只记录从上个版本到本次版本的sql变化)
+│     ├── schema                               // 完整的ddl建表sql
+│     ├── data                               // 完整的dml插入数据sql
+│     ├── upgrade                             // 每个版本升级部分的sql(只记录从上个版本到本次版本的sql变化)
 ```
 
+执行schema文件夹中的sql来初始化表结构
+
+##### 初始化表数据
+
+在 1.2.1之前的版本安装过程中不需要手动做数据初始化,只需要设置好数据库信息即可,会自动完成建表和数据初始化等一些列操作, 1.2.1(包含)之后的版本里不在自动建表和升级,需要用户手动执行ddl进行初始化操作,ddl说明如下:
+
+```textmate
+├── script
+│     ├── schema                               // 完整的ddl建表sql
+│     ├── data                               // 完整的dml插入数据sql
+│     ├── upgrade                             // 每个版本升级部分的sql(只记录从上个版本到本次版本的sql变化)
+```
+
+执行data文件夹中的sql来初始化表数据
+
 ##### 修改配置
 安装解包已完成,接下来准备数据相关的工作
 
@@ -179,29 +197,40 @@ streampark-console-service-1.2.1
 确保在部署机可以连接的 mysql 里新建数据库 `streampark`
 
 ###### 修改连接信息
-进入到 `conf` 下,修改 `conf/application.yml`,找到 datasource 这一项,找到 mysql 的配置,修改成对应的信息即可,如下
+进入到 `conf` 下,修改 `conf/application.yml`,找到 spring 这一项,找到 profiles.active 的配置,修改成对应的信息即可,如下
+
+```yaml
+spring:
+  profiles.active: mysql #[h2,pgsql,mysql]
+  application.name: StreamPark
+  devtools.restart.enabled: false
+  mvc.pathmatch.matching-strategy: ant_path_matcher
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 500MB
+      max-request-size: 500MB
+  aop.proxy-target-class: true
+  messages.encoding: utf-8
+  jackson:
+    date-format: yyyy-MM-dd HH:mm:ss
+    time-zone: GMT+8
+  main:
+    allow-circular-references: true
+    banner-mode: off
+```
+ 
+在修改完 `conf/application.yml` 后, 还需要修改 `config/application-mysql.yml` 中的数据库连接信息:
+
+**Tips: 由于Apache 2.0许可与Mysql Jdbc驱动许可的不兼容,用户需要自行下载驱动jar包并放在 $STREAMPARK_HOME/lib 中**
 
 ```yaml
-datasource:
-  dynamic:
-    # 是否开启 SQL 日志输出,生产环境建议关闭,有性能损耗
-    p6spy: false
-    hikari:
-      connection-timeout: 30000
-      max-lifetime: 1800000
-      max-pool-size: 15
-      min-idle: 5
-      connection-test-query: select 1
-      pool-name: HikariCP-DS-POOL
-    # 配置默认数据源
-    primary: primary
-    datasource:
-      # 数据源-1,名称为 primary
-      primary:
-        username: $user
-        password: $password
-        driver-class-name: com.mysql.cj.jdbc.Driver
-        url: jdbc: mysql://$host:$port/streampark?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
+spring:
+  datasource:
+    username: root
+    password: xxxx
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
 ```
 
 ###### 修改workspace