Tuesday, February 23, 2016

Flink installation

Download the flink files (http://www.apache.org/dyn/closer.cgi/flink/flink-0.8.1/flink-0.8.1-bin-hadoop1.tgz) to the local home directory and assign the /bin path in .bashrc file. 

$ tar xzf flink-*.tgz   # Unpack the downloaded archive
$ cd flink-0.8.1
$ bin/start-local.sh    # Start Flink

Check the JobManager’s web front end at http://localhost:8081 and make sure everything is up and running.

That's it.

To run  check flink we can use the wordcount example. 

Download test data:

$ wget -O hamlet.txt http://www.gutenberg.org/cache/epub/1787/pg1787.txt

You now have a text file called hamlet.txt in your working directory.
Start the example program:

$ bin/flink run ./examples/flink-java-examples-0.8.1-WordCount.jar file://`pwd`/hamlet.txt file://`pwd`/wordcount-result.txt

You will find a file called wordcount-result.txt in your current directory.

no you have the working copy of flink in your local machine. 


No comments:

Post a Comment