This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 4be278f add deployment,installation,quick-start Chinese docs (#1385)
4be278f is described below
commit 4be278ff73404159facb63c4f928583a803bfbcb
Author: Xiao Zhao <[email protected]>
AuthorDate: Thu Mar 3 18:46:04 2022 +0800
add deployment,installation,quick-start Chinese docs (#1385)
* add deployment,installation,quick-start Chinese docs
* add deployment,installation,quick-start Chinese docs
---
docs/zh-CN/spark/configuration/ConfigExamples.md | 9 ++
docs/zh-CN/spark/deployment.md | 72 +++++++++++++++
docs/zh-CN/spark/installation.md | 29 ++++++
docs/zh-CN/spark/quick-start.md | 107 +++++++++++++++++++++++
4 files changed, 217 insertions(+)
diff --git a/docs/zh-CN/spark/configuration/ConfigExamples.md
b/docs/zh-CN/spark/configuration/ConfigExamples.md
new file mode 100644
index 0000000..6c828b5
--- /dev/null
+++ b/docs/zh-CN/spark/configuration/ConfigExamples.md
@@ -0,0 +1,9 @@
+# 配置示例
+
+> 完整的配置案例 [Spark]
+
+- 示例 1: [Streaming streaming
computing](https://github.com/apache/incubator-seatunnel/blob/dev/config/spark.streaming.conf.template)
+
+- 示例 2: [Batch offline batch
processing](https://github.com/apache/incubator-seatunnel/blob/dev/config/spark.batch.conf.template)
+
+如果你想了解配置格式的细节, 请参考
[HOCON](https://github.com/lightbend/config/blob/main/HOCON.md).
\ No newline at end of file
diff --git a/docs/zh-CN/spark/deployment.md b/docs/zh-CN/spark/deployment.md
new file mode 100644
index 0000000..72dc103
--- /dev/null
+++ b/docs/zh-CN/spark/deployment.md
@@ -0,0 +1,72 @@
+## 部署和运行
+
+> Seatunnel v2 For Spark 依赖Java运行时环境和Spark. 详细的Seatunnel安装步骤, 请参考
[安装Seatunnel](./installation.md)
+
+下面主要介绍不同的任务运行模式:
+
+## Local模式运行
+
+```bash
+./bin/start-seatunnel-spark.sh \
+--master local[4] \
+--deploy-mode client \
+--config ./config/application.conf
+```
+
+## Spark Standalone cluster模式运行
+
+```bash
+# client mode
+./bin/start-seatunnel-spark.sh \
+--master spark://ip:7077 \
+--deploy-mode client \
+--config ./config/application.conf
+
+# cluster mode
+./bin/start-seatunnel-spark.sh \
+--master spark://ip:7077 \
+--deploy-mode cluster \
+--config ./config/application.conf
+```
+
+## Yarn 模式运行
+
+```bash
+# client mode
+./bin/start-seatunnel-spark.sh \
+--master yarn \
+--deploy-mode client \
+--config ./config/application.conf
+
+# cluster mode
+./bin/start-seatunnel-spark.sh \
+--master yarn \
+--deploy-mode cluster \
+--config ./config/application.conf
+```
+
+## Mesos cluster模式运行
+
+```bash
+# cluster mode
+./bin/start-seatunnel-spark.sh \
+--master mesos://ip:7077 \
+--deploy-mode cluster \
+--config ./config/application.conf
+```
+
+`start-seatunnel-spark.sh`中`master` and `deploy-mode`的参数含义 , 请参考:
[命令说明](./commands/start-seatunnel-spark.sh.md)
+
+如果想指定`seatunnel`运行时使用的资源或其他 `Spark参数` , 可以在配置文件中通过 `--config`指定 :
+
+```bash
+env {
+ spark.executor.instances = 2
+ spark.executor.cores = 1
+ spark.executor.memory = "1g"
+ ...
+}
+...
+```
+
+`seatunnel`的配置方式,请参考`seatunnel` [公共配置](./configuration)
diff --git a/docs/zh-CN/spark/installation.md b/docs/zh-CN/spark/installation.md
new file mode 100644
index 0000000..f986777
--- /dev/null
+++ b/docs/zh-CN/spark/installation.md
@@ -0,0 +1,29 @@
+# 下载和安装
+
+## 下载
+
+```bash
+https://github.com/apache/incubator-seatunnel/releases
+```
+
+## 环境准备
+
+### 准备 JDK1.8
+
+`Seatunnel` 依赖`JDK1.8`.
+
+### 准备Spark
+
+`Seatunnel` 依赖`Spark`。安装`seatunnel`前,需要准备好`Spark`。请先 [下载
Spark](https://spark.apache.org/downloads.html) , 选择 `Spark 版本 >= 2.x.x`。
在下载和解压后, 不需要任何配置就可以指定 `deploy-mode = local` 提交任务。 如果需要使用其他模式,如 `Standalone
cluster`,`Yarn cluster` ,`Mesos cluster`, 请参考官方文档。
+
+## 安装 Seatunnel
+
+下载`seatunnel` 安装包并解压:
+
+```bash
+wget
https://github.com/apache/incubator-seatunnel/releases/download/v<version>/seatunnel-<version>.zip
-O seatunnel-<version>.zip
+unzip seatunnel-<version>.zip
+ln -s seatunnel-<version> seatunnel
+```
+
+这里没有完整的安装和配置步骤。 请参考 [快速开始](./quick-start.md) 和
[配置](./configuration)去使用`seatunnel`。
diff --git a/docs/zh-CN/spark/quick-start.md b/docs/zh-CN/spark/quick-start.md
new file mode 100644
index 0000000..e0919af
--- /dev/null
+++ b/docs/zh-CN/spark/quick-start.md
@@ -0,0 +1,107 @@
+# 快速开始
+
+> 通过一个从`socket`接收数据,然后划分数据到多列后输出的例子来了解如何使用`Seatunnel`.
+
+## 第一步: 准备Spark运行时环境
+
+> 如果你熟悉Spark,或者已经有Spark环境, 可以忽略这一步。我们不需要对Spark做任何配置。
+
+请先[下载Spark](https://spark.apache.org/downloads.html), 选择`Spark版本 >=
2.x.x`。在下载并解压之后, 不需要修改配置就可以指定 `deploy-mode = local`去提交任务。如果想将任务运行在`Standalone
clusters`, `Yarn clusters`, `Mesos clusters`, 请参考在Spark官网
[Spark部署文档](https://spark.apache.org/docs/latest/cluster-overview.html).
+
+### 第二布: 下载 Seatunnel
+
+通过[Seatunnel安装包下载](https://github.com/apache/incubator-seatunnel/releases)
下载最新版本 `seatunnel-<version>.zip`
+
+或者下载指定的版本 (以`2.0.4`为例):
+
+```bash
+wget
https://github.com/apache/incubator-seatunnel/releases/download/v2.0.4/waterdrop-dist-2.0.4-2.11.8-release.zip
-O seatunnel-2.0.4.zip
+```
+
+下载完成后解压:
+
+```bash
+unzip seatunnel-<version>.zip
+ln -s seatunnel-<version> seatunnel
+```
+
+## 步骤 3: 配置 seatunnel
+
+- 编辑 `config/seatunnel-env.sh` , 指定必要的环境变量,比如`SPARK_HOME` (步骤 1解压后的目录)
+
+- 创建一个新的 `config/application.conf` , 它决定了`Seatunnel`被启动后,数据如何被输入,处理和输出。
+
+```bash
+env {
+ # seatunnel defined streaming batch duration in seconds
+ spark.streaming.batchDuration = 5
+
+ spark.app.name = "seatunnel"
+ spark.ui.port = 13000
+}
+
+source {
+ socketStream {}
+}
+
+transform {
+ split {
+ fields = ["msg", "name"]
+ delimiter = ","
+ }
+}
+
+sink {
+ console {}
+}
+```
+
+## 步骤 4: 启动 `netcat server`发送数据
+
+```bash
+nc -lk 9999
+```
+
+## 步骤 5: 启动 Seatunnel
+
+```bash
+cd seatunnel
+./bin/start-seatunnel-spark.sh \
+--master local[4] \
+--deploy-mode client \
+--config ./config/application.conf
+```
+
+## 步骤 6: Input at the `nc` terminal
+
+```bash
+Hello World, seatunnel
+```
+
+`Seatunnel`日志输出:
+
+```bash
++----------------------+-----------+---------+
+|raw_message |msg |name |
++----------------------+-----------+---------+
+|Hello World, seatunnel|Hello World|seatunnel|
++----------------------+-----------+---------+
+```
+
+## 总结
+
+`Seatunnel`是简单而且易用的, 还有更丰富的数据处理功能有待发现。 本文展示的数据处理案例,无需任何代码、编译、打包,比官方文档更简单
[快速开始](https://spark.apache.org/docs/latest/streaming-programming-guide.html#a-quick-example).
+
+如果想了解更多的`Seatunnel`配置案例, 请参考:
+
+- Configuration example 2: [Batch offline batch
processing](https://github.com/apache/incubator-seatunnel/blob/dev/config/spark.batch.conf.template)
+
+The above configuration is the default [offline batch configuration template],
which can be run directly, the command is as follows:
+
+```bash
+cd seatunnel
+./bin/start-seatunnel-spark.sh \
+--master 'local[2]' \
+--deploy-mode client \
+--config ./config/spark.batch.conf.template
+```