Running a Flink job

After developing your application, you must submit the job to the Flink cluster. To submit the Flink job, you need to run the Flink client in the command line with also including all the configuration and security parameters along the run command.

  • You have deployed the Flink parcel on your CDP Private Cloud Base cluster.
  • You have HDFS Gateway, Flink and YARN Gateway roles assigned to the host you are using for Flink submission. For instructions, see Cloudera Manager documentation.
  • You have established your HDFS home directory.
The following is a working example of a word count application that reads text from a socket and counts the number of distinct words.
> hdfs dfs -put /opt/cloudera/parcels/FLINK/lib/flink/README.txt /tmp
> flink run -m yarn-cluster \
 /opt/cloudera/parcels/FLINK/lib/flink/examples/streaming/WordCount.jar \
 --input hdfs:///tmp/README.txt \
 --output hdfs:///tmp/ReadMe-Counts
> hdfs dfs -tail /tmp/ReadMe-Counts