https://mp.weixin.qq.com/s/2kbMDuEH70D4s5io6UOBCw
https://mp.weixin.qq.com/s?__biz=Mzg3MTIzOTgxOA==&mid=2247483798&idx=1&sn=febfc8fe3bc0aabd52e96da2bac872ab&scene=21#wechat_redirect
在Linux上单节点安装方式与cygwin一样,下载Apache Flink 1.9.0 for Scala 2.12,然后解压后只需要启动start-cluster.sh。
集群安装
集群安装分为以下几步:
1、在每台机器上复制解压出来的flink目录。
2、选择一个作为master节点,然后修改所有机器conf/flink-conf.yaml
jobmanager.rpc.address = master主机名
3、修改conf/slaves,将所有work节点写入
work01
work02
4、在master上启动集群
./bin/start-cluster.sh
运行flink示例程序
批处理示例:
提交flink的批处理examples程序:
bin/flink run examples/batch/WordCount.jar
这是flink提供的examples下的批处理例子程序,统计单词个数。
$ bin/flink run examples/batch/WordCount.jar
Starting execution of program
Executing WordCount example with default input data set.
Use --input to specify file input.
Printing result to stdout. Use --output to specify output path.
(a,5)
(action,1)
(after,1)
(against,1)
(all,2)
(and,12)
(arms,1)
(arrows,1)
(awry,1)
(ay,1)
得到结果,这里统计的是默认的数据集,可以通过—input —output指定输入输出。
我们可以在页面中查看运行的情况:
—hostname 192.168.161.7 —port 9999
—hostname 192.168.161.7 —port 9990