Apache Flink is a framework and distributed processing engine for stateful computations over unbounded and bounded data streams, for introduction about Apache Flink components please check our previous article
In this article we will learn together how to setup and run Apache Flink in Standalone mode.
Run Apache Flink Standalone
Flink has been designed to run in all common cluster environments, perform computations at in-memory speed and at any scale. Now we will run Apache Flink Standalone.
Requirement
The following components needs to be ready before we start the installation and setup of Apache Flink
Java
The only requirement for all OS is machine must have a working java 8 or 11 installed. To check if java run in your machine or not execute this command:
java -version
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/001.png)
WSL
Flink runs on Linux and Mac OS, Windows users can run Flink in Cygwin or WSL. So, if you want to run Flink on Windows, you should install WSL or Windows Subsystem for Linux. follow next steps to setup WSL on windows:
1- Go to Settings > Update & Security >
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/202-1024x414.png)
2- Select For Developers from the left menu. Check the Developer Mode radio button
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/203-1024x512.png)
3- Go back to Windows Settings, then search for “Windows Features”, choose “Turn Windows features on or off”. Scroll to find Windows Subsystem for Linux, check the box, and then install it.
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/206-1.png)
Once done, one has to reboot to finish installing the requested changes. Press Restart now. Then go to Microsoft Store and install ubuntu or any other Linux distorts.
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/209-1024x270.png)
Download Flink
-
-
For Windows, Linux and Ubuntu:
-
- Download a binary from the downloads page. You can pick any Scala variant you like.
- Go to the download directory.
- Extract the download archive.
-
-
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/003.png)
-
-
for Mac:
- For MacOS X users, Flink can be installed through Homebrew , Or follow the following commands
-
$ brew install apache-flink
$ flink --version
Run Flink
-
-
For Windows:
- Go to This PC > properties
- Advanced System settings > Environments variable
-
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/007-1024x503.png)
-
-
- Add new variable
- Variable name –> ‘Flink_Home’
- Variable value –> Path flink folder location
- Add new variable
-
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/009-1024x571.png)
-
-
- Go to System Path and add these two paths
- <flink folder location> bin
- <flink folder location>lib
- Go to System Path and add these two paths
-
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/011-1024x589.png)
-
-
- Open Ubuntu or any Linux distorts installed in your machine, and Execute this command.
-
$ cd mnt <flink folder location>bin
$ bash start-cluster.sh
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/015.png)
-
-
For others OS
- Execute this command
-
$ cd mnt <flink folder location>bin
$ bash start-cluster.sh
Check the Dispatcher’s web frontend at http://localhost:8081
![](https://blog.datavalley.technology/wp-content/uploads/2020/05/016-1024x546.png)