Running a simple Flink application

In this example, you will use the Stateless Monitoring Application from the Flink Tutorials to build your Flink project, submit a Flink job and monitor your Flink application using the Flink Dashboard in an unsecured environment.

  • You have a CDP Public Cloud environment.
  • You have a CDP username (it can be your own CDP user or a CDP machine user) and a password set to access Data Hub clusters.

    The predefined resource role of this user is at least EnvironmentUser. This resource role provides the ability to view Data Hub clusters and set the FreeIPA password for the environment.

  • Your user is synchronized to the CDP Public Cloud environment.
  • You have a Streaming Analytics cluster.
  1. Clone the simple tutorial from git:
    git clone https://github.com/cloudera/flink-tutorials.git
  2. Access the simple tutorial folder:
    cd flink-tutorials/flink-simple-tutorial
  3. Build your Flink project using maven:
    mvn clean package
  4. Upload the Flink project to your cluster.
    scp target/flink-simple-tutorial-<flink_version>-<csa_version>.jar <your_workload_username>@<master_node_FQDN>:.
    Provide your workload password when prompted.
  5. SSH into the node where you uploaded the job jar using your workload username.
ssh <your_workload_username>@<master_node_FQDN>
Provide your workload password when prompted.
  1. Run the Flink application:
    flink run -d -p 2 -ynm HeapMonitor target/flink-simple-tutorial-<flink_version>-<csa-version>.jar
  2. Navigate to Management Console > Environments, and select the environment where you have created your cluster.
  3. Select the Streaming Analytics cluster.
  4. Click Flink Dashboard from the services.
    The Flink Dashboard opens in a new window.
  5. Click Task Manager on the left side menu.
  6. Monitor your Flink application under logs.