系统相关
首页 > 系统相关> > Flink (一)centos安装Flink v1.12 用于测试

Flink (一)centos安装Flink v1.12 用于测试

作者:互联网

目录

 

 

下载 Flink 安装包

安装过程


 

下载 Flink 安装包

https://flink.apache.org/downloads.html

链接:https://pan.baidu.com/s/1k5x_rjucs47PLBl4jAPo5g 
提取码:qkph 
复制这段内容后打开百度网盘手机App,操作更方便哦

安装过程

1.  为了运行Flink,只需提前安装好 Java 8 或者 Java 11

2. 解压下载好的包,并进入安装目录

$ tar -xzf flink-1.12.0-bin-scala_2.11.tgz
$ cd flink-1.12.0-bin-scala_2.11
$ ll
总用量 2092
-rw-r--r-- 1 501 games 2025120 12月  2 17:30 bash-java-utils.jar
-rwxr-xr-x 1 501 games   20216 12月  2 15:33 config.sh
-rwxr-xr-x 1 501 games    1318 6月  18 2020 find-flink-home.sh
-rwxr-xr-x 1 501 games    2377 6月  18 2020 flink
-rwxr-xr-x 1 501 games    3679 12月  2 15:33 flink-console.sh
-rwxr-xr-x 1 501 games    6569 12月  2 15:33 flink-daemon.sh
-rwxr-xr-x 1 501 games    1564 6月  18 2020 historyserver.sh
-rwxr-xr-x 1 501 games    2295 12月  2 15:33 jobmanager.sh
-rwxr-xr-x 1 501 games    1715 6月  18 2020 kubernetes-session.sh
-rwxr-xr-x 1 501 games    1133 6月  18 2020 mesos-appmaster-job.sh
-rwxr-xr-x 1 501 games    1137 6月  18 2020 mesos-appmaster.sh
-rwxr-xr-x 1 501 games    1944 12月  2 15:33 mesos-jobmanager.sh
-rwxr-xr-x 1 501 games    1889 6月  18 2020 mesos-taskmanager.sh
-rwxr-xr-x 1 501 games    2990 6月  18 2020 pyflink-shell.sh
-rwxr-xr-x 1 501 games    3738 6月  18 2020 sql-client.sh
-rwxr-xr-x 1 501 games    1973 12月  2 15:33 standalone-job.sh
-rwxr-xr-x 1 501 games    1837 8月  19 21:47 start-cluster.sh
-rwxr-xr-x 1 501 games    3310 6月  18 2020 start-scala-shell.sh
-rwxr-xr-x 1 501 games    1854 6月  18 2020 start-zookeeper-quorum.sh
-rwxr-xr-x 1 501 games    1617 8月  19 21:47 stop-cluster.sh
-rwxr-xr-x 1 501 games    1845 6月  18 2020 stop-zookeeper-quorum.sh
-rwxr-xr-x 1 501 games    3692 9月  17 23:26 taskmanager.sh
-rwxr-xr-x 1 501 games    1723 6月  18 2020 yarn-session.sh
-rwxr-xr-x 1 501 games    2281 6月  18 2020 zookeeper.sh

3. 执行 bin下的start-cluster.sh

[root@localhost flink-1.12.0]# ./bin/start-cluster.sh 
Starting cluster.
[INFO] 1 instance(s) of standalonesession are already running on localhost.
Starting standalonesession daemon on host localhost.
[INFO] 1 instance(s) of taskexecutor are already running on localhost.
Starting taskexecutor daemon on host localhost.

4. Flink本地环境已启动,可以使用Flink自带的测试程序进行测试

[root@localhost flink-1.12.0]#  ./bin/flink run examples/streaming/WordCount.jar
Executing WordCount example with default input data set.
Use --input to specify file input.
Printing result to stdout. Use --output to specify output path.
Job has been submitted with JobID c422aa1410f3f218a32d26d138d87246
Program execution finished
Job with JobID c422aa1410f3f218a32d26d138d87246 has finished.
Job Runtime: 137 ms

测试结果使用 tail 查看,输出了结果

[root@localhost opt]# tail -f /data10/flink/flink-1.12.0/log/flink-*-taskexecutor-*.out
==> /data10/flink/flink-1.12.0/log/flink-root-taskexecutor-0-localhost.out <==
(nymph,1)
(in,3)
(thy,1)
(orisons,1)
(be,4)
(all,2)
(my,1)
(sins,1)
(remember,1)
(d,4)

 

标签:flink,v1.12,centos,rwxr,Flink,sh,games,xr,501
来源: https://blog.csdn.net/baoyu_G/article/details/112385852