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 05:12:28 UTC

[flink] branch release-1.9 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 release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.9 by this push:
     new 22d177a  [FLINK-16167][python][doc] Improve python_shell document
22d177a is described below

commit 22d177ad5efa93d4c428dae076a02de7fe95d1e2
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    | 20 +++++++++++---------
 docs/ops/python_shell.zh.md | 17 ++++++++++-------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/docs/ops/python_shell.md b/docs/ops/python_shell.md
index 108eff4..9a669ad 100644
--- a/docs/ops/python_shell.md
+++ b/docs/ops/python_shell.md
@@ -25,14 +25,16 @@ under the License.
 Flink comes with an integrated interactive Python Shell.
 It can be used in a local setup as well as in a cluster setup.
 
-To use the shell with an integrated Flink cluster just execute:
+To use the shell with an integrated Flink cluster, you can simply install PyFlink with PyPi and execute the shell directly:
 
 {% highlight bash %}
-bin/pyflink-shell.sh local
+# install PyFlink
+$ python -m pip install apache-flink==1.9.*
+# execute the shell
+$ 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
 
@@ -115,7 +117,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
@@ -123,7 +125,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 %}
 
 
@@ -133,7 +135,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
@@ -148,7 +150,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.
@@ -160,7 +162,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 6f647a8..78b531e 100644
--- a/docs/ops/python_shell.zh.md
+++ b/docs/ops/python_shell.zh.md
@@ -25,10 +25,13 @@ under the License.
 Flink附带了一个集成的交互式Python Shell。
 它既能够运行在本地启动的local模式,也能够运行在集群启动的cluster模式下。
 
-为了使用Flink的Python Shell,你只需要在Flink的binary目录下执行:
+你可以通过PyPi安装PyFlink,然后使用Python Shell:
 
 {% highlight bash %}
-bin/pyflink-shell.sh local
+# 安装 PyFlink
+$ python -m pip install apache-flink==1.9.*
+# 执行脚本
+$ pyflink-shell.sh local
 {% endhighlight %}
 
 关于如何在一个Cluster集群上运行Python shell,可以参考启动章节介绍。
@@ -114,7 +117,7 @@ bin/pyflink-shell.sh local
 查看Python Shell提供的可选参数,可以使用:
 
 {% highlight bash %}
-bin/pyflink-shell.sh --help
+pyflink-shell.sh --help
 {% endhighlight %}
 
 ### Local
@@ -122,7 +125,7 @@ bin/pyflink-shell.sh --help
 Python Shell运行在local模式下,只需要执行:
 
 {% highlight bash %}
-bin/pyflink-shell.sh local
+pyflink-shell.sh local
 {% endhighlight %}
 
 
@@ -132,7 +135,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
@@ -143,7 +146,7 @@ Python Shell可以运行在YARN集群之上。YARN的container的数量可以通
 例如,在一个部署了两个TaskManager的Yarn集群上运行Python Shell:
 
 {% highlight bash %}
- bin/pyflink-shell.sh yarn -n 2
+pyflink-shell.sh yarn -n 2
 {% endhighlight %}
 
 关于所有可选的参数,可以查看本页面底部的完整说明。
@@ -154,7 +157,7 @@ Python Shell可以运行在YARN集群之上。YARN的container的数量可以通
 如果你已经通过Flink Yarn Session部署了一个Flink集群,能够通过以下的命令连接到这个集群:
 
 {% highlight bash %}
- bin/pyflink-shell.sh yarn
+pyflink-shell.sh yarn
 {% endhighlight %}