Install and Run Apache Flink on Windows

1. Objective

In this Apache Flink installation on windows tutorial, we will learn how to install Apache Flink on Windows. Apache Flink can be run on Windows as well as Linux. Here in this blog, we will see how to install Apache Flink on Windows on single node cluster mode and how can we run wordcount program. You can also refer how to install Apache Flink on ubuntu.

Install and Run Apache Flink on Windows

Install and Run Apache Flink on Windows

2. Apache Flink Installation on Windows

2.1. Platform

I. Platform Requirements

  • Operating system: Windows 7 or higher
  • Java 7.x or higher

2.2. Install Java

Apache Flink requires Java to be installed as it runs on JVM. So, let’s begin by installing Java. In order to install Java, firstly we need to download it and then we will be able to install the Java. You can download java from this link
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
To check whether installation procedure gets successfully completed and a completely working Java is installed or not and to know the version of Java installed we have to use the below command:
C:\Users\dataflair\ java -version

2.3. Install Apache Flink

I. Download the latest version of Flink from official website

http://flink.apache.org/downloads.html

II. Untar the downloaded file

In order to extract all the contents of compressed Apache Flink file package, right click on the file flink-0.8-incubating-SNAPSHOT-bin-hadoop2.tgz and select extract here or alternatively you can use other tools also like: 7-zip or tar tool. For ease rename file to flink.

III. Change the working directory to Flink Home

To access the commands and to run the example jar change directory to flink by using this command.
C:\Users\dataflair\ cd flink
C:\Users\dataflair\flink cd bin

IV. Start Flink

To Start Apache Flink in a local mode use this command.
C:\Users\dataflair\flink\bin start-local.bat

After that you will see this message on screen:
 Starting Flink job manager. Web interface by default on http://localhost:8081/.
 Don't close this batch window. Stop job manager by pressing Ctrl+C.

To run any job open another terminal. You can run job by flink.bat.

V. Check status

To check the status of running services simply change the path where your bin directory exist in JDK.
C:\Users\dataflair\flink\bin cd C:\Program Files\Java\jdk1.7.0_79\bin
C:\Program Files\Java\jdk1.7.0_79\bin jps
Output will be-
6740 Jps
6725 JobManager

VI. Apache Flink Web UI

To start Web UI use the following Url:
localhost:8081

2.4. Run Wordcount example on Flink

To run Wordcount example on Local system use the following command.
Before that make an input file in a home directory, for example, C:\Users\dataflair\input.txt with some data as a sample and save it as input.txt or by any name of your choice (replace input.txt with your file name )
C:\Users\dataflair\flink\bin flink.bat run C:\Users\dataflair\flink\examples\batch\WordCount.jar -input C:\Users\dataflair\input.txt -output C:\Users\dataflair\output.txt
use -input or -output to highlight the input and output path same as above example.
To learn more about Flink operations follow this Flink Shell commands guide.

6 Responses

  1. Elis says:

    Worked like a charm. I have successfully deployed Flink on Windows machine. I run Flink wordcount example as well in Java. You have ended my four day lengthy hunt! God Bless you man. Have a great day.

  2. Meya says:

    Nicely explained the prerequisites and steps to install Apache Flink on Windows. Please share some Flink examples as well to practice as this is the latest technology that is covering IT market very fastly. I would like to start my career in this technology now.
    Hope you understand!!

  3. Ahupibis says:

    Nice article..

  4. kukiuwax says:

    Flink is a technology that is capturing IT market very fastly and is widely used now in Europe, Singapore, US, and other countries. This blog on how to install Flink on Windows is very helpful. Keep sharing more Flink material. Thanks.

  5. Nikita says:

    Nice description for beginners to learn installation of Apache Flink on Windows. Thank you. Keep it up!!

  6. Nathon says:

    Nice info. Can you please provide how to setup flink in Hortonworks?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.