This section describes how to use Flink to run wordcount jobs.
cd /opt/hadoopclient
source /opt/hadoopclient/bigdata_env
After a human-machine user is created, log in to FusionInsight Manager as the new user and change the initial password as prompted.
To submit or run jobs on Flink, the user must have the following permissions:
vi /opt/hadoopclient/Flink/flink/conf/flink-conf.yaml
Add the keytab path and username to the /opt/hadoopclient/Flink/flink/conf/flink-conf.yaml configuration file.
security.kerberos.login.keytab: <user.keytab file path> security.kerberos.login.principal: <Username>
Example:
security.kerberos.login.keytab: /opt/hadoopclient/Flink/flink/conf/user.keytab security.kerberos.login.principal: test
cd /opt/hadoopclient/Flink/flink/bin
sh generate_keystore.sh
The script automatically changes the SSL-related parameter values in the /opt/hadoopclient/Flink/flink/conf/flink-conf.yaml file.
After the generate_keystore.sh script is executed, the flink.keystore and flink.truststore file paths are automatically set to absolute paths in the flink-conf.yaml file by default. In this case, you need to place the flink.keystore and flink.truststore files in the conf directory to the absolute paths of the Flink client and each Yarn node, respectively.
cd /opt/hadoopclient/Flink/flink/conf/
mkdir ssl
mv flink.keystore ssl/
mv flink.truststore ssl/
security.ssl.keystore: ssl/flink.keystore security.ssl.truststore: ssl/flink.truststore
yarn-session.sh -nm "session-name"
flink run /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar
flink run -m yarn-cluster /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar
cd /opt/hadoopclient/Flink/flink/conf/
yarn-session.sh -t ssl/ -nm "session-name"
... Cluster started: Yarn cluster with application id application_1624937999496_0017 JobManager Web Interface: http://192.168.1.150:32261
Start a new client connection and submit the job:
source /opt/hadoopclient/bigdata_env
flink run /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar
... Job has been submitted with JobID 587d5498fff18d8b2501fdf7ebb9c4fb Program execution finished Job with JobID 587d5498fff18d8b2501fdf7ebb9c4fb has finished. Job Runtime: 19917 ms
cd /opt/hadoopclient/Flink/flink/conf/
flink run -m yarn-cluster -yt ssl/ /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar
... Cluster started: Yarn cluster with application id application_1624937999496_0016 Job has been submitted with JobID e9c59fb48f44feae7b62dd90336d6d7f Program execution finished Job with JobID e9c59fb48f44feae7b62dd90336d6d7f has finished. Job Runtime: 18155 ms
cd /opt/hadoopclient/Flink/flink/conf/
yarn-session.sh -nm "session-name"
flink run /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar
flink run -m yarn-cluster /opt/hadoopclient/Flink/flink/examples/streaming/WordCount.jar