Apache Flink: Difference between revisions
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
</pre> |
</pre> |
||
⚫ | |||
<pre> |
<pre> |
||
cd $FLINK_HOME |
cd $FLINK_HOME |
||
bin/start-local.sh |
bin/start-local.sh |
||
</pre> |
</pre> |
||
Open the UI http://localhost:8081/#/overview |
|||
[[Image:flink-ui.png|thumb|right|200px|Flink UI]] |
|||
</pre> |
|||
Line 28: | Line 36: | ||
Run the SocketWindowWordCount example ([https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount.java source]). |
|||
Terminal 1: Start netcat |
|||
<pre> |
|||
nc -l 9000 |
|||
</pre> |
|||
Submit the Flink program: |
|||
<pre> |
|||
bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000 |
|||
</pre> |
|||
Terminal 1: Add words in netcat input |
|||
<pre> |
|||
lorem ipsum |
|||
ipsum ipsum ipsum |
|||
bye |
|||
</pre> |
|||
Terminal 3: |
|||
<pre> |
|||
tail -f log/flink-*-jobmanager-*.out |
|||
</pre> |
|||
Terminal 4: stop Flink |
|||
<pre> |
|||
bin/stop-local.sh |
|||
</pre> |
|||
⚫ | |||
===Amazon AWS EC2=== |
|||
==Cluster execution== |
==Cluster execution== |
Revision as of 20:17, 15 September 2016
Apache Flink® is an open source platform for distributed stream and batch data processing. Flink’s core is a streaming dataflow engine that provides data distribution, communication, and fault tolerance for distributed computations over data streams.
Getting started
Installation
wget http://www.apache.org/dyn/closer.lua/flink/flink-1.1.2/flink-1.1.2-bin-hadoop27-scala_2.11.tgz tar xf flink-1.1.2-bin-hadoop27-scala_2.11.tgz FLINK_HOME=~/flink-1.1.2 cd $FLINK_HOME ls bin ls examples
cd $FLINK_HOME bin/start-local.sh
Open the UI http://localhost:8081/#/overview
cd $FLINK_HOME bin/start-scala-shell.sh
Run the SocketWindowWordCount example (source).
Terminal 1: Start netcat
nc -l 9000
Submit the Flink program:
bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000
Terminal 1: Add words in netcat input
lorem ipsum ipsum ipsum ipsum bye
Terminal 3:
tail -f log/flink-*-jobmanager-*.out
Terminal 4: stop Flink
bin/stop-local.sh