Site icon DataFlair

Install and Run Apache Flink on Windows

Install and Run Apache Flink on Windows

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

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

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

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.

Exit mobile version