You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by he...@apache.org on 2020/03/10 04:55:46 UTC
[flink] branch master updated: [FLINK-16167][python][doc] Improve
python_shell document
This is an automated email from the ASF dual-hosted git repository.
hequn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 8f8e358 [FLINK-16167][python][doc] Improve python_shell document
8f8e358 is described below
commit 8f8e35815c917616f98c13d056f20fefe36098f3
Author: jingwen-ywb <ji...@gmail.com>
AuthorDate: Wed Feb 19 21:08:11 2020 +0800
[FLINK-16167][python][doc] Improve python_shell document
This closes #11142.
---
docs/ops/python_shell.md | 26 +++++++++++---------------
docs/ops/python_shell.zh.md | 23 ++++++++++-------------
2 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/docs/ops/python_shell.md b/docs/ops/python_shell.md
index a2faea2..ac571c0 100644
--- a/docs/ops/python_shell.md
+++ b/docs/ops/python_shell.md
@@ -34,20 +34,16 @@ $ python --version
# the version printed here must be 3.5+
{% endhighlight %}
-<span class="label label-info">Note</span> Using Python UDF in Python Shell requires apache-beam 2.19.0. Run the following command to confirm that it meets the requirements before run the Shell in local mode:
+To use the shell with an integrated Flink cluster, you can simply install PyFlink with PyPi and execute the shell directly:
{% highlight bash %}
-$ python -m pip install apache-beam==2.19.0
+# install PyFlink
+$ python -m pip install apache-flink
+# execute the shell
+$ pyflink-shell.sh local
{% endhighlight %}
-To use the shell with an integrated Flink cluster just execute:
-
-{% highlight bash %}
-bin/pyflink-shell.sh local
-{% endhighlight %}
-
-in the root directory of your binary Flink directory. To run the Shell on a
-cluster, please see the Setup section below.
+To run the shell on a cluster, please see the Setup section below.
## Usage
@@ -130,7 +126,7 @@ The example below is a simple program in the Python shell:
To get an overview of what options the Python Shell provides, please use
{% highlight bash %}
-bin/pyflink-shell.sh --help
+pyflink-shell.sh --help
{% endhighlight %}
### Local
@@ -138,7 +134,7 @@ bin/pyflink-shell.sh --help
To use the shell with an integrated Flink cluster just execute:
{% highlight bash %}
-bin/pyflink-shell.sh local
+pyflink-shell.sh local
{% endhighlight %}
@@ -148,7 +144,7 @@ To use it with a running cluster, please start the Python shell with the keyword
and supply the host and port of the JobManager with:
{% highlight bash %}
-bin/pyflink-shell.sh remote <hostname> <portnumber>
+pyflink-shell.sh remote <hostname> <portnumber>
{% endhighlight %}
### Yarn Python Shell cluster
@@ -163,7 +159,7 @@ For example, to start a Yarn cluster for the Python Shell with two TaskManagers
use the following:
{% highlight bash %}
-bin/pyflink-shell.sh yarn -n 2
+pyflink-shell.sh yarn -n 2
{% endhighlight %}
For all other options, see the full reference at the bottom.
@@ -175,7 +171,7 @@ If you have previously deployed a Flink cluster using the Flink Yarn Session,
the Python shell can connect with it using the following command:
{% highlight bash %}
-bin/pyflink-shell.sh yarn
+pyflink-shell.sh yarn
{% endhighlight %}
diff --git a/docs/ops/python_shell.zh.md b/docs/ops/python_shell.zh.md
index 09dbccc..88846d8 100644
--- a/docs/ops/python_shell.zh.md
+++ b/docs/ops/python_shell.zh.md
@@ -34,16 +34,13 @@ $ python --version
# the version printed here must be 3.5+
{% endhighlight %}
-<span class="label label-info">注意</span> 在Python Shell中使用Python UDF依赖apache-beam 2.19.0。 在以本地模式执行之前,执行以下命令以确认环境满足需求:
+你可以通过PyPi安装PyFlink,然后使用Python Shell:
{% highlight bash %}
-$ python -m pip install apache-beam==2.19.0
-{% endhighlight %}
-
-为了使用Flink的Python Shell,你只需要在Flink的binary目录下执行:
-
-{% highlight bash %}
-bin/pyflink-shell.sh local
+# 安装 PyFlink
+$ python -m pip install apache-flink
+# 执行脚本
+$ pyflink-shell.sh local
{% endhighlight %}
关于如何在一个Cluster集群上运行Python shell,可以参考启动章节介绍。
@@ -129,7 +126,7 @@ bin/pyflink-shell.sh local
查看Python Shell提供的可选参数,可以使用:
{% highlight bash %}
-bin/pyflink-shell.sh --help
+pyflink-shell.sh --help
{% endhighlight %}
### Local
@@ -137,7 +134,7 @@ bin/pyflink-shell.sh --help
Python Shell运行在local模式下,只需要执行:
{% highlight bash %}
-bin/pyflink-shell.sh local
+pyflink-shell.sh local
{% endhighlight %}
@@ -147,7 +144,7 @@ Python Shell运行在一个指定的JobManager上,通过关键字`remote`和
的地址和端口号来进行指定:
{% highlight bash %}
-bin/pyflink-shell.sh remote <hostname> <portnumber>
+pyflink-shell.sh remote <hostname> <portnumber>
{% endhighlight %}
### Yarn Python Shell cluster
@@ -157,7 +154,7 @@ Python Shell可以运行在YARN集群之上。Python shell在Yarn上部署一个
例如,在一个部署了两个TaskManager的Yarn集群上运行Python Shell:
{% highlight bash %}
-bin/pyflink-shell.sh yarn -n 2
+pyflink-shell.sh yarn -n 2
{% endhighlight %}
关于所有可选的参数,可以查看本页面底部的完整说明。
@@ -168,7 +165,7 @@ bin/pyflink-shell.sh yarn -n 2
如果你已经通过Flink Yarn Session部署了一个Flink集群,能够通过以下的命令连接到这个集群:
{% highlight bash %}
-bin/pyflink-shell.sh yarn
+pyflink-shell.sh yarn
{% endhighlight %}