Install and Run Apache Flink on Windows

Free Flink course with real-time projects Start Now!!

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.

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:
[php]C:\Users\dataflair\ java -version[/php]

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.
[php]C:\Users\dataflair\ cd flink[/php]
[php]C:\Users\dataflair\flink cd bin[/php]

IV. Start Flink

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

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.
[php]C:\Users\dataflair\flink\bin cd C:\Program Files\Java\jdk1.7.0_79\bin [/php]
[php]C:\Program Files\Java\jdk1.7.0_79\bin jps [/php]
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 )
[php]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[/php]
use -input or -output to highlight the input and output path same as above example.

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

follow dataflair on YouTube

9 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?

  7. Haftamu Hailu says:

    I followed the steps and tried to install Apache Flink on Window 10 Machine, Unfortunately, It did not work for me.
    Upon Unzipping the downloaded file, I can not find the “start-local.bat” file on the bin directory.

    Any helps would be greatly appreciated!!!

  8. Dnyaneshwar says:

    I followed all the steps but unfortunately facing an below error :-

    ‘start-local.bat’ is not recognized as an internal or external command,
    operable program or batch file.

    Also tried to add the env variables .Can anyone please advise

  9. Mike says:

    There is no start-local.bat in Flink directory – this is Linux package

Leave a Reply

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