Flink入门

Flink入门

启动本地flink实例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 下载flink
$ java -version  
$ wget https://www.apache.org/dyn/closer.lua/flink/flink-1.14.2/flink-1.14.2-bin-scala_2.12.tgz
$ tar -xzf flink-1.14.2-bin-scala_2.11.tgz
$ cd flink-1.14.2-bin-scala_2.11

## 启动本地实例
$ ./bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host.
Starting taskexecutor daemon on host.

## 提交wordcount作业
$ ./bin/flink run examples/streaming/WordCount.jar
$ tail log/flink-*-taskexecutor-*.out
  (nymph,1)
  (in,3)
  (thy,1)
  (orisons,1)
  (be,4)
  (all,2)
  (my,1)
  (sins,1)
  (remember,1)
  (d,4)

## 停止flink集群
$ ./bin/stop-cluster.sh

参考

  1. https://nightlies.apache.org/flink/flink-docs-release-1.14/zh/docs/try-flink/local_installation/

updatedupdated2024-05-152024-05-15