flink在centos7单机安装测试

系统环境:CentOS7.8

flink版本:下载和Scala版本对应的
在这里插入图片描述

flink官方下载地址:https://flink.apache.org/downloads.html

查看jdk

[root@localhost bin]# java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

安装:

解压到指定文件夹

[root@localhost tools]# tar zxvf flink-1.11.6-bin-scala_2.12.tgz -C /root/training/

到安装目录的文件夹下:

[root@localhost ]# cd /root/training/flink-1.11.6/

启动flink服务:

[root@localhost flink-1.11.6]# bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host localhost.
Starting taskexecutor daemon on host localhost.

jps查看进程:

[root@localhost flink-1.11.6]# jps
7926 TaskManagerRunner
8023 Jps
7614 StandaloneSessionClusterEntrypoint

TaskManagerRunnerStandaloneSessionClusterEntrypoint启动才算安装成功;

开始我的TaskManagerRunner没启动,网上找了好多方法都没解决,最后解决办法:

  1. 停止flink:
[root@localhost flink-1.11.6]# bin/stop-cluster.sh
No taskexecutor daemon (pid: 6460) is running anymore on localhost.
No standalonesession daemon (pid: 6150) is running anymore on localhost.

最后发现进程还在:

[root@localhost flink-1.11.6]# jps
7202 Jps
2394 StandaloneSessionClusterEntrypoint
  1. 直接有kill杀死:
[root@localhost flink-1.11.6]# kill -9 2394
[root@localhost flink-1.11.6]# jps
7217 Jps
  1. 再次启动flink:
[root@localhost flink-1.11.6]# bin/start-cluster.sh
Starting cluster.
Starting standalonesession daemon on host localhost.
Starting taskexecutor daemon on host localhost.
[root@localhost flink-1.11.6]# jps
7926 TaskManagerRunner
8023 Jps
7614 StandaloneSessionClusterEntrypoint

5、浏览器访问flink服务,直接访问:http://自己ip:8081/#/overview,可以看到flink已经正常启动。

在这里插入图片描述

运行flink自带样例词频统计

[root@localhost bin]# ./flink run ../examples/batch/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 6959c79777833ad39b8847cb3d3f736d
Program execution finished
Job with JobID 6959c79777833ad39b8847cb3d3f736d has finished.
Job Runtime: 3239 ms
Accumulator Results: 
- fe3b95521fed6b0e1774cd035c55fe5b (java.util.ArrayList) [170 elements]

.......
(respect,1)
(returns,1)
(rub,1)
(s,5)
(say,1)
(scorns,1)
(sea,1)

在这里插入图片描述

安装测试完成。
希望对你有帮助!!!!!!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值