我一直在尝试让 Apache Beam 可移植性框架与 Python 和 Apache Flink 一起使用,但我似乎找不到一套完整的指令来让环境正常工作。是否有任何参考资料包含使简单的 python 管道正常工作的先决条件和步骤的完整列表?
总体而言,对于本地便携式跑步者(ULR)来说,请参阅维基百科 https://cwiki.apache.org/confluence/display/BEAM/Usage+Guide#UsageGuide-RunaPython-SDKPipeline,引用那里:
运行 Python-SDK 管道:
- 将容器编译为本地构建:
./gradlew :beam-sdks-python-container:docker
- 启动 ULR 作业服务器,例如:
./gradlew :beam-runners-reference-job-server:run -PlogLevel=debug -PvendorLogLevel=warning
。有关详细信息,请参阅上面链接中的 Java 部分。
3 正确设置python环境。更多细节可以在这里找到 https://cwiki.apache.org/confluence/display/BEAM/Python+Tips.
- 使用以下命令运行管道(在文件夹 sdk/python 下),
example:
python -m apache_beam.examples.wordcount\
--input=gs://dataflow-samples/shakespeare/kinglear.txt \
--output=/tmp/output \
--runner=PortableRunner \
--job_endpoint=localhost:8099 \
--experiments beam_fn_api
对于 Flink,您需要使用不同的作业服务器:./gradlew beam-runners-flink_2.11-job-server:runShadow
。主机:端口是localhost:8099
,
相关电子邮件讨论:one https://lists.apache.org/thread.html/b2b97efaf1f4a6e283eaf92e05605f10f405e9eb9a9c41896041d0ac@%3Cdev.beam.apache.org%3E, two https://lists.apache.org/thread.html/8dd60395424425f7502d62888c49014430d1d3b06c026606f3db28ab@%3Cuser.beam.apache.org%3E.
可能值得看一些代码:one https://github.com/apache/beam/blob/50f623c023f423aab1336aee136c36ef3c82d1ca/sdks/python/apache_beam/runners/portability/flink_runner_test.py#L40, two https://github.com/apache/beam/blob/master/sdks/python/build.gradle#L347.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)