您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页Flink 1.6.0 安装与配置

Flink 1.6.0 安装与配置

来源:二三娱乐

本地单机安装

1. 下载安装

1.1. Mac OS

使用brew安装

$ brew install apache-flink
...
$ flink –version

1.2. 使用安装包

version

下载解压缩到指定目录

2. 启动本地模式

$ cd /usr/local/Cellar/apache-flink/1.6.0/libexec/bin
## Start a Local Flink Cluster
$ ./bin/start-cluster.sh
WebUI

查看启动日志

$ tail log/flink-*-standalonesession-*.log
2018-08-19 16:58:12,169 INFO  org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    - Rest endpoint listening at localhost:8081
2018-08-19 16:58:12,169 INFO  org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    - http://localhost:8081 was granted leadership with leaderSessionID=00000000-0000-0000-0000-000000000000
2018-08-19 16:58:12,169 INFO  org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    - Web frontend listening at http://localhost:8081.
2018-08-19 16:58:12,183 INFO  org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting RPC endpoint for org.apache.flink.runtime.resourcemanager.StandaloneResourceManager at akka://flink/user/resourcemanager .
2018-08-19 16:58:12,281 INFO  org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting RPC endpoint for org.apache.flink.runtime.dispatcher.StandaloneDispatcher at akka://flink/user/dispatcher .
2018-08-19 16:58:12,300 INFO  org.apache.flink.runtime.resourcemanager.StandaloneResourceManager  - ResourceManager akka.tcp://flink@localhost:6123/user/resourcemanager was granted leadership with fencing token 00000000000000000000000000000000
2018-08-19 16:58:12,301 INFO  org.apache.flink.runtime.resourcemanager.slotmanager.SlotManager  - Starting the SlotManager.
2018-08-19 16:58:12,316 INFO  org.apache.flink.runtime.dispatcher.StandaloneDispatcher      - Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was granted leadership with fencing token 00000000-0000-0000-0000-000000000000
2018-08-19 16:58:12,317 INFO  org.apache.flink.runtime.dispatcher.StandaloneDispatcher      - Recovering all persisted jobs.
2018-08-19 16:58:12,790 INFO  org.apache.flink.runtime.resourcemanager.slotmanager.SlotManager  - Registering TaskManager 36b9ebefa932445f13fe25c96cdf1cfd under 619ab62c4f32e88c4a3e61a138b9f68c at the SlotManager.

3. 运行Demo

官方例子,会从一个socket中读一段文本,并且每隔5秒打印每个单词出现的数量

# start a socket client
$ nc -l 9000
# run flink examples
$ ./bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000

查看输出日志

$ tail -f log/flink-*-taskexecutor-*-localhost.out
WordWithCount(hello, 1)
WordWithCount(word, 2)

4. 停止Flink

$ bin/stop-cluster.sh

集群安装

TODO

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务