美文网首页
flink-example分析 batch/WordCount.

flink-example分析 batch/WordCount.

作者: Anthons | 来源:发表于2021-03-18 15:19 被阅读0次

flink-example分析 batch/WordCount.jar 和streaming/SocketWindowWordCount.jar

java版本环境

openjdk version "1.8.0_282" OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.10-b08) OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

flink版本环境

Apache Flink 1.12.2 for Scala 2.12 (asc, sha512)

运行一个示例

1.启动flink集群

$ ./bin/start-cluster.sh

2.运行WordCount实例,默认使用内置数据

$ ./bin/flink run ./examples/batch/WordCount.jar

运行WordCount使用真实数据

$ ./bin/flink run ./examples/batch/WordCount.jar --input /path/to/some/text/data --output /path/to/result

image-20210318150209310.png

3.运行socketwindowWordCount实例

模拟数据流入口

$nc -l 9000

$ ./bin/flink run ./examples/streaming/SocketWindowWordCount.jar --port 9000

image-20210318151544981.png

相关文章

网友评论

      本文标题:flink-example分析 batch/WordCount.

      本文链接:https://www.haomeiwen.com/subject/obtpcltx.html