Ubuntu下flink的安装
PreRequest: Java
安装
- 下载软件包:
wget https://mirror.bit.edu.cn/apache/flink/flink-1.10.0/flink-1.10.0-src.tgz
- 解压软件包
tar xzf flin-*.tgz
cd flink-1.10.0
- 启动 flink
./bin/start-cluster.sh
验证:打开页面 localhost:8081
或 查看日志
tail log/flink-*-standlonession-*.log
运行Demo
- 使用 netcat
nc -l 9000
- 提交Flink程序
./bin/flink run examples/streaming/SocketWordCount.jar --port 9000
测试
nc -l 9000
hello world flink
flink is the best
hello again
查看输出:
tail -f log/flink-*-taskexecutor-*out
world 1
flink 2
is 1
the 1
best 1
hello 2
again 1
- 关闭cluster
./bin/stop-cluster.sh
参考链接:官网教程