flink常用命令

使用Maven将自己的代码编译打包

打好的包一般放在工程目录的target子文件夹下

mvn clean package

flink任务运行命令

session模式运行
flink run --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.0-SNAPSHOT.jar

指定用户运行任务,job模式
sudo -u hdfs 
bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.0-SNAPSHOT.jar

job模式运行任务
bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.0.jar


bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.1.jar

bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.2.jar


bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.zclh.data.wordcount.WordCountKafkaInStdOut /data/cdh/test/flink-kafka-1.3.jar


bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.atguigu.hotitems_analysis.KafkaProducerUtil /data/cdh/test/HotItemsAnalysis-1.0.jar


bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.atguigu.hotitems_analysis.HotItems /data/cdh/test/HotItemsAnalysis-2.0.jar

bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 /data/cdh/test/HotItemsAnalysis-3.0.jar --class com.atguigu.hotitems_analysis.HotItems

bin/flink run --class com.atguigu.hotitems_analysis.HotItems /data/cdh/test/HotItemsAnalysis-3.0.jar

启动jar包中指定的类

java -cp /data/cdh/test/HotItemsAnalysis-4.0.jar com.atguigu.hotitems_analysis.KafkaProducerUtil
java -cp /data/cdh/test/HotItemsAnalysis-5.0.jar com.atguigu.hotitems_analysis.KafkaProducerUtil


bin/flink run --class com.atguigu.hotitems_analysis.HotItems /data/cdh/test/HotItemsAnalysis-4.0.jar
bin/flink run --class com.atguigu.hotitems_analysis.HotItems /data/cdh/test/HotItemsAnalysis-5.0.jar
bin/flink run -m yarn-cluster -yjm 1024 -ytm 1024 --class com.atguigu.hotitems_analysis.HotItems /data/cdh/test/HotItemsAnalysis-5.0.jar
上一篇:CDH平台yarn下发送邮件中文乱码


下一篇:cdh 大数据平台搭建